Skip to content

Commit 5212c29

Browse files
feat: Update Android Gradle plugin to 8.1.0
1 parent 07fdaf7 commit 5212c29

File tree

10 files changed

+58
-26
lines changed

10 files changed

+58
-26
lines changed

.scripts/maven.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ publishing {
4848
}
4949

5050
task stubJavadoc(type: Jar) {
51-
classifier = 'javadoc'
51+
archiveClassifier = 'javadoc'
5252
}
5353
}
5454
repositories {

Tests/build.gradle.kts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ plugins {
1010
}
1111

1212
kotlin {
13-
android {
13+
androidTarget {
1414
publishLibraryVariants("release")
1515
}
1616
val xcFramework = XCFramework()
@@ -67,13 +67,14 @@ kotlin {
6767
}
6868

6969
android {
70-
compileSdk = 31
70+
namespace = "com.mparticle.tests"
71+
compileSdk = 33
7172
sourceSets["main"].manifest.srcFile("helpers/AndroidManifest.xml")
7273
sourceSets["androidTest"].java.srcDirs("CommonTests")
7374

7475
defaultConfig {
7576
minSdk= 14
76-
targetSdk = 31
77+
targetSdk = 33
7778
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
7879
}
7980
compileOptions {
@@ -82,6 +83,12 @@ android {
8283
}
8384
}
8485

86+
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
87+
kotlinOptions {
88+
jvmTarget = "1.8"
89+
}
90+
}
91+
8592
val installTestPods by tasks.creating(Exec::class.java) {
8693
workingDir = project.file("helpers/XCodeTest")
8794
setCommandLine("pod")

api/build.gradle.kts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ plugins {
1212
apply(from = "../.scripts/maven.gradle")
1313

1414
kotlin {
15-
android {
15+
androidTarget {
1616
publishLibraryVariants("release")
1717
mavenPublication {
1818
artifactId = project.name
@@ -58,7 +58,7 @@ kotlin {
5858
}
5959

6060
android {
61-
namespace = "testing"
61+
namespace = "com.mparticle.api"
6262
compileSdk = 33
6363
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
6464

@@ -72,6 +72,13 @@ android {
7272
targetCompatibility = JavaVersion.VERSION_1_8
7373
}
7474
}
75+
76+
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
77+
kotlinOptions {
78+
jvmTarget = "1.8"
79+
}
80+
}
81+
7582
dependencies {
7683
// implementation("androidx.lifecycle:lifecycle-common:2.2.0")
7784
}

build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import org.gradle.internal.impldep.org.apache.commons.io.FileUtils.copyDirectory
2+
import org.gradle.api.publish.maven.plugins.MavenPublishPlugin
23

34
allprojects {
45
repositories {
@@ -30,13 +31,12 @@ subprojects {
3031
val appleSDKTempDirPath = "${project.rootDir.absolutePath}/.sdks/apple-testing"
3132

3233
if (File(appleSDKTempDirPath).exists()) {
33-
project.exec {
34-
commandLine = "rm -rf $appleSDKTempDirPath".split(" ")
35-
}
34+
File(appleSDKTempDirPath).deleteRecursively()
3635
}
3736

3837
project.exec {
39-
commandLine = "cp -r ${project.rootDir.absolutePath}/.sdks/apple $appleSDKTempDirPath".split(" ")
38+
commandLine = listOf("cp", "-r", "${project.rootDir.absolutePath}/.sdks/apple", appleSDKTempDirPath)
39+
isIgnoreExitValue = false
4040
}
4141

4242
val addTestingHeadersToAppleSDK by tasks.creating {

gradle.properties

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
kotlin.code.style=official
2-
kotlin.mpp.enableGranularSourceSetsMetadata=true
3-
kotlin.native.enableDependencyPropagation=false
4-
kotlin.mpp.enableCompatibilityMetadataVariant=true
52
kotlin.mpp.enableCInteropCommonization=true
63
android.useAndroidX=true
74
org.gradle.jvmargs=-Xmx5120m
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

mocking/build.gradle.kts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ plugins {
1111
apply(from = "../.scripts/maven.gradle")
1212

1313
kotlin {
14-
android {
14+
androidTarget {
1515
publishLibraryVariants("release")
1616
mavenPublication {
1717
artifactId = "mocking"
@@ -64,18 +64,26 @@ kotlin {
6464
}
6565

6666
android {
67-
compileSdk = 31
67+
namespace = "com.mparticle.mocking"
68+
compileSdk = 33
6869
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
6970
defaultConfig {
7071
minSdk = 14
71-
targetSdk = 31
72+
targetSdk = 33
7273
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
7374
}
7475
compileOptions {
7576
sourceCompatibility = JavaVersion.VERSION_1_8
7677
targetCompatibility = JavaVersion.VERSION_1_8
7778
}
7879
}
80+
81+
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
82+
kotlinOptions {
83+
jvmTarget = "1.8"
84+
}
85+
}
86+
7987
dependencies {
8088
implementation("androidx.lifecycle:lifecycle-common:2.5.0")
8189
}

models/build.gradle.kts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repositories {
1818
val xcFramework = XCFramework()
1919

2020
kotlin {
21-
android {
21+
androidTarget {
2222
publishLibraryVariants("release")
2323
mavenPublication {
2424
artifactId = project.name
@@ -65,3 +65,9 @@ android {
6565
targetCompatibility = JavaVersion.VERSION_1_8
6666
}
6767
}
68+
69+
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
70+
kotlinOptions {
71+
jvmTarget = "1.8"
72+
}
73+
}

settings.gradle.kts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ rootProject.name = "sdk-multiplatform-test"
22
include("api", "mocking", "models", "testing", "Tests")//, "braze-kit")
33
includeBuild(".sdks/android") {
44
dependencySubstitution {
5-
substitute(module("group:android-core")).with(project(":android-core"))
6-
substitute(module("com.mparticle:android-core:+")).with(project(":android-core"))
5+
substitute(module("group:android-core")).using(project(":android-core"))
6+
substitute(module("com.mparticle:android-core:+")).using(project(":android-core"))
77
}
88
}
99
pluginManagement {
@@ -13,15 +13,15 @@ pluginManagement {
1313
mavenCentral()
1414
}
1515
plugins {
16-
id("com.android.library") version("7.3.1")
17-
kotlin("multiplatform") version ("1.9.0")
18-
kotlin("plugin.serialization") version ("1.6.21")
19-
kotlin("native.cocoapods") version ("1.6.21")
16+
id("com.android.library") version("8.1.0")
17+
kotlin("multiplatform") version ("1.9.20")
18+
kotlin("plugin.serialization") version ("1.9.20")
19+
kotlin("native.cocoapods") version ("1.9.20")
2020
}
2121
resolutionStrategy {
2222
eachPlugin {
2323
if (requested.id.namespace == "com.android" || requested.id.name == "kotlin-android-extensions") {
24-
useModule("com.android.tools.build:gradle:7.3.1")
24+
useModule("com.android.tools.build:gradle:8.1.0")
2525
}
2626
}
2727
}

testing/build.gradle.kts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ plugins {
1010
apply(from = "../.scripts/maven.gradle")
1111

1212
kotlin {
13-
android {
13+
androidTarget {
1414
publishLibraryVariants("release")
1515
mavenPublication {
1616
artifactId = "testing"
@@ -78,6 +78,13 @@ android {
7878
targetCompatibility = JavaVersion.VERSION_1_8
7979
}
8080
}
81+
82+
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
83+
kotlinOptions {
84+
jvmTarget = "1.8"
85+
}
86+
}
87+
8188
dependencies {
8289
implementation("androidx.lifecycle:lifecycle-common:2.5.0")
8390
}

0 commit comments

Comments
 (0)