]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
android: Update Gradle plugin and build scripts and dependencies
authorTobias Brunner <tobias@strongswan.org>
Tue, 12 Dec 2023 16:19:18 +0000 (17:19 +0100)
committerTobias Brunner <tobias@strongswan.org>
Tue, 16 Jan 2024 10:00:29 +0000 (11:00 +0100)
This also references the NDK via ndkVersion and replaces the custom
ndk-build tasks.  It also replaces the deprecated compileSdkVersion and
increases it because dependencies of updated dependencies require that.

targetSdkVersion is not yet updated because there might be some work
required for Android 14 compatibility.

src/frontends/android/app/build.gradle
src/frontends/android/build.gradle
src/frontends/android/gradle.properties
src/frontends/android/gradle/wrapper/gradle-wrapper.properties

index 33569f1c3ee8bdd77026dff150611e9a896c4ca5..35ecdcbb9d0390a8177aef9be159d0dfcfa84a47 100644 (file)
@@ -1,39 +1,36 @@
 apply plugin: 'com.android.application'
 
 android {
-    compileSdkVersion 33
-
     namespace 'org.strongswan.android'
 
     defaultConfig {
         applicationId "org.strongswan.android"
+        compileSdk 34
         minSdkVersion 21
         targetSdkVersion 33
         versionCode 80
         versionName "2.4.2"
-    }
 
-    sourceSets.main {
-        jniLibs.srcDir 'src/main/libs'
+        externalNativeBuild {
+            ndkBuild {
+                arguments '-j' + Runtime.runtime.availableProcessors()
+            }
+        }
     }
 
-    task buildNative(type: Exec) {
-        workingDir 'src/main/jni'
-        commandLine "${android.ndkDirectory}/ndk-build", '-j', Runtime.runtime.availableProcessors()
-    }
+    ndkVersion "26.1.10909125"
 
-    task cleanNative(type: Exec) {
-        workingDir 'src/main/jni'
-        commandLine "${android.ndkDirectory}/ndk-build", 'clean'
+    externalNativeBuild {
+        ndkBuild {
+            path 'src/main/jni/Android.mk'
+        }
     }
 
-    tasks.withType(JavaCompile) {
-        compileTask -> compileTask.dependsOn buildNative
-        options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
+    tasks.withType(JavaCompile).configureEach {
+        compileTask ->
+            options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
     }
 
-    clean.dependsOn 'cleanNative'
-
     buildTypes {
         release {
             minifyEnabled false
@@ -47,10 +44,10 @@ android {
 }
 
 dependencies {
-    implementation 'androidx.appcompat:appcompat:1.4.2'
-    implementation 'androidx.preference:preference:1.2.0'
+    implementation 'androidx.appcompat:appcompat:1.6.1'
+    implementation 'androidx.preference:preference:1.2.1'
     implementation 'androidx.legacy:legacy-support-v4:1.0.0'
-    implementation 'com.google.android.material:material:1.6.1'
+    implementation 'com.google.android.material:material:1.10.0'
     testImplementation 'junit:junit:4.13.2'
     testImplementation 'org.mockito:mockito-core:3.11.2'
     testImplementation 'org.powermock:powermock-core:2.0.9'
index dc4fab06bb9ed90ecb5c2c13339a390c1bff941c..2b505ba48c31cde84de53f36eb9f71bea5b1e49b 100644 (file)
@@ -4,7 +4,7 @@ buildscript {
         google()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:7.3.0'
+        classpath 'com.android.tools.build:gradle:8.2.0'
     }
 }
 
index 5465fec0ecadbf086fce0db92293c8f1d5f720ff..f8b6780adf563dbcb57796acc901c88a62324c44 100644 (file)
@@ -1,2 +1,4 @@
-android.enableJetifier=true
-android.useAndroidX=true
\ No newline at end of file
+android.enableJetifier=false
+android.nonFinalResIds=false
+android.nonTransitiveRClass=false
+android.useAndroidX=true
index 5cabee55dc34f792c30c373206f5e7342ec454fd..d219d263caa6685374668f0733878d32b160721e 100644 (file)
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip