Skip to content

Commit

Permalink
Print error and exit if ANDROID_SDK or ANDROID_NDK_ROOT is undefined …
Browse files Browse the repository at this point in the history
…for Android builds
  • Loading branch information
jgranick committed Mar 6, 2017
1 parent 8e92767 commit f5fb0de
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lime/tools/platforms/AndroidPlatform.hx
Expand Up @@ -315,6 +315,13 @@ class AndroidPlatform extends PlatformTarget {
context.ANDROID_GRADLE_PLUGIN = project.config.getString ("android.gradle-plugin", "2.1.0");
context.ANDROID_LIBRARY_PROJECTS = [];

if (!project.environment.exists ("ANDROID_SDK") || !project.environment.exists ("ANDROID_NDK_ROOT")) {

LogHelper.error ("You must define ANDROID_SDK and ANDROID_NDK_ROOT to target Android, please run '" + CommandLineTools.commandName + " setup android' first");
Sys.exit (1);

}

var escaped = ~/([ #!=\\:])/g;
context.ANDROID_SDK_ESCAPED = escaped.replace(context.ENV_ANDROID_SDK, "\\$1");
context.ANDROID_NDK_ROOT_ESCAPED = escaped.replace(context.ENV_ANDROID_NDK_ROOT, "\\$1");
Expand Down

0 comments on commit f5fb0de

Please sign in to comment.