-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upgrade: update AGP, Gradle, MParticle Android SDK (#14)
- update android-core to 5.38.2 - update AGP to 7.1.2 - updage Gradle to 7.3.2 - update targetSdk, compileSdk to 31 - fix compilation errors - migrade build files to kts - and Android unit test CI workflow
- Loading branch information
1 parent
60368be
commit 9365d33
Showing
17 changed files
with
299 additions
and
118 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
name: "Build and Test" | ||
on: [push, pull_request] | ||
jobs: | ||
js-test: | ||
name: "JS Tests" | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./plugin | ||
strategy: | ||
matrix: | ||
node-version: [10.x, 12.x, 14.x, 15.x] | ||
steps: | ||
- name: "Checkout Branch" | ||
uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: "NPM Build" | ||
run: npm ci; npm run build --if-present | ||
- name: "NPM Test" | ||
run: npm test | ||
android-test: | ||
name: "Android Unit Tests" | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./plugin | ||
steps: | ||
- name: "Checkout Branch" | ||
uses: actions/checkout@v2 | ||
- name: "Install JDK 11" | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: "zulu" | ||
java-version: "11" | ||
- name: "Install NPM" | ||
uses: actions/setup-node@v1 | ||
- name: "NPM Build" | ||
run: | | ||
npm ci | ||
npm run build --if-present | ||
- name: "Run Unit Tests" | ||
run: ./gradlew test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: "Release" | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
dryRun: | ||
description: "Do a dry run to preview instead of a real release [true/false]" | ||
required: true | ||
default: "false" | ||
|
||
jobs: | ||
semantic-release: | ||
name: "Semantic Release" | ||
runs-on: macos-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.MP_SEMANTIC_RELEASE_BOT }} | ||
GIT_AUTHOR_NAME: mparticle-bot | ||
GIT_AUTHOR_EMAIL: developers@mparticle.com | ||
GIT_COMMITTER_NAME: mparticle-bot | ||
GIT_COMMITTER_EMAIL: developers@mparticle.com | ||
steps: | ||
- name: "Checkout public main branch" | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
ref: main | ||
# - name: "Import GPG Key" | ||
# uses: crazy-max/ghaction-import-gpg@v4 | ||
# with: | ||
# gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
# passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
# git_user_signingkey: true | ||
# git_commit_gpgsign: true | ||
- name: "Semantic Release --dry-run" | ||
if: ${{ github.event.inputs.dryRun == 'true' }} | ||
run: | | ||
npx \ | ||
-p lodash \ | ||
-p semantic-release@17 \ | ||
-p @semantic-release/changelog@5 \ | ||
-p @semantic-release/git@9 \ | ||
-p @semantic-release/exec@5 \ | ||
semantic-release --dry-run | ||
- name: "Semantic Release" | ||
if: ${{ github.event.inputs.dryRun == 'false' }} | ||
run: | | ||
npx \ | ||
-p lodash \ | ||
-p semantic-release@17 \ | ||
-p @semantic-release/changelog@5 \ | ||
-p @semantic-release/git@9 \ | ||
-p @semantic-release/exec@5 \ | ||
semantic-release | ||
- name: "Push automated release commits to release branch" | ||
if: ${{ github.event.inputs.dryRun == 'false' }} | ||
run: | | ||
git push origin main | ||
npm-release: | ||
name: "Upload to NPM" | ||
runs-on: ubuntu-latest | ||
needs: semantic-release | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
defaults: | ||
run: | ||
working-directory: ./plugin | ||
steps: | ||
- name: "Checkout public main branch" | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
ref: main | ||
- name: "Install Node" | ||
uses: actions/setup-node@v1 | ||
- name: "NPM Build" | ||
run: | | ||
npm ci | ||
npm run build --if-present | ||
- name: "Upload to NPM" | ||
if: ${{ github.event.inputs.dryRun == 'false' }} | ||
run: | | ||
touch .npmrc | ||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc | ||
npm publish | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: "PR Reusable Checks" | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
pr-branch-check-name: | ||
name: "Check PR for semantic branch name" | ||
uses: mParticle/mparticle-workflows/.github/workflows/pr-branch-check-name.yml@stable | ||
pr-title-check: | ||
name: "Check PR for semantic title" | ||
uses: mParticle/mparticle-workflows/.github/workflows/pr-title-check.yml@stable | ||
pr-branch-target-gitflow: | ||
name: "Check PR for semantic target branch" | ||
uses: mParticle/mparticle-workflows/.github/workflows/pr-branch-target-continuous.yml@stable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Built application files | ||
*.apk | ||
*.ap_ | ||
*.bak | ||
|
||
# Files for the ART/Dalvik VM | ||
*.dex | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
: ${1?"Version missing - usage: $0 x.y.z"} | ||
|
||
#update build.gradle | ||
line="\\\"version\\\":.*\\\".*\\\"/\\\"version\\\": \\\"$1\\\"" | ||
|
||
sed -i '.bak' "s/$line/g" plugin/package.json | ||
|
||
#commit the version bump, tag, and push to private and public | ||
git add plugin/package.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
# Project-wide Gradle settings. | ||
|
||
# IDE (e.g. Android Studio) users: | ||
# Gradle settings configured through the IDE *will override* | ||
# any settings specified in this file. | ||
|
||
# For more details on how to configure your build environment visit | ||
## For more details on how to configure your build environment visit | ||
# http://www.gradle.org/docs/current/userguide/build_environment.html | ||
|
||
# | ||
# Specifies the JVM arguments used for the daemon process. | ||
# The setting is particularly useful for tweaking memory settings. | ||
org.gradle.jvmargs=-Xmx1536m | ||
|
||
# Default value: -Xmx1024m -XX:MaxPermSize=256m | ||
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | ||
# | ||
# When configured, Gradle will run in incubating parallel mode. | ||
# This option should only be used with decoupled projects. More details, visit | ||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | ||
# org.gradle.parallel=true | ||
#Thu May 05 14:30:48 EDT 2022 | ||
org.gradle.jvmargs=-Xmx1536m | ||
android.useAndroidX=true | ||
android.enableJetifier=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
include(":src:android") | ||
pluginManagement { | ||
repositories { | ||
google() | ||
mavenCentral() | ||
} | ||
plugins { | ||
id("com.android.library") version ("7.1.3") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,30 @@ | ||
apply plugin: 'com.android.library' | ||
plugins { | ||
id("com.android.library") | ||
} | ||
|
||
android { | ||
compileSdkVersion 25 | ||
buildToolsVersion "25.0.2" | ||
compileSdk = 31 | ||
defaultConfig { | ||
minSdkVersion 15 | ||
targetSdkVersion 25 | ||
versionCode 1 | ||
versionName "1.0" | ||
minSdk = 15 | ||
targetSdk = 31 | ||
versionCode = 1 | ||
versionName = "1.0" | ||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
} | ||
buildTypes { | ||
} | ||
|
||
} | ||
repositories { | ||
google() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
testCompile 'junit:junit:4.12' | ||
testCompile 'org.json:json:20080701' | ||
testCompile "org.mockito:mockito-core:1.+" | ||
provided 'org.apache.cordova:framework:7.1.0' | ||
provided 'com.mparticle:android-core:5.27.0' | ||
compileOnly("org.apache.cordova:framework:10.1.2") | ||
compileOnly("com.mparticle:android-core:5.38.1") | ||
|
||
testImplementation("junit:junit:4.13.2") | ||
testImplementation("org.json:json:20220320") | ||
testImplementation("org.mockito:mockito-core:4.5.1") | ||
testImplementation("org.apache.cordova:framework:10.1.2") | ||
testImplementation("com.mparticle:android-core:5.38.1") | ||
} |
Oops, something went wrong.