Skip to content

Commit 49e5878

Browse files
committed
Application export
Small macOS regression
1 parent 284594f commit 49e5878

File tree

4 files changed

+31
-12
lines changed

4 files changed

+31
-12
lines changed

app/build.gradle.kts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,24 @@ tasks.register<Copy>("copyJavaMode"){
167167
from(project(":java").layout.buildDirectory.dir("resources-bundled"))
168168
into(layout.buildDirectory.dir("resources-bundled"))
169169
}
170-
170+
tasks.register<Copy>("renameWindres") {
171+
dependsOn("copyJavaMode", "copyShared", "unzipJDK")
172+
val dir = layout.buildDirectory.dir("resources-bundled/common/modes/java/application/launch4j/bin/")
173+
val os: OperatingSystem = DefaultNativePlatform.getCurrentOperatingSystem()
174+
val platform = when {
175+
os.isWindows -> "windows"
176+
os.isMacOsX -> "macos"
177+
else -> "linux"
178+
}
179+
from(dir) {
180+
include("*-$platform*")
181+
rename("(.*)-$platform(.*)", "$1$2")
182+
}
183+
duplicatesStrategy = DuplicatesStrategy.INCLUDE
184+
into(dir)
185+
}
171186
afterEvaluate {
172-
tasks.findByName("prepareAppResources")?.dependsOn("unzipJDK","copyShared", "copyCore", "unzipExamples")
187+
tasks.findByName("prepareAppResources")?.dependsOn("unzipJDK","copyShared", "copyCore", "unzipExamples","renameWindres", "copyJavaMode")
173188
tasks.register("setExecutablePermissions") {
174189
description = "Sets executable permissions on binaries in Processing.app resources"
175190
group = "compose desktop"

gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ junit = { module = "junit:junit", version = "4.13.2" }
1515
mockito = { module = "org.mockito:mockito-core", version = "4.11.0" }
1616
antlr = { module = "org.antlr:antlr4", version = "4.7.2" }
1717
eclipseJDT = { module = "org.eclipse.jdt:org.eclipse.jdt.core", version = "3.16.0" }
18+
eclipseJDTCompiler = { module = "org.eclipse.jdt:org.eclipse.jdt.compiler.apt", version = "1.3.400" }
1819
classpathExplorer = { module = "com.google.classpath-explorer:classpath-explorer", version = "1.0" }
1920
netbeansSwing = { module = "org.netbeans.api:org-netbeans-swing-outline", version = "RELEASE210" }
2021
ant = { module = "org.apache.ant:ant", version = "1.10.14" }

java/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ dependencies{
2828
implementation(project(":java:preprocessor"))
2929

3030
implementation(libs.eclipseJDT)
31+
implementation(libs.eclipseJDTCompiler)
3132
implementation(libs.classpathExplorer)
3233
implementation(libs.netbeansSwing)
3334
implementation(libs.ant)

java/src/processing/mode/java/JavaBuild.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -732,18 +732,20 @@ protected boolean exportApplication(File destFolder,
732732
writer.println("APPL????");
733733
writer.flush();
734734
writer.close();
735+
if(System.getProperty("compose.application.resources.dir") == null) {
736+
// Use faster(?) native copy here (also to do sym links)
737+
if (embedJava) {
738+
Util.copyDirNative(new File(contentsOrig, "PlugIns"),
739+
new File(contentsFolder, "PlugIns"));
740+
}
735741

736-
// Use faster(?) native copy here (also to do sym links)
737-
if (embedJava) {
738-
Util.copyDirNative(new File(contentsOrig, "PlugIns"),
739-
new File(contentsFolder, "PlugIns"));
742+
File resourcesFolder = new File(contentsFolder, "Resources");
743+
Util.copyDir(new File(contentsOrig, "Resources/en.lproj"),
744+
new File(resourcesFolder, "en.lproj"));
745+
Util.copyFile(mode.getContentFile("application/application.icns"),
746+
new File(resourcesFolder, "application.icns"));
740747
}
741-
742-
File resourcesFolder = new File(contentsFolder, "Resources");
743-
Util.copyDir(new File(contentsOrig, "Resources/en.lproj"),
744-
new File(resourcesFolder, "en.lproj"));
745-
Util.copyFile(mode.getContentFile("application/application.icns"),
746-
new File(resourcesFolder, "application.icns"));
748+
// TODO: Handle the java embed and Icon with the new build system
747749

748750
} else if (exportPlatform == PConstants.LINUX) {
749751
if (embedJava) {

0 commit comments

Comments
 (0)