Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add build configs to frontend #551

Merged
merged 44 commits into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
a7fc19f
Pass build config to android
maxammann Apr 19, 2022
8e908b9
Use proper build config variables in android project
maxammann May 2, 2022
9fe527f
Use build config in xcode project
maxammann May 2, 2022
d03b2c7
Run app-toolbelt before building and add floss schema
maxammann May 3, 2022
32ef23a
Ignore generated config
maxammann May 3, 2022
cf741c0
Merge branch 'whitelabel' into 517-add-build-config
maxammann Sep 13, 2022
4061f89
Update intellij config
maxammann Sep 13, 2022
d27b51b
Add build_config build step
maxammann Sep 13, 2022
bd3c3ed
Update intellij config
maxammann Sep 13, 2022
6a4b160
Update intellij config
maxammann Sep 14, 2022
e7590ef
Revert schema update
maxammann Sep 14, 2022
9231f99
Finish first basic version of a code generator
maxammann Sep 14, 2022
5d82cf2
Use symlink
maxammann Sep 14, 2022
1ba6d6d
Update run script
maxammann Sep 14, 2022
ee0eba7
Cleanup df_build_config dependency
maxammann Sep 14, 2022
b16ca04
Start work on code generation
maxammann Sep 14, 2022
dceef28
Update intellij config
maxammann Sep 14, 2022
60038f1
Add comment
maxammann Sep 14, 2022
c6cd2ed
Revert graphql changes
maxammann Sep 14, 2022
24cf22c
Fix formatting
maxammann Sep 14, 2022
df17a47
Add format run config
maxammann Sep 14, 2022
1987a3c
Add int support
maxammann Sep 14, 2022
95f3d78
Introduce better code generation
maxammann Sep 19, 2022
1d514ca
Fix newline in code generation
maxammann Sep 19, 2022
6c78518
Fix formatting
maxammann Sep 19, 2022
7a1bf22
Generate build config in CI
maxammann Sep 19, 2022
ff59680
Install app toolbelt
maxammann Sep 19, 2022
dcbc38b
Make node everywhere available and update images
maxammann Sep 19, 2022
d170448
Use sudo
maxammann Sep 19, 2022
90c574a
Downgrade node
maxammann Sep 19, 2022
792bd73
Install from tar.gz
maxammann Sep 19, 2022
d344766
Use unsafe-perm
maxammann Sep 19, 2022
a348bb1
Setup npm
maxammann Sep 19, 2022
ae4a679
Fix mkdir
maxammann Sep 19, 2022
68f920c
Use sudo to install
maxammann Sep 19, 2022
91888ec
Merge branch 'whitelabel' into 517-add-build-config
maxammann Sep 19, 2022
f651911
Fix analyzing
maxammann Sep 19, 2022
b7680ef
Select correct build config
maxammann Sep 19, 2022
9bf9938
Add toolbelt on mac
maxammann Sep 19, 2022
05fe12b
Use /bin/bash
maxammann Sep 19, 2022
598e794
Remove generated code
maxammann Sep 19, 2022
27ab7b2
Change test name
maxammann Sep 19, 2022
c2c6b79
Change builder name
maxammann Sep 19, 2022
dc8ecbf
Add comment
maxammann Sep 19, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 67 additions & 29 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ workflows:
jobs:
- check-frontend
- frontend-android-build:
floss: true
x86: false
buildConfig: "bayern-floss"
requires:
- check-frontend
- check-frontend
- frontend-android-build:
floss: false
x86: true
buildConfig: "bayern"
maxammann marked this conversation as resolved.
Show resolved Hide resolved
requires:
- check-frontend
- frontend-ios-build:
buildConfig: "bayern"
requires:
- check-frontend
- backend-build
Expand Down Expand Up @@ -48,6 +47,20 @@ workflows:
- whitelabel

commands:
setup-npm-global:
steps:
- run:
name: Setup npm
command: |
mkdir -p ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:"$PATH"' >> "$BASH_ENV"
install-app-toolbelt:
steps:
- setup-npm-global
- run:
name: Install app-toolbelt
command: npm install --unsafe-perm -g https://github.com/digitalfabrik/app-toolbelt/archive/refs/heads/main.tar.gz
install-dart-linux:
steps:
- run:
Expand All @@ -58,6 +71,7 @@ commands:
install-fvm-linux:
steps:
- install-dart-linux
- install-app-toolbelt
- run:
name: Install FVM
command: |
Expand Down Expand Up @@ -106,40 +120,48 @@ commands:
jobs:
check-frontend:
docker:
- image: cimg/base:2020.01
- image: cimg/node:16.17.0
resource_class: small
working_directory: ~/project/frontend
steps:
- checkout:
path: ~/project
- install-fvm-linux
- install-app-toolbelt
- run:
name: Install Flutter Packages
command: fvm flutter pub get
- run:
name: Check Formatting
command: fvm flutter format -l 120 -o none --set-exit-if-changed .
- run:
name: Build Runner
command: |
# Statically use "bayern" build config for analyzing here
fvm --verbose flutter pub run build_runner build --delete-conflicting-outputs --define "df_build_config=name=bayern"
- run:
name: Check Analyzer and Linting
command: fvm flutter analyze --fatal-infos --fatal-warnings
command: |
fvm flutter analyze --fatal-infos --fatal-warnings
fvm flutter analyze pubs/df_build_config --fatal-infos --fatal-warnings

