Skip to content

Commit 8889bd5

Browse files
shannahSteve Hannah
and
Steve Hannah
authored
Feature/ios local build improvements (#3783)
* fix: use abs path to javac to ensure correct version * feat: bump minimum deployment target to 12.0 for ios local builds --------- Co-authored-by: Steve Hannah <[email protected]>
1 parent d970870 commit 8889bd5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

maven/codenameone-maven-plugin/src/main/java/com/codename1/builders/IPhoneBuilder.java

+10-2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public class IPhoneBuilder extends Executor {
5959
private File tmpFile;
6060
private File icon57;
6161
private File icon512;
62+
private static final String DEFAULT_MIN_DEPLOYMENT_VERSION = "12.0";
6263

6364
// StringBuilder used for constructing ruby script with xcodeproj
6465
// which adds localized strings files to the project.
@@ -209,6 +210,7 @@ private int getDeploymentTargetInt(BuildRequest request) {
209210

210211
@Override
211212
public boolean build(File sourceZip, BuildRequest request) throws BuildException {
213+
addMinDeploymentTarget(DEFAULT_MIN_DEPLOYMENT_VERSION);
212214
defaultEnvironment.put("LANG", "en_US.UTF-8");
213215
tmpFile = tmpDir = getBuildDirectory();
214216
useMetal = "true".equals(request.getArg("ios.metal", "false"));
@@ -1154,9 +1156,15 @@ public void usesClassMethod(String cls, String method) {
11541156
}
11551157
}
11561158
}
1157-
1159+
String javacPath = System.getProperty("java.home") + "/../bin/javac";
1160+
if (!new File(javacPath).exists()) {
1161+
javacPath = System.getProperty("java.home") + "/bin/javac";
1162+
}
1163+
if (!new File(javacPath).exists()) {
1164+
javacPath = "javac";
1165+
}
11581166
try {
1159-
if (!execWithFiles(stubSource, stubSource, ".java", "javac", "-source", "1.6", "-target", "1.6", "-classpath",
1167+
if (!execWithFiles(stubSource, stubSource, ".java", javacPath, "-source", "1.6", "-target", "1.6", "-classpath",
11601168
classesDir.getAbsolutePath(),
11611169
"-d", classesDir.getAbsolutePath())) {
11621170
return false;

0 commit comments

Comments
 (0)