Remove dependency on Java mode and copy instead

This commit is contained in:
Stef Tervelde
2025-01-25 17:46:34 +01:00
parent e1dd29c6fe
commit 205fc07d19
5 changed files with 32 additions and 15 deletions

9
.idea/runConfigurations/Sketch.xml generated Normal file
View File

@@ -0,0 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Sketch" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="Basic" />
<module name="processing.core.examples.main" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>

View File

@@ -15,7 +15,7 @@ plugins{
group = rootProject.group
tasks.withType<JavaExec> {
systemProperty("processing.version", version)
systemProperty("processing.revision", "1296")
systemProperty("processing.revision", "1300")
systemProperty("processing.contributions.source", "https://contributions-preview.processing.org/contribs.txt")
systemProperty("processing.download.page", "https://processing.org/download/")
systemProperty("processing.download.latest", "https://processing.org/download/latest.txt")
@@ -49,7 +49,7 @@ compose.desktop {
modules("jdk.jdi", "java.compiler")
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "Processing"
packageVersion = rootProject.version as String
packageVersion = rootProject.version.toString()
macOS{
bundleID = "org.processing.app"
@@ -78,15 +78,13 @@ compose.desktop {
}
dependencies {
implementation(project(":core"))
implementation(libs.flatlaf)
implementation(libs.jna)
implementation(libs.jnaplatform)
implementation(project(":core"))
runtimeOnly(project(":java"))
implementation(project(":java:preprocessor"))
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material)
@@ -104,11 +102,20 @@ dependencies {
// Most of these are shims to be compatible with the old build system
// They should be removed in the future, as we work towards making things more Gradle-native
tasks.register<Copy>("copyCore"){
dependsOn(project(":core").tasks.jar)
from(project(":core").layout.buildDirectory.dir("libs"))
from(project(":core").configurations.runtimeClasspath)
val project = project(":core")
dependsOn(project.tasks.jar)
from(project.layout.buildDirectory.dir("libs"))
from(project.configurations.runtimeClasspath)
into(layout.buildDirectory.dir("resources-bundled/common/core/library"))
}
tasks.register<Copy>("copyJava"){
val project = project(":java")
dependsOn(project.tasks.jar)
from(project.layout.buildDirectory.dir("libs"))
from(project.configurations.runtimeClasspath)
into(layout.buildDirectory.dir("resources-bundled/common/modes/java/mode"))
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
tasks.register<Download>("downloadJDK") {
val os: OperatingSystem = DefaultNativePlatform.getCurrentOperatingSystem()
val arch: String = System.getProperty("os.arch").let { originalArch ->
@@ -124,7 +131,8 @@ tasks.register<Download>("downloadJDK") {
os.isMacOsX -> "mac"
else -> "linux"
}
val javaVersion = "17"
val javaVersion = System.getProperty("java.version").split(".")[0]
val imageType = "jdk"
src("https://api.adoptium.net/v3/binary/latest/" +
@@ -142,7 +150,7 @@ tasks.register<Copy>("unzipJDK") {
val dl = tasks.findByPath("downloadJDK") as Download
dependsOn(dl)
val os: OperatingSystem = DefaultNativePlatform.getCurrentOperatingSystem()
val os = DefaultNativePlatform.getCurrentOperatingSystem()
val archive = if (os.isWindows) {
zipTree(dl.dest)
} else {
@@ -215,7 +223,7 @@ tasks.register<Copy>("renameWindres") {
into(dir)
}
afterEvaluate {
tasks.findByName("prepareAppResources")?.dependsOn("unzipJDK","copyShared", "copyCore", "unzipExamples","renameWindres", "copyJavaMode")
tasks.findByName("prepareAppResources")?.dependsOn("unzipJDK","copyShared", "copyCore", "copyJava", "unzipExamples","renameWindres", "copyJavaMode")
tasks.register("setExecutablePermissions") {
description = "Sets executable permissions on binaries in Processing.app resources"
group = "compose desktop"

View File

@@ -394,8 +394,7 @@ public class Platform {
static public File getJavaHome() {
var resourcesDir = System.getProperty("compose.application.resources.dir");
if(resourcesDir != null) {
// find the jdk folder starting with jdk-17
var jdkFolder = Arrays.stream(new File(resourcesDir).listFiles((dir, name) -> dir.isDirectory() && name.startsWith("jdk-17")))
var jdkFolder = Arrays.stream(new File(resourcesDir).listFiles((dir, name) -> dir.isDirectory() && name.startsWith("jdk-")))
.findFirst()
.orElse(null);
if(Platform.isMacOS()){

View File

@@ -1,5 +1,5 @@
group = "org.processing"
version = "4.3.3"
version = "4.4.0"
plugins {
kotlin("jvm") version libs.versions.kotlin apply false

View File

@@ -2,6 +2,7 @@ import com.vanniktech.maven.publish.SonatypeHost
plugins {
id("java")
kotlin("jvm") version libs.versions.kotlin
alias(libs.plugins.mavenPublish)
}