frontend-android-build:
docker:
- image: circleci/android:api-30
- image: cimg/android:2022.09.2-node
parameters:
floss:
description: "Build a floss build"
default: false
type: boolean
x86:
description: "Build for x86 architecture"
default: true
type: boolean
buildConfig:
description: "Name of the build config 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
steps:
- checkout:
path: ~/project
- install-fvm-linux
- install-app-toolbelt
- restore_cache:
keys:
- pub-2-{{ checksum "pubspec.lock" }}-{{ arch }}
Expand All @@ -152,23 +174,34 @@ jobs:
key: pub-2-{{ checksum "pubspec.lock" }}-{{ arch }}
paths:
- .dart_tool
- run:
name: Build Runner
command: |
fvm --verbose flutter pub run build_runner build --delete-conflicting-outputs --define "df_build_config=name=$BUILD_CONFIG_NAME"
- run:
name: Build
command: |
fvm --verbose flutter build apk --release -t lib/main_prod.dart <<# parameters.floss >> --dart-define=ANDROID_FLOSS=true <</ parameters.floss >><<^ parameters.x86 >> --dart-define=EXCLUDE_X86=true <</ parameters.x86 >>
fvm --verbose flutter build apk --release -t lib/main_prod.dart
- store_artifacts:
path: build/app/outputs/flutter-apk/



frontend-ios-build:
macos:
xcode: 13.2.0
xcode: 14.0.0
parameters:
buildConfig:
description: "Name of the build config to use"
type: string
working_directory: ~/project/frontend
environment:
BUILD_CONFIG_NAME: << parameters.buildConfig >>
steps:
- checkout:
path: ~/project
- install-fvm-mac
- install-app-toolbelt
- restore_cache:
keys:
- pub-2-{{ checksum "pubspec.lock" }}-{{ arch }}
Expand All @@ -187,17 +220,22 @@ jobs:
cd ios
pod update # This command is somehow needed: https://github.com/m0nac0/flutter-maplibre-gl/pull/9
pod install
- run:
name: Build Runner
command: |
fvm --verbose flutter pub run build_runner build --delete-conflicting-outputs --define "df_build_config=name=$BUILD_CONFIG_NAME"
- run:
name: Build
command: |
app-toolbelt v0 build-config write-xcconfig "$BUILD_CONFIG_NAME" ios --directory ios/
fvm --verbose flutter build ios --no-codesign --release -t lib/main_prod.dart

backend-build:
environment:
_JAVA_OPTIONS: "-Xmx3g"
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.workers.max=2"
docker:
- image: circleci/openjdk:11.0.3-jdk-stretch
- image: cimg/openjdk:11.0.16-node
working_directory: ~/project/backend
steps:
- checkout:
Expand All @@ -224,7 +262,7 @@ jobs:

administration-build:
docker:
- image: cimg/node:15.8.0
- image: cimg/node:16.17.0
working_directory: ~/project/administration
steps:
- checkout:
Expand Down Expand Up @@ -252,7 +290,7 @@ jobs:

martin-build:
docker:
- image: rust:1.50.0
- image: cimg/rust:1.63.0
working_directory: ~/martin
steps:
- run:
Expand All @@ -270,8 +308,8 @@ jobs:
- run:
name: "Install OpenSSL"
command: |
apt update
apt install -y openssl libssl-dev
sudo apt update
sudo apt install -y openssl libssl-dev
- run:
name: "Build"
command: |
Expand All @@ -295,7 +333,7 @@ jobs:

backend-pack:
docker:
- image: cimg/base:2020.01
- image: cimg/base:2022.09
working_directory: ~/project/backend
steps:
- checkout:
Expand All @@ -315,7 +353,7 @@ jobs:

administration-pack:
docker:
- image: cimg/base:2020.01
- image: cimg/base:2022.09
working_directory: ~/project/administration
steps:
- checkout:
Expand All @@ -335,7 +373,7 @@ jobs:

styles-pack:
docker:
- image: cimg/base:2020.01
- image: cimg/base:2022.09
working_directory: ~/project/map-tiles/styles
steps:
- checkout:
Expand All @@ -355,7 +393,7 @@ jobs:

martin-pack:
docker:
- image: cimg/base:2020.01
- image: cimg/base:2022.09
working_directory: ~/project/map-tiles/martin
steps:
- checkout:
Expand All @@ -381,7 +419,7 @@ jobs:

meta-pack:
docker:
- image: cimg/base:2020.01
- image: cimg/base:2022.09
working_directory: ~/project/administration
steps:
- checkout:
Expand All @@ -399,7 +437,7 @@ jobs:

deploy:
docker:
- image: cimg/base:2020.01
- image: cimg/base:2022.09
steps:
- attach_workspace:
at: /tmp/workspace
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/runConfigurations/Run_Flutter__staging___FLOSS_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/runConfigurations/Run_build_runner.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
.dart_tool/
.packages
build/
# If you're building an application, you may want to check-in your pubspec.lock
pubspec.lock

# Directory created by dartdoc
# If you don't generate documentation locally you can remove this line.
Expand All @@ -28,6 +26,11 @@ doc/api/


vendor/
schema.graphql
.fvm/flutter_sdk
runConfigurations.xml

# Generated code
lib/build_config/build_config.dart
lib/graphql/graphql_api.dart
lib/graphql/graphql_api.graphql.dart
lib/graphql/graphql_api.graphql.g.dart
4 changes: 4 additions & 0 deletions frontend/.idea/frontend.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ analyzer:
- build/**
- lib/graphql/graphql_api*.dart
- lib/identification/protobuf/*.dart
- pubs/**
errors:
# Analysis options
missing_required_param: warning
Expand Down
Loading