1- // UPDATED: Updated for Android Gradle Plugin 9.x
2- // Removes deprecated APIs
3-
41import java.nio.file.Paths
52
63// General gradle arguments for root project
74buildscript {
85 repositories {
96 google()
10- mavenCentral() // UPDATED: jcenter() is deprecated and shut-down
7+ mavenCentral()
118 }
129 dependencies {
13- /*
14- https://developer.android.com/studio/releases/gradle-plugin#updating-gradle
15- //
16- UPDATED to Android Gradle Plugin 9.0.0
17-
18- According to URL above you will need Gradle 6.1 or higher
19- */
2010 classpath " com.android.tools.build:gradle:9.0.0"
2111 }
2212}
2313repositories {
2414 google()
25- mavenCentral() // UPDATED: jcenter replacement
15+ mavenCentral()
2616}
2717
2818// Project's root where CMakeLists.txt exists: rootDir/support/.cxx -> rootDir
@@ -34,31 +24,25 @@ println("rootDir: ${rootDir}")
3424
3525apply plugin : " com.android.library"
3626android {
37-
38- // UPDATED: Namespace is now required in build.gralde for AGP 8+ (it was moved from manifest)
39-
4027 namespace = " dev.fmt"
4128
42- compileSdk 36 // UPDATED: Target Android 16 (API 36). 'compileSdkVersion' is deprecated
29+ compileSdk 36 // Target Android 16 (API 36).
4330
4431 /* Target ABI
4532 - This option controls target platform of module
4633 - The platform might be limited by compiler's support
4734 some can work with Clang(default), but some can work only with GCC...
4835 if bad, both toolchains might not support it
49- -* UPDATED: 'splits' block is deprecated for libraries. We now use 'ndk.abifilters' in defaultConfig
50- -> splits { abi { ...... } } -> removed
5136 */
5237
53- ndkVersion = " 28.2.13676358" // UPDATED: Locked to stable NDK 28 (AGP 9 defualt). Be explicit.
38+ ndkVersion = " 28.2.13676358"
5439
5540 defaultConfig {
56- minSdk 21 // Android 5.0+ (UPDATED: syntax)
57- targetSdkVersion 36 // Follow Compile SDK (UPDATED: syntax)
41+ minSdk 21 // Android 5.0+
42+ targetSdkVersion 36 // Follow Compile SDK
5843 versionCode 34 // Follow release count
5944 versionName " 7.1.2" // Follow Official version
6045
61- // UPDATED: Correct way to filter ABIs for a library in modern AGP
6246 ndk{
6347 abiFilters " arm64-v8a" , " armeabi-v7a" , " x86_64"
6448 }
@@ -68,7 +52,7 @@ android {
6852 arguments " -DANDROID_STL=c++_shared" // Specify Android STL
6953 arguments " -DBUILD_SHARED_LIBS=true" // Build shared object
7054 arguments " -DFMT_TEST=false" // Skip test
71- arguments " -DFMT_DOC=false" // Skip document
55+ arguments " -DFMT_DOC=false" // Skip documentation
7256 cppFlags " -std=c++17"
7357 targets " fmt"
7458 }
@@ -83,7 +67,7 @@ android {
8367 // neighbor of the top level cmake
8468 externalNativeBuild {
8569 cmake {
86- version = " 3.22.1" // UPDATED: 3.10 is too old for AGP 9
70+ version = " 3.22.1"
8771 path " ${ rootDir} /CMakeLists.txt"
8872 // buildStagingDirectory "./build" // Custom path for cmake output
8973 }
@@ -113,10 +97,6 @@ assemble.doLast
11397 /*
11498 *- Instead of `ninja install`, Gradle will deploy the files.
11599 *- We are doing this since FMT is dependent to the ANDROID_STL after build
116-
117- UPDATED: Path Adjustments
118- -> AGP 9+ often puts intermediates in build/intermediates/cxx/ or similar
119- -> Note: This manual copy is Fragile. If empty, check 'build/intermediates/cxx'.
120100 */
121101 copy {
122102 from " build/intermediates/cmake"
0 commit comments