Skip to content

Commit

Permalink
Fix android build
Browse files Browse the repository at this point in the history
  • Loading branch information
ztefanie committed Jan 26, 2024
1 parent 65a15f0 commit e7fd4e6
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 89 deletions.
32 changes: 0 additions & 32 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -805,14 +805,6 @@ workflows:
requires:
- bump_version
- check_frontend
- deliver_android:
buildConfig: bayern
context:
- tuerantuer-google-play
name: deliver_android_bayern
production_delivery: false
requires:
- build_android_bayern
- build_android:
buildConfig: nuernberg
context:
Expand All @@ -823,14 +815,6 @@ workflows:
requires:
- bump_version
- check_frontend
- deliver_android:
buildConfig: nuernberg
context:
- tuerantuer-google-play
name: deliver_android_nuernberg
production_delivery: false
requires:
- build_android_nuernberg
- build_ios:
buildConfig: bayern
context:
Expand All @@ -841,14 +825,6 @@ workflows:
requires:
- bump_version
- check_frontend
- deliver_ios:
buildConfig: bayern
context:
- tuerantuer-apple
name: deliver_bayern_ios
production_delivery: false
requires:
- build_ios_bayern
- build_ios:
buildConfig: nuernberg
context:
Expand All @@ -859,14 +835,6 @@ workflows:
requires:
- bump_version
- check_frontend
- deliver_ios:
buildConfig: nuernberg
context:
- tuerantuer-apple
name: deliver_nuernberg_ios
production_delivery: false
requires:
- build_ios_nuernberg
when: << pipeline.parameters.run_delivery_beta_native >>
frontend:
jobs:
Expand Down
64 changes: 32 additions & 32 deletions .circleci/src/workflows/delivery_beta_native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
context:
- credentials-repo
- credentials-ehrenamtskarte
- deliver_android:
name: deliver_android_bayern
buildConfig: "bayern"
context:
- tuerantuer-google-play
production_delivery: false
requires:
- build_android_bayern
# - deliver_android:
# name: deliver_android_bayern
# buildConfig: "bayern"
# context:
# - tuerantuer-google-play
# production_delivery: false
# requires:
# - build_android_bayern
- build_android:
name: build_android_nuernberg
buildConfig: "nuernberg"
Expand All @@ -33,14 +33,14 @@ jobs:
context:
- credentials-repo
- credentials-ehrenamtskarte
- deliver_android:
name: deliver_android_nuernberg
buildConfig: "nuernberg"
context:
- tuerantuer-google-play
production_delivery: false
requires:
- build_android_nuernberg
# - deliver_android:
# name: deliver_android_nuernberg
# buildConfig: "nuernberg"
# context:
# - tuerantuer-google-play
# production_delivery: false
# requires:
# - build_android_nuernberg
- build_ios:
name: build_ios_bayern
buildConfig: "bayern"
Expand All @@ -51,14 +51,14 @@ jobs:
context:
- tuerantuer-apple
- fastlane-match
- deliver_ios:
name: deliver_bayern_ios
buildConfig: bayern
context:
- tuerantuer-apple
production_delivery: false
requires:
- build_ios_bayern
# - deliver_ios:
# name: deliver_bayern_ios
# buildConfig: bayern
# context:
# - tuerantuer-apple
# production_delivery: false
# requires:
# - build_ios_bayern
- build_ios:
name: build_ios_nuernberg
buildConfig: "nuernberg"
Expand All @@ -69,11 +69,11 @@ jobs:
context:
- tuerantuer-apple
- fastlane-match
- deliver_ios:
name: deliver_nuernberg_ios
buildConfig: nuernberg
context:
- tuerantuer-apple
production_delivery: false
requires:
- build_ios_nuernberg
# - deliver_ios:
# name: deliver_nuernberg_ios
# buildConfig: nuernberg
# context:
# - tuerantuer-apple
# production_delivery: false
# requires:
# - build_ios_nuernberg
16 changes: 8 additions & 8 deletions frontend/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ android {
signingConfigs {
if (System.getenv()['KEYSTORE_PATH']) { // Signing with env variables (CI)
release {
storeFile file("file://" + System.getenv()['HOME'] + project.KEYSTORE_PATH)
storePassword project.KEYSTORE_PASSWORD
keyAlias project.KEYSTORE_KEY_ALIAS
keyPassword project.KEYSTORE_KEY_PASSWORD
storeFile file("file://" + System.getenv()['HOME'] + System.getenv()['KEYSTORE_PATH'])
storePassword System.getenv()['KEYSTORE_PASSWORD']
keyAlias System.getenv()['KEYSTORE_KEY_ALIAS']
keyPassword System.getenv()['KEYSTORE_KEY_PASSWORD']
}
} else if (localProperties.containsKey("signing.keyAlias")) { // Signing with local.properties file (locally)
println "Selected using localProps"
Expand All @@ -114,7 +114,7 @@ android {
abiFilters 'armeabi-v7a','arm64-v8a','x86_64'
}

if (project.hasProperty('KEYSTORE_PATH')) {
if (System.getenv()['KEYSTORE_PATH']) {
signingConfig signingConfigs.release
} else if ( localProperties.containsKey("signing.keyAlias")) {
signingConfig signingConfigs.localProps
Expand Down Expand Up @@ -142,9 +142,9 @@ android {
multiDexEnabled true
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
if (project.hasProperty('VERSION_CODE')) {
versionCode project.VERSION_CODE.toInteger()
versionName project.VERSION_NAME
if (System.getenv()['VERSION_CODE']) {
versionCode System.getenv()['VERSION_CODE'].toInteger()
versionName System.getenv()['VERSION_NAME']
}
}

Expand Down
24 changes: 7 additions & 17 deletions frontend/android/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,13 @@ platform :android do

sh("fvm flutter pub run build_runner build --define df_build_config=name=#{build_config_name}")

gradle(
task: "bundle",
flavor: flavor,
flags: " -Ptarget=lib/main.dart",
build_type: "Release",
properties: {
:VERSION_CODE => version_code,
:VERSION_NAME => version_name,
:BUILD_CONFIG_NAME => build_config_name,
:KEYSTORE_PATH => KEYSTORE_PATH,
:KEYSTORE_KEY_ALIAS => flavor == 'Nuernberg' ? KEYSTORE_KEY_ALIAS_NUERNBERG : KEYSTORE_KEY_ALIAS_BAYERN,
:KEYSTORE_PASSWORD => KEYSTORE_PASSWORD,
:KEYSTORE_KEY_PASSWORD => flavor == 'Nuernberg' ? KEYSTORE_KEY_PASSWORD_NUERNBERG : KEYSTORE_KEY_PASSWORD_BAYERN,
}.compact,
system_properties: gradle_system_properties,
print_command: false
)
ENV["VERSION_CODE"] = version_code
ENV["VERSION_NAME"] = version_name
ENV["BUILD_CONFIG_NAME"] = build_config_name
ENV["KEYSTORE_KEY_ALIAS"] = flavor == 'Nuernberg' ? KEYSTORE_KEY_ALIAS_NUERNBERG : KEYSTORE_KEY_ALIAS_BAYERN
ENV["KEYSTORE_KEY_PASSWORD"] = flavor == 'Nuernberg' ? KEYSTORE_KEY_PASSWORD_NUERNBERG : KEYSTORE_KEY_PASSWORD_BAYERN

sh("fvm flutter build appbundle --dart-define=environment=production --flavor #{flavor} --release -t lib/main.dart")
end

desc "Upload Android App to Google Play"
Expand Down

0 comments on commit e7fd4e6

Please sign in to comment.