From fa7f487595dfdf5a7327f43655c17dc0211ba60a Mon Sep 17 00:00:00 2001 From: Joseph Cloutier Date: Tue, 9 Nov 2021 20:08:01 -0500 Subject: [PATCH] Replace `ndk.dir` with `ndkPath`. https://developer.android.com/studio/projects/configure-agp-ndk#agp_version_41 The documentation tells you to be careful about this, since you're putting local-only information into a file that gets uploaded to version control, but Lime doesn't really need to worry about that. Granted, Lime DID use local.properties, but that's no longer practical. --- templates/android/template/app/build.gradle | 1 + templates/android/template/build.gradle | 1 + templates/android/template/local.properties | 2 ++ 3 files changed, 4 insertions(+) diff --git a/templates/android/template/app/build.gradle b/templates/android/template/app/build.gradle index c01e8356f..704bbca33 100644 --- a/templates/android/template/app/build.gradle +++ b/templates/android/template/app/build.gradle @@ -10,6 +10,7 @@ System.setProperty('java.awt.headless','false') android { compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION) buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION + ::if (ANDROID_GRADLE_PLUGIN>="4.0")::ndkPath '::ANDROID_NDK_ROOT_ESCAPED::'::end:: defaultConfig { applicationId "::META_PACKAGE_NAME::" diff --git a/templates/android/template/build.gradle b/templates/android/template/build.gradle index 81fe8a266..09a91e1e2 100644 --- a/templates/android/template/build.gradle +++ b/templates/android/template/build.gradle @@ -46,6 +46,7 @@ configure(subprojects.findAll {!it.file('build.gradle').exists() && it.file('bui android { compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION) buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION + ::if (ANDROID_GRADLE_PLUGIN>="4.0")::ndkPath '::ANDROID_NDK_ROOT_ESCAPED::'::end:: sourceSets { main { diff --git a/templates/android/template/local.properties b/templates/android/template/local.properties index 09b9bb3db..0a1bbe0cf 100644 --- a/templates/android/template/local.properties +++ b/templates/android/template/local.properties @@ -4,4 +4,6 @@ # Location of the SDK. This is only used by Gradle. # sdk.dir=::ANDROID_SDK_ESCAPED:: +::if (ANDROID_GRADLE_PLUGIN<"4.0"):: ndk.dir=::ANDROID_NDK_ROOT_ESCAPED:: +::end::