diff --git a/.github/workflows/build-kits.yml b/.github/workflows/build-kits.yml new file mode 100644 index 000000000..7bcd88c5f --- /dev/null +++ b/.github/workflows/build-kits.yml @@ -0,0 +1,69 @@ +name: Build Kits + +on: + workflow_call: + workflow_dispatch: + +permissions: + contents: read + +jobs: + load-matrix: + name: Load kit matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set.outputs.matrix }} + steps: + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + with: + sparse-checkout: kits/matrix.json + sparse-checkout-cone-mode: false + - id: set + run: echo "matrix=$(jq -c . kits/matrix.json)" >> "$GITHUB_OUTPUT" + + build-kits: + name: Build ${{ matrix.kit.name }} + needs: load-matrix + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + kit: ${{ fromJson(needs.load-matrix.outputs.matrix) }} + steps: + - name: Checkout + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + + - name: Set SDK version + run: | + echo "ORG_GRADLE_PROJECT_VERSION=$(head -n 1 VERSION)" >> $GITHUB_ENV + echo "ORG_GRADLE_PROJECT_version=$(head -n 1 VERSION)" >> $GITHUB_ENV + + - name: Install JDK 17 + uses: actions/setup-java@ad2b38190b15e4d6bdf0c97fb4fca8412226d287 # v5 + with: + distribution: zulu + java-version: "17" + + - name: Publish core SDK to Maven Local + run: ./gradlew publishMavenPublicationToMavenLocal + + - name: Run kit unit tests + if: ${{ matrix.kit.skip_unit_tests != true }} + run: | + ./gradlew "${{ matrix.kit.kit_project }}:testRelease" \ + -c settings-kits.gradle \ + -Pmparticle.kit.mparticleFromMavenLocalOnly=true + + - name: Build Kotlin example + if: ${{ matrix.kit.skip_example_builds != true && matrix.kit.example_kotlin_project != '' }} + run: | + ./gradlew "${{ matrix.kit.example_kotlin_project }}:assembleDebug" \ + -c settings-kit-examples.gradle \ + -Pmparticle.kit.mparticleFromMavenLocalOnly=true + + - name: Build Java example + if: ${{ matrix.kit.skip_example_builds != true && matrix.kit.example_java_project != '' }} + run: | + ./gradlew "${{ matrix.kit.example_java_project }}:assembleDebug" \ + -c settings-kit-examples.gradle \ + -Pmparticle.kit.mparticleFromMavenLocalOnly=true diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 33308c7cf..0f86db33e 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -153,6 +153,9 @@ jobs: with: base_branch: main + build-kits: + uses: ./.github/workflows/build-kits.yml + kit-compatibility-test: name: "Kit Compatibility Test" runs-on: ubuntu-latest @@ -188,6 +191,7 @@ jobs: lint-checks, kotlin-lint-checks, kit-compatibility-test, + build-kits, ] uses: mParticle/mparticle-workflows/.github/workflows/dependabot-save-pr-number.yml@main diff --git a/kits/adjust/adjust-5/example/example-kotlin/build.gradle b/kits/adjust/adjust-5/example/example-kotlin/build.gradle new file mode 100644 index 000000000..1935716d1 --- /dev/null +++ b/kits/adjust/adjust-5/example/example-kotlin/build.gradle @@ -0,0 +1,38 @@ +plugins { + id 'com.android.application' + id 'org.jetbrains.kotlin.android' +} + +android { + namespace 'com.mparticle.kits.adjust.example.kotlin' + compileSdk 34 + + defaultConfig { + applicationId 'com.mparticle.kits.adjust.example.kotlin' + minSdk 21 + targetSdk 34 + versionCode 1 + versionName '1.0' + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = '17' + } + + buildTypes { + release { + minifyEnabled false + } + } +} + +dependencies { + implementation project(':kits:adjust:adjust-5') + implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'com.google.android.material:material:1.11.0' +} diff --git a/kits/adjust/adjust-5/example/example-kotlin/src/main/AndroidManifest.xml b/kits/adjust/adjust-5/example/example-kotlin/src/main/AndroidManifest.xml new file mode 100644 index 000000000..84b1637c1 --- /dev/null +++ b/kits/adjust/adjust-5/example/example-kotlin/src/main/AndroidManifest.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + diff --git a/kits/adjust/adjust-5/example/example-kotlin/src/main/kotlin/com/mparticle/kits/adjust/example/kotlin/ExampleApplication.kt b/kits/adjust/adjust-5/example/example-kotlin/src/main/kotlin/com/mparticle/kits/adjust/example/kotlin/ExampleApplication.kt new file mode 100644 index 000000000..d84519703 --- /dev/null +++ b/kits/adjust/adjust-5/example/example-kotlin/src/main/kotlin/com/mparticle/kits/adjust/example/kotlin/ExampleApplication.kt @@ -0,0 +1,24 @@ +package com.mparticle.kits.adjust.example.kotlin + +import android.app.Application +import com.mparticle.MPEvent +import com.mparticle.MParticle +import com.mparticle.MParticleOptions + +class ExampleApplication : Application() { + override fun onCreate() { + super.onCreate() + val options = + MParticleOptions + .builder(this) + .credentials( + "REPLACE WITH YOUR MPARTICLE API KEY", + "REPLACE WITH YOUR MPARTICLE API SECRET", + ).logLevel(MParticle.LogLevel.VERBOSE) + .build() + MParticle.start(options) + MParticle.getInstance()?.logEvent( + MPEvent.Builder("foo", MParticle.EventType.Other).build(), + ) + } +} diff --git a/kits/adjust/adjust-5/example/example-kotlin/src/main/kotlin/com/mparticle/kits/adjust/example/kotlin/MainActivity.kt b/kits/adjust/adjust-5/example/example-kotlin/src/main/kotlin/com/mparticle/kits/adjust/example/kotlin/MainActivity.kt new file mode 100644 index 000000000..8bb6d6233 --- /dev/null +++ b/kits/adjust/adjust-5/example/example-kotlin/src/main/kotlin/com/mparticle/kits/adjust/example/kotlin/MainActivity.kt @@ -0,0 +1,11 @@ +package com.mparticle.kits.adjust.example.kotlin + +import android.os.Bundle +import androidx.appcompat.app.AppCompatActivity + +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) + } +} diff --git a/kits/adjust/adjust-5/example/example-kotlin/src/main/res/drawable/ic_launcher_foreground.xml b/kits/adjust/adjust-5/example/example-kotlin/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 000000000..046177833 --- /dev/null +++ b/kits/adjust/adjust-5/example/example-kotlin/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,14 @@ + + + + diff --git a/kits/adjust/adjust-5/example/example-kotlin/src/main/res/layout/activity_main.xml b/kits/adjust/adjust-5/example/example-kotlin/src/main/res/layout/activity_main.xml new file mode 100644 index 000000000..e2897e3ff --- /dev/null +++ b/kits/adjust/adjust-5/example/example-kotlin/src/main/res/layout/activity_main.xml @@ -0,0 +1,14 @@ + + + + + + diff --git a/kits/adjust/adjust-5/example/example-kotlin/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/kits/adjust/adjust-5/example/example-kotlin/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 000000000..a8a8fa551 --- /dev/null +++ b/kits/adjust/adjust-5/example/example-kotlin/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/kits/adjust/adjust-5/example/example-kotlin/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/kits/adjust/adjust-5/example/example-kotlin/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 000000000..a8a8fa551 --- /dev/null +++ b/kits/adjust/adjust-5/example/example-kotlin/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/kits/adjust/adjust-5/example/example-kotlin/src/main/res/values/colors.xml b/kits/adjust/adjust-5/example/example-kotlin/src/main/res/values/colors.xml new file mode 100644 index 000000000..f42ada656 --- /dev/null +++ b/kits/adjust/adjust-5/example/example-kotlin/src/main/res/values/colors.xml @@ -0,0 +1,4 @@ + + + #FFFFFF + diff --git a/kits/adjust/adjust-5/example/example-kotlin/src/main/res/values/strings.xml b/kits/adjust/adjust-5/example/example-kotlin/src/main/res/values/strings.xml new file mode 100644 index 000000000..69175f3b1 --- /dev/null +++ b/kits/adjust/adjust-5/example/example-kotlin/src/main/res/values/strings.xml @@ -0,0 +1,4 @@ + + + Adjust Kit Kotlin Example + diff --git a/kits/matrix.json b/kits/matrix.json new file mode 100644 index 000000000..6f99841b3 --- /dev/null +++ b/kits/matrix.json @@ -0,0 +1,8 @@ +[ + { + "name": "adjust-5", + "local_path": "kits/adjust/adjust-5", + "kit_project": ":kits:android-adjust:adjust-5", + "example_kotlin_project": ":kits:android-adjust:adjust-5:example-kotlin" + } +] diff --git a/settings-kit-examples.gradle b/settings-kit-examples.gradle new file mode 100644 index 000000000..aeab3bc8c --- /dev/null +++ b/settings-kit-examples.gradle @@ -0,0 +1,6 @@ +// CI-only settings for kit sample apps. Keeps example modules out of settings-kits.gradle. +apply from: 'settings-kits.gradle' + +include ':kits:adjust:adjust-5:example-kotlin' + +project(':kits:adjust:adjust-5:example-kotlin').projectDir = file('kits/adjust/adjust-5/example/example-kotlin')