Skip to content

Commit

Permalink
Prettified Code!
Browse files Browse the repository at this point in the history
  • Loading branch information
KarinBerg authored and actions-user committed Dec 1, 2024
1 parent 1dff6d3 commit 11e5fd0
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 37 deletions.
101 changes: 65 additions & 36 deletions recipients_app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,79 +3,100 @@
Mobile App for Recipients of a Social Income.

## Tools needed for building the app on a Apple Silicon Mac

- [Homebrew](https://brew.sh/de/)
- Flutter 3.19.6, Dart 3.3.4
- Java JDK 17
- Java JDK 17
- Android Studio LadyBug or later
- Latest vsCode
- Xcode 16.1

## Configure the Apple Silicon Mac environment to build our app
- Install [Homebrew](https://brew.sh/de/)

- Install [Homebrew](https://brew.sh/de/)
```
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
- Install Android Studio
- Set ANDROID_HOME and deprecated ANDROID_SDK_ROOT. Add the following lines in your USER's HOME directory in your .zshrc file:
- Set ANDROID_HOME and deprecated ANDROID_SDK_ROOT. Add the following
lines in your USER's HOME directory in your .zshrc file:
```
export ANDROID_HOME="/Users/karinberg/Development/Android/SDK"
export ANDROID_SDK_ROOT="$ANDROID_HOME" # ANDROID_SDK_ROOT is deprecated, but still in use
export PATH="$PATH:$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools"
````
```
- Restart your terminal so that these changes take effect
- Install Java 17 via Homebrew `brew install openjdk@17`
- Homebrew is telling you to execute a symlink command, so that the system Java wrappers can find this JDK. Please do this.
- Additionally in your USER's HOME directory in the file '.zshrc', add the lines to set the JAVA_HOME environment variable to Java 17 and add Java to the PATH environment variable
- Homebrew is telling you to execute a symlink command, so that the
system Java wrappers can find this JDK. Please do this.
- Additionally in your USER's HOME directory in the file '.zshrc', add
the lines to set the JAVA_HOME environment variable to Java 17 and
add Java to the PATH environment variable
```
export JAVA_HOME=$(/usr/libexec/java_home -v17)
export PATH="$PATH:$JAVA_HOME/bin"
```
- Restart your terminal so that these changes take effect
- Install Flutter
- Tell Flutter to use our Java 17 JDK and not the one bundle with Android Studio via `flutter config --jdk-dir $JAVA_HOME`. Otherwise you will get the error "Unsupported class file major version 65” when building the app for Android.
- Tell Flutter to use our Java 17 JDK and not the one bundle with
Android Studio via `flutter config --jdk-dir $JAVA_HOME`. Otherwise
you will get the error "Unsupported class file major version 65”
when building the app for Android.
- Restart your terminal and IDE so that these changes take effect
- Install vsCode
- Install Flutter extension
- Install Xcode
- Set is as default via `sudo xcode-select -s <path/to/>Xcode.app`
- To agree to the Xcode license from the command line, you can use the following command: `sudo xcodebuild -license accept`
- To agree to the Xcode license from the command line, you can use the
following command: `sudo xcodebuild -license accept`
## Optionally: Use the version manager [asdf](https://asdf-vm.com/)
- Install [asdf](https://asdf-vm.com/) via Homebrew with
`brew install asdf`
- Install flutter plugin for asdf via `asdf plugin-add flutter`
- Add the following lines in your .zshrc file:
```
export FLUTTER_ROOT="$(asdf where flutter)"
### asdf stuff ############
source $(brew --prefix asdf)/libexec/asdf.sh
export ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY=latest_available
# This is optional. It installs tools defined in .tool-versions on terminal start
asdf install
###########################
```
## Optionally: Use the version manager [asdf](https://asdf-vm.com/)
- Install [asdf](https://asdf-vm.com/) via Homebrew with `brew install asdf`
- Install flutter plugin for asdf via `asdf plugin-add flutter`
- Add the following lines in your .zshrc file:
```
export FLUTTER_ROOT="$(asdf where flutter)"
### asdf stuff ############
source $(brew --prefix asdf)/libexec/asdf.sh
export ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY=latest_available
# This is optional. It installs tools defined in .tool-versions on terminal start
asdf install
###########################
```
## Build and run the app the first time with vsCode
- Checkout main branch: `git clone https://github.com/socialincome-san/public.git ./social-income/`
- Copy file `./.vscode/launch.json.example` and rename it to `./.vscode/launch.json`
- Replace the value "FILL IN SENTRY URL" after "SENTRY_URL=" with the real Sentry url to be able to use Sentry
- Decide which flavor and backend environment you what to use and change it if necessary.
- Checkout main branch:
`git clone https://github.com/socialincome-san/public.git ./social-income/`
- Copy file `./.vscode/launch.json.example` and rename it to
`./.vscode/launch.json`
- Replace the value "FILL IN SENTRY URL" after "SENTRY_URL=" with the
real Sentry url to be able to use Sentry
- Decide which flavor and backend environment you what to use and
change it if necessary.
- Open `recipients_app` project folder in vsCode
- Open an terminal inside of vsCode and check `flutter --version` is listing the right flutter version (See above or pubspec.yaml).
- Open an terminal inside of vsCode and check `flutter --version` is
listing the right flutter version (See above or pubspec.yaml).
- Run `./clean_build.sh`
- Choose in vsCode the device to deploy on (iOS Simulator, Android emulator, real Android or iOS device)
- Run the launch configuration "stage_recipients_app (debug mode)" to deploy and run the app on the selected devive in debug mode
- Choose in vsCode the device to deploy on (iOS Simulator, Android
emulator, real Android or iOS device)
- Run the launch configuration "stage_recipients_app (debug mode)" to
deploy and run the app on the selected devive in debug mode
- Happy testing!!
## Available app flavors
Building flavor should work seamlessly for Android Studio and VS
Code with predefined build configs.
Building flavor should work seamlessly for Android Studio and VS Code
with predefined build configs.
We have three build flavors:
- `dev` -> Connecting with Firebase Emulators (Firestore and Auth)
- `stage` -> Connecting with staging online firebase project
- `prod` -> Connecting with production online firebase project and need real Firebase configuration json / plist file (not in the repo)
- `prod` -> Connecting with production online firebase project and need
real Firebase configuration json / plist file (not in the repo)
For development use the `dev` or `stage` flavor.
Expand All @@ -89,12 +110,15 @@ setup.
2. Everything else on [Slack](https://social-income.slack.com/home)
## How tos
### Rebuilding JSON Serialization
```
dart run build_runner watch --delete-conflicting-outputs
```
or
```
dart run build_runner build --delete-conflicting-outputs
```
Expand All @@ -113,14 +137,19 @@ To use a translated string in the code use:
`import 'package:flutter_gen/gen_l10n/app_localizations.dart';`
### Upgrade flutter version
If you upgrade the flutter version, you have to change the following locations as well:
If you upgrade the flutter version, you have to change the following
locations as well:
- pubspec.yaml
- Under 'environment' adjust the 'sdk' and 'flutter' versions
- .tool-versions (version file for version manager ASDF)
- If you use 'asdf' run the comman `asdf local flutter x.y.z` #Replace x.y.z with the new Flutter version.
- .tool-versions (version file for version manager ASDF)
- If you use 'asdf' run the comman `asdf local flutter x.y.z` #Replace
x.y.z with the new Flutter version.
- Otherwise just update the version number in the file
- README.md
- Find all places in the README.md which mentions the Flutter version number
- Find all places in the README.md which mentions the Flutter version
number
## Testing
Expand Down
5 changes: 4 additions & 1 deletion recipients_app/docu/app_release_guides/releasing.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# How to release the apps

1. Increment app version and build number in pubspec.yaml
- Open 'pubspec.yaml' and increase 'version' with the desired app version and the version code by incrementing the '+' part by 1. Incrementing the version code is a must have for a new prod version. Otherwise the stores will not accept the new app.
- Open 'pubspec.yaml' and increase 'version' with the desired app
version and the version code by incrementing the '+' part by 1.
Incrementing the version code is a must have for a new prod
version. Otherwise the stores will not accept the new app.
1. Run CodeMagic Build "iOS Staging (Firebase App Distribution)"
1. Run CodeMagic Build "Android Staging (Firebase App Distribution)"
1. Test the app on the Staging environment. See
Expand Down

0 comments on commit 11e5fd0

Please sign in to comment.