Skip to content

Commit

Permalink
Application export
Browse files Browse the repository at this point in the history
Small macOS regression
  • Loading branch information
Stefterv committed Dec 16, 2024
1 parent 284594f commit 49e5878
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 12 deletions.
19 changes: 17 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,24 @@ tasks.register<Copy>("copyJavaMode"){
from(project(":java").layout.buildDirectory.dir("resources-bundled"))
into(layout.buildDirectory.dir("resources-bundled"))
}

tasks.register<Copy>("renameWindres") {
dependsOn("copyJavaMode", "copyShared", "unzipJDK")
val dir = layout.buildDirectory.dir("resources-bundled/common/modes/java/application/launch4j/bin/")
val os: OperatingSystem = DefaultNativePlatform.getCurrentOperatingSystem()
val platform = when {
os.isWindows -> "windows"
os.isMacOsX -> "macos"
else -> "linux"
}
from(dir) {
include("*-$platform*")
rename("(.*)-$platform(.*)", "$1$2")
}
duplicatesStrategy = DuplicatesStrategy.INCLUDE
into(dir)
}
afterEvaluate {
tasks.findByName("prepareAppResources")?.dependsOn("unzipJDK","copyShared", "copyCore", "unzipExamples")
tasks.findByName("prepareAppResources")?.dependsOn("unzipJDK","copyShared", "copyCore", "unzipExamples","renameWindres", "copyJavaMode")
tasks.register("setExecutablePermissions") {
description = "Sets executable permissions on binaries in Processing.app resources"
group = "compose desktop"
Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ junit = { module = "junit:junit", version = "4.13.2" }
mockito = { module = "org.mockito:mockito-core", version = "4.11.0" }
antlr = { module = "org.antlr:antlr4", version = "4.7.2" }
eclipseJDT = { module = "org.eclipse.jdt:org.eclipse.jdt.core", version = "3.16.0" }
eclipseJDTCompiler = { module = "org.eclipse.jdt:org.eclipse.jdt.compiler.apt", version = "1.3.400" }
classpathExplorer = { module = "com.google.classpath-explorer:classpath-explorer", version = "1.0" }
netbeansSwing = { module = "org.netbeans.api:org-netbeans-swing-outline", version = "RELEASE210" }
ant = { module = "org.apache.ant:ant", version = "1.10.14" }
Expand Down
1 change: 1 addition & 0 deletions java/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ dependencies{
implementation(project(":java:preprocessor"))

implementation(libs.eclipseJDT)
implementation(libs.eclipseJDTCompiler)
implementation(libs.classpathExplorer)
implementation(libs.netbeansSwing)
implementation(libs.ant)
Expand Down
22 changes: 12 additions & 10 deletions java/src/processing/mode/java/JavaBuild.java
Original file line number Diff line number Diff line change
Expand Up @@ -732,18 +732,20 @@ protected boolean exportApplication(File destFolder,
writer.println("APPL????");
writer.flush();
writer.close();
if(System.getProperty("compose.application.resources.dir") == null) {
// Use faster(?) native copy here (also to do sym links)
if (embedJava) {
Util.copyDirNative(new File(contentsOrig, "PlugIns"),
new File(contentsFolder, "PlugIns"));
}

// Use faster(?) native copy here (also to do sym links)
if (embedJava) {
Util.copyDirNative(new File(contentsOrig, "PlugIns"),
new File(contentsFolder, "PlugIns"));
File resourcesFolder = new File(contentsFolder, "Resources");
Util.copyDir(new File(contentsOrig, "Resources/en.lproj"),
new File(resourcesFolder, "en.lproj"));
Util.copyFile(mode.getContentFile("application/application.icns"),
new File(resourcesFolder, "application.icns"));
}

File resourcesFolder = new File(contentsFolder, "Resources");
Util.copyDir(new File(contentsOrig, "Resources/en.lproj"),
new File(resourcesFolder, "en.lproj"));
Util.copyFile(mode.getContentFile("application/application.icns"),
new File(resourcesFolder, "application.icns"));
// TODO: Handle the java embed and Icon with the new build system

} else if (exportPlatform == PConstants.LINUX) {
if (embedJava) {
Expand Down

0 comments on commit 49e5878

Please sign in to comment.