Skip to content

Commit

Permalink
Rearrange AndroidPlatform.update().
Browse files Browse the repository at this point in the history
These two bits of code stood out among all the one-line assignments, so I figured there was somewhere better for both. I put the `if` block next to the other two `if` blocks and moved `ANDROID_LIBRARY_PROJECTS` to where it was used.
  • Loading branch information
player-03 authored Dec 2, 2023
1 parent c1d568a commit 3887275
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tools/platforms/AndroidPlatform.hx
Original file line number Diff line number Diff line change
Expand Up @@ -450,12 +450,6 @@ class AndroidPlatform extends PlatformTarget
context.CPP_DIR = targetDirectory + "/obj";
context.OUTPUT_DIR = targetDirectory;
context.ANDROID_INSTALL_LOCATION = project.config.getString("android.install-location", "auto");

if (project.config.exists("android.appCategory"))
{
context.ANDROID_APP_CATEGORY = project.config.getString("android.appCategory");
}

context.ANDROID_MINIMUM_SDK_VERSION = project.config.getInt("android.minimum-sdk-version", 21);
context.ANDROID_TARGET_SDK_VERSION = project.config.getInt("android.target-sdk-version", 30);
context.ANDROID_EXTENSIONS = project.config.getArrayString("android.extension");
Expand All @@ -469,7 +463,6 @@ class AndroidPlatform extends PlatformTarget
context.ANDROID_GRADLE_PLUGIN = project.config.getString("android.gradle-plugin", "7.3.1");
context.ANDROID_USE_ANDROIDX = project.config.getString("android.useAndroidX", "true");
context.ANDROID_ENABLE_JETIFIER = project.config.getString("android.enableJetifier", "false");
context.ANDROID_LIBRARY_PROJECTS = [];

if (!project.environment.exists("ANDROID_SDK") || !project.environment.exists("ANDROID_NDK_ROOT"))
{
Expand All @@ -481,6 +474,11 @@ class AndroidPlatform extends PlatformTarget
Sys.exit(1);
}

if (project.config.exists("android.appCategory"))
{
context.ANDROID_APP_CATEGORY = project.config.getString("android.appCategory");
}

if (project.config.exists("android.gradle-build-directory"))
{
context.ANDROID_GRADLE_BUILD_DIRECTORY = project.config.getString("android.gradle-build-directory");
Expand All @@ -505,6 +503,7 @@ class AndroidPlatform extends PlatformTarget
"KEY_STORE_ALIAS_PASSWORD")) context.KEY_STORE_ALIAS_PASSWORD = StringTools.replace(context.KEY_STORE_ALIAS_PASSWORD, "\\", "\\\\");

var index = 1;
context.ANDROID_LIBRARY_PROJECTS = [];

for (dependency in project.dependencies)
{
Expand Down

0 comments on commit 3887275

Please sign in to comment.