From 13d8750b403630f684a96f2cc1220ae57332cc7a Mon Sep 17 00:00:00 2001 From: Max Ammann Date: Mon, 9 Jan 2023 10:16:37 +0100 Subject: [PATCH] Integrate build configs into flavors (#642) * Upgrade gradle wrapper * Upgrade android plugin * Allow using flavors to set build config * Remove maps_launcher * Fix usage of flavors * Also build nuernberg in CI * Upgrade to 7.3.1 and adjust build config usage * Fix workflow names * Set exported * Update run configs --- .circleci/config.yml | 37 ++++-- .../{Test_Backend.xml => Build_backend.xml} | 4 +- ..._admin__env_local_buildConfig_bayern_.xml} | 2 +- ...anager__env_local_buildConfig_bayern_.xml} | 4 +- ...L_Schema_Export.xml => Export_GraphQL.xml} | 2 +- ...__Local_.xml => Format_administration.xml} | 4 +- ...Flutter_Format.xml => Format_frontend.xml} | 2 +- .../{Import.xml => Import_data.xml} | 2 +- .../runConfigurations/Run_Flutter__local_.xml | 8 -- .../Run__env_local_buildConfig_bayern_.xml | 10 ++ ...Run__env_showcase_buildConfig_bayern_.xml} | 6 +- ...env_showcase_buildConfig_bayern_floss_.xml | 10 ++ ...__env_showcase_buildConfig_nuernberg_.xml} | 6 +- ...n_backend__env_local_buildConfig_all_.xml} | 10 +- ...ayern_.xml => Set_build_config_bayern.xml} | 4 +- ....xml => Set_build_config_bayern_floss.xml} | 2 +- ...rg_.xml => Set_build_config_nuernberg.xml} | 4 +- ...nistration__env_local_buildConfig_all_.xml | 15 +++ .../runConfigurations/Test_administration.xml | 9 ++ frontend/android/.idea/kotlinc.xml | 6 + frontend/android/.idea/misc.xml | 12 ++ frontend/android/.idea/runConfigurations.xml | 10 -- frontend/android/app/build.gradle | 109 +++++++++++------ frontend/android/app/buildConfigs.gradle | 20 ++-- .../android/app/src/main/AndroidManifest.xml | 2 +- frontend/android/build.gradle | 2 +- .../android/gradle/wrapper/gradle-wrapper.jar | Bin 53636 -> 59203 bytes .../gradle/wrapper/gradle-wrapper.properties | 2 +- frontend/android/gradlew | 111 +++++++++++------- frontend/android/gradlew.bat | 53 ++++----- frontend/ios/Podfile.lock | 6 - .../store_widgets/detail/detail_content.dart | 16 ++- frontend/pubspec.lock | 9 +- frontend/pubspec.yaml | 3 +- 34 files changed, 315 insertions(+), 187 deletions(-) rename .idea/runConfigurations/{Test_Backend.xml => Build_backend.xml} (84%) rename .idea/runConfigurations/{Create_Admin_Account.xml => Create_project_admin__env_local_buildConfig_bayern_.xml} (86%) rename .idea/runConfigurations/{Run_Backend.xml => Create_region_manager__env_local_buildConfig_bayern_.xml} (74%) rename .idea/runConfigurations/{GraphQL_Schema_Export.xml => Export_GraphQL.xml} (87%) rename .idea/runConfigurations/{Start_Administration__Local_.xml => Format_administration.xml} (69%) rename .idea/runConfigurations/{Flutter_Format.xml => Format_frontend.xml} (87%) rename .idea/runConfigurations/{Import.xml => Import_data.xml} (88%) delete mode 100644 .idea/runConfigurations/Run_Flutter__local_.xml create mode 100644 .idea/runConfigurations/Run__env_local_buildConfig_bayern_.xml rename .idea/runConfigurations/{Run_Flutter__showcase_bayern_.xml => Run__env_showcase_buildConfig_bayern_.xml} (66%) create mode 100644 .idea/runConfigurations/Run__env_showcase_buildConfig_bayern_floss_.xml rename .idea/runConfigurations/{Run_Flutter__showcase_nuernberg_.xml => Run__env_showcase_buildConfig_nuernberg_.xml} (64%) rename .idea/runConfigurations/{Build_Backend.xml => Run_backend__env_local_buildConfig_all_.xml} (70%) rename .idea/runConfigurations/{Select__bayern_.xml => Set_build_config_bayern.xml} (86%) rename .idea/runConfigurations/{Select__bayern_floss_.xml => Set_build_config_bayern_floss.xml} (87%) rename .idea/runConfigurations/{Select__nuernberg_.xml => Set_build_config_nuernberg.xml} (86%) create mode 100644 .idea/runConfigurations/Start_administration__env_local_buildConfig_all_.xml create mode 100644 .idea/runConfigurations/Test_administration.xml create mode 100644 frontend/android/.idea/kotlinc.xml delete mode 100644 frontend/android/.idea/runConfigurations.xml diff --git a/.circleci/config.yml b/.circleci/config.yml index d3ab08b0c..2091bc1b3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,15 +6,33 @@ workflows: jobs: - check-frontend - frontend-android-build: + name: frontend-android-build-bayern-floss buildConfig: "bayern-floss" + flutterFlavor: "BayernFloss" requires: - check-frontend - frontend-android-build: + name: frontend-android-build-bayern buildConfig: "bayern" + flutterFlavor: "Bayern" requires: - check-frontend - frontend-ios-build: + name: frontend-ios-build-bayern buildConfig: "bayern" + flutterFlavor: "Bayern" + requires: + - check-frontend + - frontend-android-build: + name: frontend-android-build-nuernberg + buildConfig: "nuernberg" + flutterFlavor: "Nuernberg" + requires: + - check-frontend + - frontend-ios-build: + name: frontend-ios-build-nuernberg + buildConfig: "nuernberg" + flutterFlavor: "Nuernberg" requires: - check-frontend - backend-build @@ -175,8 +193,10 @@ jobs: buildConfig: description: "Name of the build config to use" type: string + flutterFlavor: + description: "Flutter Flavor to use" + type: string environment: - BUILD_CONFIG_NAME: << parameters.buildConfig >> GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m" -Dorg.gradle.daemon=false -Dorg.gradle.workers.max=2' resource_class: large working_directory: ~/project/frontend @@ -202,11 +222,11 @@ jobs: - run: name: Build Runner command: | - fvm --verbose flutter pub run build_runner build --define "df_build_config=name=$BUILD_CONFIG_NAME" + fvm --verbose flutter pub run build_runner build --define "df_build_config=name=<< parameters.buildConfig >>" - run: name: Build command: | - fvm --verbose flutter build apk --dart-define=environment=production --release -t lib/main.dart + fvm --verbose flutter build apk --dart-define=environment=production --flavor << parameters.flutterFlavor >> --release -t lib/main.dart - store_artifacts: path: build/app/outputs/flutter-apk/ @@ -217,9 +237,10 @@ jobs: buildConfig: description: "Name of the build config to use" type: string + flutterFlavor: + description: "Flutter Flavor to use" + type: string working_directory: ~/project/frontend - environment: - BUILD_CONFIG_NAME: << parameters.buildConfig >> steps: - checkout: path: ~/project @@ -248,12 +269,12 @@ jobs: - run: name: Build Runner command: | - fvm --verbose flutter pub run build_runner build --define "df_build_config=name=$BUILD_CONFIG_NAME" + fvm --verbose flutter pub run build_runner build --define "df_build_config=name=<< parameters.buildConfig >>" - run: name: Build command: | - app-toolbelt v0 build-config write-xcconfig "$BUILD_CONFIG_NAME" ios --directory ios/ - fvm --verbose flutter build ios --dart-define=environment=production --no-codesign --release -t lib/main.dart + app-toolbelt v0 build-config write-xcconfig "<< parameters.buildConfig >>" ios --directory ios/ + fvm --verbose flutter build ios --dart-define=environment=production --flavor << parameters.flutterFlavor >> --no-codesign --release -t lib/main.dart backend-build: environment: diff --git a/.idea/runConfigurations/Test_Backend.xml b/.idea/runConfigurations/Build_backend.xml similarity index 84% rename from .idea/runConfigurations/Test_Backend.xml rename to .idea/runConfigurations/Build_backend.xml index beec83579..e478541db 100644 --- a/.idea/runConfigurations/Test_Backend.xml +++ b/.idea/runConfigurations/Build_backend.xml @@ -1,5 +1,5 @@ - +