From 19af96b9d5ca1c3c2b56e9e061d5767d2ccc46e9 Mon Sep 17 00:00:00 2001 From: Mansi Pandya Date: Mon, 24 Nov 2025 11:10:11 -0500 Subject: [PATCH 1/2] feat: Update Android Gradle plugin to 8.0.2 --- gradle/wrapper/gradle-wrapper.properties | 2 +- simple-kit/build.gradle | 29 +++++++++++++++++++++--- simple-kit/src/main/AndroidManifest.xml | 2 +- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ae04661..e1bef7e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/simple-kit/build.gradle b/simple-kit/build.gradle index 4ad702e..1cf507d 100644 --- a/simple-kit/build.gradle +++ b/simple-kit/build.gradle @@ -1,22 +1,25 @@ - buildscript { + ext.kotlin_version = '2.0.20' if (!project.hasProperty('version') || project.version.equals('unspecified')) { project.version = '+' } + repositories { google() mavenLocal() mavenCentral() } + dependencies { - classpath 'com.android.tools.build:gradle:7.4.1' + classpath 'com.android.tools.build:gradle:8.1.4' classpath 'com.mparticle:android-kit-plugin:' + project.version + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } plugins { id "org.sonarqube" version "3.5.0.2730" - id "org.jlleitschuh.gradle.ktlint" version "11.2.0" + id "org.jlleitschuh.gradle.ktlint" version "13.0.0" } sonarqube { @@ -28,8 +31,28 @@ sonarqube { } apply plugin: 'org.jlleitschuh.gradle.ktlint' +apply plugin: 'kotlin-android' apply plugin: 'com.mparticle.kit' +android { + namespace 'com.mparticle.kits.example' + defaultConfig { + minSdkVersion 21 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + kotlinOptions { + jvmTarget = '17' + } + testOptions { + unitTests.all { + jvmArgs += ['--add-opens', 'java.base/java.lang=ALL-UNNAMED'] + } + } +} + dependencies { //TODO: Option 1: Replace with your Maven Central Dependency (preferred) //compile 'com.example:example-artifact:1.2.3' diff --git a/simple-kit/src/main/AndroidManifest.xml b/simple-kit/src/main/AndroidManifest.xml index 28b3b74..541c199 100644 --- a/simple-kit/src/main/AndroidManifest.xml +++ b/simple-kit/src/main/AndroidManifest.xml @@ -1,2 +1,2 @@ - + From 4e15eeabbc7bf87897ec2ed9ffd5260ddefe3e1f Mon Sep 17 00:00:00 2001 From: Mansi Pandya Date: Tue, 20 Jan 2026 14:29:47 -0500 Subject: [PATCH 2/2] Fix lint error --- .../batching-kit/build.gradle | 3 +++ simple-kit/build.gradle | 3 +++ .../kotlin/com/mparticle/kits/ExampleKit.kt | 25 +++++++++---------- .../kotlin/com/mparticle/kits/KitTests.kt | 2 +- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/runtime-batching-kit/batching-kit/build.gradle b/runtime-batching-kit/batching-kit/build.gradle index 70bf699..8e82ec8 100644 --- a/runtime-batching-kit/batching-kit/build.gradle +++ b/runtime-batching-kit/batching-kit/build.gradle @@ -17,6 +17,9 @@ android { consumerProguardFiles "consumer-rules.pro" } + buildFeatures { + buildConfig = true + } buildTypes { release { minifyEnabled false diff --git a/simple-kit/build.gradle b/simple-kit/build.gradle index 1cf507d..141755b 100644 --- a/simple-kit/build.gradle +++ b/simple-kit/build.gradle @@ -39,6 +39,9 @@ android { defaultConfig { minSdkVersion 21 } + buildFeatures { + buildConfig = true + } compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 diff --git a/simple-kit/src/main/kotlin/com/mparticle/kits/ExampleKit.kt b/simple-kit/src/main/kotlin/com/mparticle/kits/ExampleKit.kt index f3dac1a..62c42f0 100644 --- a/simple-kit/src/main/kotlin/com/mparticle/kits/ExampleKit.kt +++ b/simple-kit/src/main/kotlin/com/mparticle/kits/ExampleKit.kt @@ -23,10 +23,9 @@ import android.content.Context * - ./consumer-proguard.pro */ class ExampleKit : KitIntegration() { - public override fun onKitCreate( settings: MutableMap?, - context: Context? + context: Context?, ): MutableList? { /** TODO: Initialize your SDK here * This method is analogous to Application#onCreate, and will be called once per app execution. @@ -40,20 +39,20 @@ class ExampleKit : KitIntegration() { } override fun getName(): String { - //TODO: Replace this with your company name + // TODO: Replace this with your company name return "Example" } - override fun setOptOut(optedOut: Boolean): MutableList? { - //TODO: Disable or enable your SDK when a user opts out. - //TODO: If your SDK can not be opted out of, return null - val optOutMessage = ReportingMessage( - this, - ReportingMessage.MessageType.OPT_OUT, - System.currentTimeMillis(), - null - ) + // TODO: Disable or enable your SDK when a user opts out. + // TODO: If your SDK can not be opted out of, return null + val optOutMessage = + ReportingMessage( + this, + ReportingMessage.MessageType.OPT_OUT, + System.currentTimeMillis(), + null, + ) return null } -} \ No newline at end of file +} diff --git a/simple-kit/src/test/kotlin/com/mparticle/kits/KitTests.kt b/simple-kit/src/test/kotlin/com/mparticle/kits/KitTests.kt index aa8e0ec..293fe88 100644 --- a/simple-kit/src/test/kotlin/com/mparticle/kits/KitTests.kt +++ b/simple-kit/src/test/kotlin/com/mparticle/kits/KitTests.kt @@ -25,7 +25,7 @@ class KitTests { var e: Exception? = null try { val kit = kit - val settings= HashMap() + val settings = HashMap() settings["fake setting"] = "fake" kit.onKitCreate(settings, Mockito.mock(Context::class.java)) } catch (ex: Exception) {