Skip to content

Commit

Permalink
Merge branch 'tim/targetSdkFiasco' into 'master'
Browse files Browse the repository at this point in the history
maint: Upgrade Gradle and fix targetSdk deprecation fiasco

See merge request TankerHQ/sdk-android!285
  • Loading branch information
tux3 committed Dec 6, 2023
2 parents dc400ed + 672b587 commit 7731818
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
androidGradlePlugin = "8.1.2"
androidGradlePlugin = "8.2.0"
kotlinAndroid = "1.9.10"
dokka = "1.8.10"
wupAndroidMavenPublish = "3.6.2"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue May 23 15:51:18 CEST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
29 changes: 16 additions & 13 deletions tanker-bindings/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,17 @@ apply(from = "native.gradle")
group = "io.tanker"
version = "dev"

val minSdkVersion = 21
val targetSdkVersion = 34

android {
namespace = "io.tanker.tanker_bindings"

ndkVersion = "26.0.10792818"

compileSdk = 34
compileSdk = targetSdkVersion
defaultConfig {
minSdk = 21

// Apps that depend on a library ignore the library's targetSdk entirely (as they should).
// But we *do* need the field for androidTests, which install a real test app on a device.
// Google has now deprecated targetSdk for libraries entirely, with no replacement.
// https://issuetracker.google.com/issues/230625468 tracks the rollout of this mistake.
@SuppressLint("ExpiredTargetSdkVersion")
targetSdk = 34
minSdk = minSdkVersion

ndk {
moduleName = "tanker-bindings-jni"
Expand All @@ -51,6 +47,17 @@ android {
jvmTarget = "17"
}

lint {
targetSdk = targetSdkVersion
}

testOptions {
targetSdk = targetSdkVersion
unitTests {
isIncludeAndroidResources = true
}
}

publishing {
singleVariant("release")
}
Expand Down Expand Up @@ -85,10 +92,6 @@ android {
}
}

testOptions.unitTests {
isIncludeAndroidResources = true
}

sourceSets.getByName("main") {
java.srcDir("src/main/kotlin")
java.exclude("src/main/kotlin/io/tanker/admin/**")
Expand Down

0 comments on commit 7731818

Please sign in to comment.