11plugins {
2- kotlin(" jvm" ) version " 2.0.20 "
2+ kotlin(" jvm" ) version libs.versions.kotlin
33 kotlin(" plugin.serialization" ) version " 1.9.0"
4- }
54
6- group = " org.processing"
7- version = " 1.0-SNAPSHOT"
5+ // TODO Unclear whether the whole Compose dependency is necessary
6+ alias(libs.plugins.compose.compiler)
7+ alias(libs.plugins.jetbrainsCompose)
8+ }
89
910repositories {
1011 mavenCentral()
@@ -13,62 +14,49 @@ repositories {
1314}
1415
1516dependencies {
16- // compileOnly(files("/Applications/Processing. app/Contents/Java/pde.jar/**/ "))
17+ compileOnly(project( " : app" ))
1718 implementation(project(" :core" ))
18- implementation(project(" :app" ))
1919
2020 implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3" )
2121 implementation(" org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1" )
2222
23- testImplementation(kotlin(" test" ))
23+ implementation(compose.runtime)
24+ implementation(compose.foundation)
25+ implementation(compose.material)
26+ implementation(compose.ui)
27+ implementation(compose.components.resources)
28+ implementation(compose.components.uiToolingPreview)
2429}
2530
26- project(" :app" ).tasks.named(" run" ).configure {
27- dependsOn(tasks.named(" installLibrary" ))
28- }
29- tasks.create<Copy >(" copyJars" ) {
30- group = " processing"
31- dependsOn(tasks.jar)
32- from(layout.buildDirectory.dir(" libs" )){
33- include(" **/*.jar" )
31+ tasks.register<Copy >(" createMode" ) {
32+ dependsOn(" jar" )
33+ into(layout.buildDirectory.dir(" mode" ))
34+ // TODO Why is there a duplicate in the first place?
35+ duplicatesStrategy = DuplicatesStrategy .WARN
36+
37+ from(layout.projectDirectory.dir(" library" )) {
38+ include (" **" )
39+ }
40+
41+ from(layout.projectDirectory) {
42+ include(" js/**" )
43+ }
44+
45+ from(configurations.runtimeClasspath) {
46+ into(" mode" )
47+ }
48+
49+ from(tasks.jar) {
50+ into(" mode" )
3451 }
35- from(configurations.compileClasspath)
36- into(layout.buildDirectory.dir(" library/mode" ))
37- duplicatesStrategy = DuplicatesStrategy .INCLUDE
38- }
39- tasks.create<Copy >(" createLibrary" ) {
40- group = " processing"
41- from(" library" )
42- into(layout.buildDirectory.dir(" library" ))
43- }
44- tasks.create<Copy >(" installLibrary" ) {
45- group = " processing"
46- dependsOn(tasks.named(" createLibrary" ))
47- dependsOn(tasks.named(" copyJars" ))
48- from(layout.buildDirectory.dir(" library" ))
49- into(" ${System .getProperty(" user.home" )} /sketchbook/modes/p5js" )
50- }
51- // tasks.register<JavaExec>("runProcessing") {
52- // dependsOn(tasks.named("installLibrary"))
53- // group = "processing"
54- // classpath = files(fileTree("/Applications/Processing.app/Contents/Java/"){
55- // include("*.jar")
56- // })
57- // mainClass.set("processing.app.Base") // Your main class
58- //
59- // // Optional: Add arguments if needed
60- // args = listOf("")
61- //
62- // // Optional: Add JVM arguments if needed
63- // jvmArgs = listOf("-Xmx2g")
64- // }
65- tasks.jar {
66- archiveVersion.set(" " )
67- archiveBaseName.set(" p5js" )
6852}
69- tasks.test {
70- useJUnitPlatform()
53+
54+ tasks.register<Copy >(" includeMode" ) {
55+ dependsOn(" createMode" )
56+ from(tasks.named(" createMode" ))
57+ into(project(" :app" ).layout.buildDirectory.dir(" resources-bundled/common/modes/p5js" ))
7158}
72- kotlin {
73- jvmToolchain(17 )
59+
60+ project(" :app" ).tasks.named(" includeProcessingResources" ).configure {
61+ dependsOn(tasks.named(" includeMode" ))
7462}
0 commit comments