-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Update Android project to Android Gradle Plugin 8.2, update de…
…pendencies (#43)
- Loading branch information
Showing
20 changed files
with
415 additions
and
190 deletions.
There are no files selected for viewing
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,52 +1,161 @@ | ||
name: Build and Test | ||
on: [push, pull_request] | ||
on: | ||
push: | ||
pull_request: | ||
defaults: | ||
run: | ||
shell: bash | ||
env: | ||
PUB_ENVIRONMENT: bot.github | ||
# pinned to latest stable version | ||
FLUTTER_SDK_VERSION: 3.19.3 | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Flutter SDK | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: ${{ env.FLUTTER_SDK_VERSION }} | ||
channel: "stable" | ||
cache: true | ||
- name: Install dependencies | ||
run: flutter pub get | ||
- name: Run tests | ||
run: flutter test | ||
- name: Cleanup | ||
if: ${{ always() }} | ||
run: | | ||
if command -v flutter &>/dev/null; then | ||
flutter clean | ||
fi | ||
build-android: | ||
needs: test | ||
name: Build Android flutter app | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v1 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
java-version: "12.x" | ||
- uses: subosito/flutter-action@v2 | ||
distribution: "temurin" | ||
java-version: "17" | ||
cache: "gradle" | ||
- name: Setup Flutter SDK | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: "3.3.8" | ||
channel: 'stable' | ||
- run: | | ||
cd example | ||
flutter pub get | ||
flutter test | ||
flutter build apk | ||
flutter build appbundle | ||
flutter-version: ${{ env.FLUTTER_SDK_VERSION }} | ||
channel: "stable" | ||
cache: true | ||
- name: Install example dependencies | ||
working-directory: example | ||
run: flutter pub get | ||
- name: Test example | ||
working-directory: example | ||
run: flutter test | ||
- name: Build example APK | ||
working-directory: example | ||
run: flutter build apk | ||
- name: Check if example APK exists | ||
working-directory: example | ||
run: | | ||
set -e | ||
if [ ! -f build/app/outputs/apk/release/app-release.apk ]; then | ||
echo "APK file not found!" | ||
exit 1 | ||
fi | ||
- name: Build example App Bundle | ||
working-directory: example | ||
run: flutter build appbundle | ||
- name: Check if example App Bundle exists | ||
working-directory: example | ||
run: | | ||
set -e | ||
if [ ! -f build/app/outputs/bundle/release/app-release.aab ]; then | ||
echo "App Bundle not found!" | ||
exit 1 | ||
fi | ||
- name: Cleanup | ||
if: ${{ always() }} | ||
working-directory: example | ||
run: | | ||
rm -rf build | ||
if command -v flutter &>/dev/null; then | ||
flutter clean | ||
fi | ||
build-ios: | ||
needs: test | ||
name: Build iOS flutter app | ||
runs-on: macos-latest | ||
runs-on: macos-14 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v1 | ||
with: | ||
java-version: "12.x" | ||
- uses: subosito/flutter-action@v2 | ||
- uses: actions/checkout@v4 | ||
- name: Setup Flutter SDK | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: "3.3.8" | ||
channel: 'stable' | ||
- run: | | ||
cd example | ||
flutter pub get | ||
flutter test | ||
flutter build apk | ||
flutter build ios --release --no-codesign | ||
flutter-version: ${{ env.FLUTTER_SDK_VERSION }} | ||
channel: "stable" | ||
cache: true | ||
- name: Install example dependencies | ||
working-directory: example | ||
run: flutter pub get | ||
- name: Test | ||
working-directory: example | ||
run: flutter test | ||
- name: Build unsigned example Xcode archive | ||
working-directory: example | ||
run: flutter build ipa --no-codesign | ||
- name: Check if unsigned example Xcode archive exists | ||
working-directory: example | ||
run: | | ||
set -e | ||
if [ ! -d build/ios/archive/Runner.xcarchive ]; then | ||
echo "Xcode archive not found!" | ||
exit 1 | ||
fi | ||
- name: Cleanup | ||
if: ${{ always() }} | ||
working-directory: example | ||
run: | | ||
rm -rf build | ||
if command -v flutter &>/dev/null; then | ||
flutter clean | ||
fi | ||
build-web: | ||
needs: test | ||
name: Build web flutter app | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: subosito/flutter-action@v2 | ||
- uses: actions/checkout@v4 | ||
- name: Setup Flutter SDK | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: "3.3.8" | ||
channel: 'stable' | ||
- run: | | ||
cd example | ||
flutter pub get | ||
flutter build web | ||
flutter-version: ${{ env.FLUTTER_SDK_VERSION }} | ||
channel: "stable" | ||
cache: true | ||
- name: Install example dependencies | ||
working-directory: example | ||
run: flutter pub get | ||
- name: Test example | ||
working-directory: example | ||
run: flutter test | ||
- name: Build example web | ||
working-directory: example | ||
run: flutter build web | ||
- name: Check if example web exists | ||
working-directory: example | ||
run: | | ||
set -e | ||
if [ ! -f build/web/flutter.js ]; then | ||
echo "Web build not found!" | ||
exit 1 | ||
fi | ||
- name: Cleanup | ||
if: ${{ always() }} | ||
working-directory: example | ||
run: | | ||
rm -rf build | ||
if command -v flutter &>/dev/null; then | ||
flutter clean | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.mparticle.mparticle_flutter_sdk"> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
</manifest> |
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 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,29 +1,18 @@ | ||
buildscript { | ||
ext.kotlin_version = '1.7.21' | ||
repositories { | ||
google() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
classpath 'com.android.tools.build:gradle:7.3.1' | ||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
google() | ||
mavenCentral() | ||
} | ||
} | ||
|
||
rootProject.buildDir = '../build' | ||
rootProject.buildDir = "../build" | ||
subprojects { | ||
project.buildDir = "${rootProject.buildDir}/${project.name}" | ||
project.evaluationDependsOn(':app') | ||
} | ||
subprojects { | ||
project.evaluationDependsOn(":app") | ||
} | ||
|
||
task clean(type: Delete) { | ||
tasks.register("clean", Delete) { | ||
delete rootProject.buildDir | ||
} |
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,3 +1,7 @@ | ||
org.gradle.jvmargs=-Xmx1536M | ||
org.gradle.jvmargs=-Xmx4G | ||
android.useAndroidX=true | ||
android.enableJetifier=true | ||
android.defaults.buildfeatures.buildconfig=true | ||
android.nonTransitiveRClass=false | ||
android.nonFinalResIds=false | ||
android.enableR8.fullMode=false |
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
Oops, something went wrong.