1+ plugins {
2+ kotlin(" jvm" ) version " 2.0.20"
3+ kotlin(" plugin.serialization" ) version " 1.9.0"
4+ }
5+
6+ group = " org.processing"
7+ version = " 1.0-SNAPSHOT"
8+
9+ repositories {
10+ mavenCentral()
11+ google()
12+ maven { url = uri(" https://jogamp.org/deployment/maven" ) }
13+ }
14+
15+ dependencies {
16+ // compileOnly(files("/Applications/Processing.app/Contents/Java/pde.jar/**/"))
17+ implementation(project(" :core" ))
18+ implementation(project(" :app" ))
19+
20+ implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3" )
21+ implementation(" org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1" )
22+
23+ testImplementation(kotlin(" test" ))
24+ }
25+
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" )
34+ }
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" )
68+ }
69+ tasks.test {
70+ useJUnitPlatform()
71+ }
72+ kotlin {
73+ jvmToolchain(17 )
74+ }
0 commit comments