[GH] Move ndkVersion setting into a shared .gradle file
Playground builds were overriding the installed ndk version due to agp default and lack of ndkVersion declaration in settings.gradle.
Test: ./gradlew datastore:datastore-core:tasks
Change-Id: Id6d8d9cff46ba3aa3e929e4a7df4912672a12f3a
This is an imported pull request from https://github.com/androidx/androidx/pull/693.
Resolves #693
Github-Pr-Head-Sha: 39d14d48951d2df7e9d158e601bd9230921953a5
GitOrigin-RevId: 2d2f60d3a059f28f96ba873b6d34150af33022c8
Change-Id: Ie9fc432b8b5d47309fe406829b6093323782df20
diff --git a/.github/actions/build-single-project/action.yml b/.github/actions/build-single-project/action.yml
index ecedb70..a9f207f 100644
--- a/.github/actions/build-single-project/action.yml
+++ b/.github/actions/build-single-project/action.yml
@@ -36,7 +36,7 @@
shell: bash
run: |
set -x
- NDK_VERSION=$(grep "ndkVersion" settings.gradle | awk -F "=" '{gsub(/"| /, ""); print $2}')
+ NDK_VERSION=$(grep "ndkVersion" buildSrc/ndk.gradle | awk -F "=" '{gsub(/"| /, ""); print $2}')
echo "yes" | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --install "ndk;$NDK_VERSION"
- name: "Install Android SDK Build-Tools"
shell: bash
diff --git a/buildSrc/ndk.gradle b/buildSrc/ndk.gradle
new file mode 100644
index 0000000..ee863e5
--- /dev/null
+++ b/buildSrc/ndk.gradle
@@ -0,0 +1,3 @@
+android {
+ ndkVersion = "27.0.12077973"
+}
diff --git a/playground-projects/activity-playground/settings.gradle b/playground-projects/activity-playground/settings.gradle
index 4019de7..26fdaa6 100644
--- a/playground-projects/activity-playground/settings.gradle
+++ b/playground-projects/activity-playground/settings.gradle
@@ -20,8 +20,11 @@
}
plugins {
id "playground"
+ id "com.android.settings" version "8.7.0-alpha02"
}
+apply ../../buildSrc/ndk.gradle
+
rootProject.name = "activity-playground"
playground {
diff --git a/playground-projects/appcompat-playground/settings.gradle b/playground-projects/appcompat-playground/settings.gradle
index ef7867c..849c38b 100644
--- a/playground-projects/appcompat-playground/settings.gradle
+++ b/playground-projects/appcompat-playground/settings.gradle
@@ -4,8 +4,11 @@
}
plugins {
id "playground"
+ id "com.android.settings" version "8.7.0-alpha02"
}
+apply ../../buildSrc/ndk.gradle
+
rootProject.name = "appcompat-playground"
playground {
diff --git a/playground-projects/biometric-playground/settings.gradle b/playground-projects/biometric-playground/settings.gradle
index 1259d4b..61833b6 100644
--- a/playground-projects/biometric-playground/settings.gradle
+++ b/playground-projects/biometric-playground/settings.gradle
@@ -20,8 +20,11 @@
}
plugins {
id "playground"
+ id "com.android.settings" version "8.7.0-alpha02"
}
+apply ../../buildSrc/ndk.gradle
+
rootProject.name = "biometric-playground"
playground {
diff --git a/playground-projects/collection-playground/settings.gradle b/playground-projects/collection-playground/settings.gradle
index 7436415..33fc766 100644
--- a/playground-projects/collection-playground/settings.gradle
+++ b/playground-projects/collection-playground/settings.gradle
@@ -20,8 +20,11 @@
}
plugins {
id "playground"
+ id "com.android.settings" version "8.7.0-alpha02"
}
+apply ../../buildSrc/ndk.gradle
+
rootProject.name = "collections-playground"
playground {
diff --git a/playground-projects/compose/runtime-playground/settings.gradle b/playground-projects/compose/runtime-playground/settings.gradle
index f6e803c..805f643 100644
--- a/playground-projects/compose/runtime-playground/settings.gradle
+++ b/playground-projects/compose/runtime-playground/settings.gradle
@@ -20,8 +20,11 @@
}
plugins {
id "playground"
+ id "com.android.settings" version "8.7.0-alpha02"
}
+apply ../../buildSrc/ndk.gradle
+
rootProject.name = "compose-runtime"
playground {
diff --git a/playground-projects/core-playground/settings.gradle b/playground-projects/core-playground/settings.gradle
index b395f59..fb46ab0 100644
--- a/playground-projects/core-playground/settings.gradle
+++ b/playground-projects/core-playground/settings.gradle
@@ -4,8 +4,11 @@
}
plugins {
id "playground"
+ id "com.android.settings" version "8.7.0-alpha02"
}
+apply from: "../../buildSrc/ndk.gradle"
+
rootProject.name = "core-playground"
playground {
diff --git a/playground-projects/datastore-playground/settings.gradle b/playground-projects/datastore-playground/settings.gradle
index d5b04bd..bbd0dd8 100644
--- a/playground-projects/datastore-playground/settings.gradle
+++ b/playground-projects/datastore-playground/settings.gradle
@@ -20,8 +20,11 @@
}
plugins {
id "playground"
+ id "com.android.settings" version "8.7.0-alpha02"
}
+apply from: "../../buildSrc/ndk.gradle"
+
rootProject.name = "datastore-playground"
playground {
diff --git a/playground-projects/fragment-playground/settings.gradle b/playground-projects/fragment-playground/settings.gradle
index bf5e622..e1587c0d 100644
--- a/playground-projects/fragment-playground/settings.gradle
+++ b/playground-projects/fragment-playground/settings.gradle
@@ -20,8 +20,11 @@
}
plugins {
id "playground"
+ id "com.android.settings" version "8.7.0-alpha02"
}
+apply from: "../../buildSrc/ndk.gradle"
+
rootProject.name = "fragment-playground"
playground {
diff --git a/playground-projects/ktfmt-playground/settings.gradle b/playground-projects/ktfmt-playground/settings.gradle
index 14b3633..95bc38c 100644
--- a/playground-projects/ktfmt-playground/settings.gradle
+++ b/playground-projects/ktfmt-playground/settings.gradle
@@ -20,8 +20,11 @@
}
plugins {
id "playground"
+ id "com.android.settings" version "8.7.0-alpha02"
}
+apply from: "../../buildSrc/ndk.gradle"
+
playground {
setupPlayground("../..")
selectProjectsFromAndroidX({ name ->
diff --git a/playground-projects/lifecycle-playground/settings.gradle b/playground-projects/lifecycle-playground/settings.gradle
index c8f4d97..18e73f7 100644
--- a/playground-projects/lifecycle-playground/settings.gradle
+++ b/playground-projects/lifecycle-playground/settings.gradle
@@ -20,8 +20,11 @@
}
plugins {
id "playground"
+ id "com.android.settings" version "8.7.0-alpha02"
}
+apply from: "../../buildSrc/ndk.gradle"
+
rootProject.name = "lifecycle-playground"
playground {
diff --git a/playground-projects/navigation-playground/settings.gradle b/playground-projects/navigation-playground/settings.gradle
index 8d9c51f..02dd8fe 100644
--- a/playground-projects/navigation-playground/settings.gradle
+++ b/playground-projects/navigation-playground/settings.gradle
@@ -20,8 +20,11 @@
}
plugins {
id "playground"
+ id "com.android.settings" version "8.7.0-alpha02"
}
+apply from: "../../buildSrc/ndk.gradle"
+
rootProject.name = "navigation-playground"
playground {
diff --git a/playground-projects/paging-playground/settings.gradle b/playground-projects/paging-playground/settings.gradle
index 13c078f..6a7f6ca 100644
--- a/playground-projects/paging-playground/settings.gradle
+++ b/playground-projects/paging-playground/settings.gradle
@@ -20,8 +20,11 @@
}
plugins {
id "playground"
+ id "com.android.settings" version "8.7.0-alpha02"
}
+apply from: "../../buildSrc/ndk.gradle"
+
rootProject.name = "paging-playground"
playground {
diff --git a/playground-projects/room-playground/settings.gradle b/playground-projects/room-playground/settings.gradle
index 406a91d..f40faf3 100644
--- a/playground-projects/room-playground/settings.gradle
+++ b/playground-projects/room-playground/settings.gradle
@@ -20,8 +20,11 @@
}
plugins {
id "playground"
+ id "com.android.settings" version "8.7.0-alpha02"
}
+apply from: "../../buildSrc/ndk.gradle"
+
rootProject.name = "room-playground"
playground {
diff --git a/playground-projects/sqlite-playground/settings.gradle b/playground-projects/sqlite-playground/settings.gradle
index 2ecf4ae..c132192 100644
--- a/playground-projects/sqlite-playground/settings.gradle
+++ b/playground-projects/sqlite-playground/settings.gradle
@@ -20,8 +20,11 @@
}
plugins {
id "playground"
+ id "com.android.settings" version "8.7.0-alpha02"
}
+apply from: "../../buildSrc/ndk.gradle"
+
rootProject.name = "sqlite-playground"
playground {
diff --git a/playground-projects/work-playground/settings.gradle b/playground-projects/work-playground/settings.gradle
index ae0868e..3ccf68d 100644
--- a/playground-projects/work-playground/settings.gradle
+++ b/playground-projects/work-playground/settings.gradle
@@ -20,8 +20,11 @@
}
plugins {
id "playground"
+ id "com.android.settings" version "8.7.0-alpha02"
}
+apply from: "../../buildSrc/ndk.gradle"
+
rootProject.name = "work-playground"
playground {
diff --git a/settings.gradle b/settings.gradle
index 210612c..a898312 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -88,9 +88,7 @@
apply(plugin: "androidx.build.gradle.gcpbuildcache")
apply(plugin: "com.android.settings")
-android {
- ndkVersion = "27.0.12077973"
-}
+apply(from: "buildSrc/ndk.gradle")
def BUILD_NUMBER = System.getenv("BUILD_NUMBER")
develocity {