FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: preserve exec permissions on jspawnhelper in bundled JDK ([#1537… by ZanDev32 · Pull Request #1542 · processing/processing4 · GitHub

Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .java  (1) .kts  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
21 changes: 17 additions & 4 deletions app/build.gradle.kts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ dependencies {
testImplementation(libs.junitJupiterParams)

testRuntimeOnly("org.junit.platform:junit-platform-launcher")

}

tasks.test {
Expand Down Expand Up @@ -451,9 +451,18 @@ tasks.register<Copy>("includeJdk") {
from(jdkHome)
destinationDir = composeResources("jdk").get().asFile

fileTree(destinationDir).files.forEach { file ->
file.setWritable(true, false)
file.setReadable(true, false)
doLast {
val sourceJdkHome = jdkHome.get()
fileTree(destinationDir).files.forEach { file ->
// Copy preserves the source exec bit, but some environments strip it.
// Re-apply exec on files that should be executable.
val sourceFile = File(sourceJdkHome, file.relativeTo(destinationDir).path)
if (sourceFile.canExecute()) {
file.setExecutable(true, false)
}
file.setWritable(true, false)
file.setReadable(true, false)
}
}
}
tasks.register<Copy>("includeSharedAssets"){
Expand Down Expand Up @@ -648,6 +657,10 @@ tasks.register("setExecutablePermissions") {
include("**/resources/**/*.dylib")
include("**/resources/**/*.so")
include("**/resources/**/*.exe")
// Also cover the IDE runtime (jspawnhelper, jexec, bin/*) — same issue
// https://github.com/processing/processing4/issues/1537
include("**/runtime/**/bin/**")
include("**/runtime/**/lib/**")
}.forEach { file ->
if (file.isFile) {
file.setExecutable(true, false)
Expand Down
12 changes: 11 additions & 1 deletion app/src/processing/app/Platform.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ static public File getContentFile(String name) {
}

static public File getJavaHome() {
// Get the build in JDK location from the Jetpack Compose resources
// Get the built-in JDK location from the Jetpack Compose resources
var resourcesDir = System.getProperty("compose.application.resources.dir");
if(resourcesDir != null) {
var jdkFolder = new File(resourcesDir,"jdk");
Expand All @@ -381,6 +381,16 @@ static public File getJavaHome() {
}

// If the JDK is set in the environment, use that.
// if not, fall back to the java.home system property.
for (String envKey : new String[] { "JAVA_HOME", "JDK_HOME" }) {
String envPath = System.getenv(envKey);
if (envPath != null && !envPath.isEmpty()) {
File envHome = new File(envPath);
if (new File(envHome, "bin/java" + (Platform.isWindows() ? ".exe" : "")).canExecute()) {
return envHome;
}
}
}
var home = System.getProperty("java.home");
if(home != null){
return new File(home);
Expand Down
Loading

Back | FazBrowse Home | New Git URL