Skip to content

Commit 205fc07

Browse files
committed
Remove dependency on Java mode and copy instead
1 parent e1dd29c commit 205fc07

5 files changed

Lines changed: 32 additions & 15 deletions

File tree

.idea/runConfigurations/Sketch.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle.kts

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ plugins{
1515
group = rootProject.group
1616
tasks.withType<JavaExec> {
1717
systemProperty("processing.version", version)
18-
systemProperty("processing.revision", "1296")
18+
systemProperty("processing.revision", "1300")
1919
systemProperty("processing.contributions.source", "https://contributions-preview.processing.org/contribs.txt")
2020
systemProperty("processing.download.page", "https://processing.org/download/")
2121
systemProperty("processing.download.latest", "https://processing.org/download/latest.txt")
@@ -49,7 +49,7 @@ compose.desktop {
4949
modules("jdk.jdi", "java.compiler")
5050
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
5151
packageName = "Processing"
52-
packageVersion = rootProject.version as String
52+
packageVersion = rootProject.version.toString()
5353

5454
macOS{
5555
bundleID = "org.processing.app"
@@ -78,15 +78,13 @@ compose.desktop {
7878
}
7979

8080
dependencies {
81+
implementation(project(":core"))
82+
8183
implementation(libs.flatlaf)
8284

8385
implementation(libs.jna)
8486
implementation(libs.jnaplatform)
8587

86-
implementation(project(":core"))
87-
runtimeOnly(project(":java"))
88-
implementation(project(":java:preprocessor"))
89-
9088
implementation(compose.runtime)
9189
implementation(compose.foundation)
9290
implementation(compose.material)
@@ -104,11 +102,20 @@ dependencies {
104102
// Most of these are shims to be compatible with the old build system
105103
// They should be removed in the future, as we work towards making things more Gradle-native
106104
tasks.register<Copy>("copyCore"){
107-
dependsOn(project(":core").tasks.jar)
108-
from(project(":core").layout.buildDirectory.dir("libs"))
109-
from(project(":core").configurations.runtimeClasspath)
105+
val project = project(":core")
106+
dependsOn(project.tasks.jar)
107+
from(project.layout.buildDirectory.dir("libs"))
108+
from(project.configurations.runtimeClasspath)
110109
into(layout.buildDirectory.dir("resources-bundled/common/core/library"))
111110
}
111+
tasks.register<Copy>("copyJava"){
112+
val project = project(":java")
113+
dependsOn(project.tasks.jar)
114+
from(project.layout.buildDirectory.dir("libs"))
115+
from(project.configurations.runtimeClasspath)
116+
into(layout.buildDirectory.dir("resources-bundled/common/modes/java/mode"))
117+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
118+
}
112119
tasks.register<Download>("downloadJDK") {
113120
val os: OperatingSystem = DefaultNativePlatform.getCurrentOperatingSystem()
114121
val arch: String = System.getProperty("os.arch").let { originalArch ->
@@ -124,7 +131,8 @@ tasks.register<Download>("downloadJDK") {
124131
os.isMacOsX -> "mac"
125132
else -> "linux"
126133
}
127-
val javaVersion = "17"
134+
135+
val javaVersion = System.getProperty("java.version").split(".")[0]
128136
val imageType = "jdk"
129137

130138
src("https://api.adoptium.net/v3/binary/latest/" +
@@ -142,7 +150,7 @@ tasks.register<Copy>("unzipJDK") {
142150
val dl = tasks.findByPath("downloadJDK") as Download
143151
dependsOn(dl)
144152

145-
val os: OperatingSystem = DefaultNativePlatform.getCurrentOperatingSystem()
153+
val os = DefaultNativePlatform.getCurrentOperatingSystem()
146154
val archive = if (os.isWindows) {
147155
zipTree(dl.dest)
148156
} else {
@@ -215,7 +223,7 @@ tasks.register<Copy>("renameWindres") {
215223
into(dir)
216224
}
217225
afterEvaluate {
218-
tasks.findByName("prepareAppResources")?.dependsOn("unzipJDK","copyShared", "copyCore", "unzipExamples","renameWindres", "copyJavaMode")
226+
tasks.findByName("prepareAppResources")?.dependsOn("unzipJDK","copyShared", "copyCore", "copyJava", "unzipExamples","renameWindres", "copyJavaMode")
219227
tasks.register("setExecutablePermissions") {
220228
description = "Sets executable permissions on binaries in Processing.app resources"
221229
group = "compose desktop"

app/src/processing/app/Platform.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,7 @@ static public File getContentFile(String name) {
394394
static public File getJavaHome() {
395395
var resourcesDir = System.getProperty("compose.application.resources.dir");
396396
if(resourcesDir != null) {
397-
// find the jdk folder starting with jdk-17
398-
var jdkFolder = Arrays.stream(new File(resourcesDir).listFiles((dir, name) -> dir.isDirectory() && name.startsWith("jdk-17")))
397+
var jdkFolder = Arrays.stream(new File(resourcesDir).listFiles((dir, name) -> dir.isDirectory() && name.startsWith("jdk-")))
399398
.findFirst()
400399
.orElse(null);
401400
if(Platform.isMacOS()){

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group = "org.processing"
2-
version = "4.3.3"
2+
version = "4.4.0"
33

44
plugins {
55
kotlin("jvm") version libs.versions.kotlin apply false

core/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import com.vanniktech.maven.publish.SonatypeHost
22

33
plugins {
44
id("java")
5+
kotlin("jvm") version libs.versions.kotlin
56
alias(libs.plugins.mavenPublish)
67
}
78

0 commit comments

Comments
 (0)