mirror of
https://github.com/processing/processing4.git
synced 2026-01-30 11:51:54 +01:00
better Xcode installation check
This commit is contained in:
@@ -1186,7 +1186,7 @@ public class JavaBuild {
|
||||
pw.close();
|
||||
|
||||
// attempt to code sign if the Xcode tools appear to be installed
|
||||
if (Platform.isMacOS() && new File("/usr/bin/codesign_allocate").exists()) {
|
||||
if (Platform.isMacOS() && isXcodeInstalled()) {
|
||||
if (embedJava) {
|
||||
ProcessHelper.ffs("codesign", "--force", "--sign", "-", jdkPath);
|
||||
}
|
||||
@@ -1334,6 +1334,21 @@ public class JavaBuild {
|
||||
}
|
||||
|
||||
|
||||
static Boolean xcodeInstalled;
|
||||
|
||||
static protected boolean isXcodeInstalled() {
|
||||
if (xcodeInstalled == null) {
|
||||
Process p = PApplet.launch("xcode-select", "-p");
|
||||
int result = -1;
|
||||
try {
|
||||
result = p.waitFor();
|
||||
} catch (InterruptedException e) { }
|
||||
xcodeInstalled = (result == 0);
|
||||
}
|
||||
return xcodeInstalled;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Run the launch4j build.xml file through ant to create the exe.
|
||||
* Most of this code was lifted from Android mode.
|
||||
|
||||
Reference in New Issue
Block a user