Skip to content

Commit

Permalink
🛠️ fix late initialization of android sdk dir
Browse files Browse the repository at this point in the history
  • Loading branch information
teras committed Sep 21, 2022
1 parent 246248e commit 04655b7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmmanager
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

package org.crossmobile.utils;

import org.crossmobile.prefs.Prefs;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
Expand All @@ -27,6 +29,10 @@ public void updateFromProperties(File file) {
if (file.isFile())
try {
props.load(new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8));
String sdkDir = Prefs.getAndroidSDKLocation();
String givenSdkDir = props.getProperty("sdk.dir", "");
if (!sdkDir.trim().isEmpty() && new File(sdkDir).isDirectory() && (givenSdkDir.trim().isEmpty() || !new File(givenSdkDir).isDirectory()))
props.put("sdk.dir", Prefs.getAndroidSDKLocation());
} catch (IOException ignored) {
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public enum ParamsCommon {
KEY_ALIAS("androiddebugkey", true, LOCAL),
KEY_STORE_PASSWORD("", true, LOCAL),
KEY_ALIAS_PASSWORD("", true, LOCAL),
SDK_DIR(Prefs.getAndroidSDKLocation(), true, LOCAL),
SDK_DIR("", true, LOCAL),

FILESHARINGENABLED("false"),
CM_OBJC_SAFEMEMBERS("true"),
Expand Down

0 comments on commit 04655b7

Please sign in to comment.