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 flavors to macOS #1078

Merged
merged 8 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions .github/workflows/alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,12 @@ jobs:
fvm flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
echo $(realpath ./bin) >> $GITHUB_PATH

# We need to install the FlutterFire CLI because we have Build Phases in
# XCode configured which are using the FlutterFire CLI. Without the CLI,
# the build would fail.
- name: Install FlutterFire CLI
run: fvm flutter pub global activate flutterfire_cli 0.3.0-dev.18

- name: Deploy macOS to TestFlight
env:
# The following secrets are used by the Codemagic CLI tool. It's important
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,12 @@ jobs:
fvm flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
echo $(pwd)/bin >> $GITHUB_PATH

# We need to install the FlutterFire CLI because we have Build Phases in
# XCode configured which are using the FlutterFire CLI. Without the CLI,
# the build would fail.
- name: Install FlutterFire CLI
run: fvm flutter pub global activate flutterfire_cli 0.3.0-dev.18

- name: Deploy to TestFlight
env:
# The following secrets are used by the Codemagic CLI tool. It's important
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/integration_tests_app_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ jobs:
APP_STORE_CONNECT_KEY_IDENTIFIER: ${{ secrets.SHAREZONE_APP_STORE_CONNECT_KEY_IDENTIFIER }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.SHAREZONE_APP_STORE_CONNECT_ISSUER_ID }}
APP_STORE_CONNECT_PRIVATE_KEY: ${{ secrets.SHAREZONE_APP_STORE_CONNECT_PRIVATE_KEY }}
BUNDLE_ID: de.codingbrain.sharezone.app
BUNDLE_ID: de.codingbrain.sharezone.app.dev
run: |
# Even when are trying to build app, we need to use "--platform IOS".
# The reason for this that our production bundle ID was created for
Expand All @@ -331,7 +331,14 @@ jobs:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}

# We need to install the FlutterFire CLI because we have Build Phases in
# XCode configured which are using the FlutterFire CLI. Without the CLI,
# the build would fail.
- name: Install FlutterFire CLI
run: flutter pub global activate flutterfire_cli 0.3.0-dev.18

- name: Build macOS app
run: |
flutter build macos \
-t lib/main_prod.dart
--flavor dev \
-t lib/main_dev.dart
6 changes: 6 additions & 0 deletions .github/workflows/stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,12 @@ jobs:
fvm flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
echo $(pwd)/bin >> $GITHUB_PATH

# We need to install the FlutterFire CLI because we have Build Phases in
# XCode configured which are using the FlutterFire CLI. Without the CLI,
# the build would fail.
- name: Install FlutterFire CLI
run: fvm flutter pub global activate flutterfire_cli 0.3.0-dev.18

- name: Deploy to TestFlight
env:
# The following secrets are used by the Codemagic CLI tool. It's important
Expand Down
18 changes: 16 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@ To install & use FVM, follow the following steps:

When you are using VS Code, no further steps should be necessary, because we included the `.vscode/setting.json` to git. However, when you are using Android Studio, you need to configure your IDE to use the Flutter version of FVM. Follow the [official documentation](https://fvm.app/docs/getting_started/configuration#android-studio) to configure Android Studio.

### FlutterFire CLI

If you want to use build the macOS app, you need to install the [FlutterFire CLI](https://pub.dev/packages/flutterfire_cli). This CLI is used during the build process.

To install the FlutterFire CLI, execute the following command:

```sh
fvm flutter pub global activate flutterfire_cli 0.3.0-dev.18
```

Make sure, you have the 0.3.0-dev.18 version or higher installed. You can check the version by running `flutterfire --version`.

## Running the app

After you have set up your development environment, you can run the app.
Expand All @@ -104,13 +116,15 @@ cd app

To run the app, you can then execute the following command:

### Android & iOS
### Android, iOS & macOS

```sh

```sh
fvm flutter run --flavor dev --target lib/main_dev.dart
```

### Web & macOS
### Web

```sh
fvm flutter run --target lib/main_dev.dart
Expand Down
170 changes: 114 additions & 56 deletions app/firebase.json
Original file line number Diff line number Diff line change
@@ -1,64 +1,122 @@
{
"hosting": [
{
"target": "alpha-web-app",
"public": "build/web",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
"hosting": [
{
"source": "**",
"destination": "/index.html"
}
]
},
{
"target": "beta-web-app",
"public": "build/web",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
"target": "alpha-web-app",
"public": "build/web",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
{
"source": "**",
"destination": "/index.html"
}
]
},
{
"target": "release-web-app",
"public": "build/web",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
"target": "beta-web-app",
"public": "build/web",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
{
"source": "**",
"destination": "/index.html"
}
]
},
{
"target": "test-web-app",
"public": "build/web",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
"target": "release-web-app",
"public": "build/web",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
{
"source": "**",
"destination": "/index.html"
"target": "test-web-app",
"public": "build/web",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
],
"flutter": {
"platforms": {
"macos": {
"buildConfigurations": {
"Debug-dev": {
"projectId": "sharezone-debug",
"appId": "1:366164701221:ios:785f107df46335d5bfcfcc",
"uploadDebugSymbols": true,
"fileOutput": "macos/config/dev/GoogleService-Info.plist"
},
"Profile-dev": {
"projectId": "sharezone-debug",
"appId": "1:366164701221:ios:785f107df46335d5bfcfcc",
"uploadDebugSymbols": true,
"fileOutput": "macos/config/dev/GoogleService-Info.plist"
},
"Release-dev": {
"projectId": "sharezone-debug",
"appId": "1:366164701221:ios:785f107df46335d5bfcfcc",
"uploadDebugSymbols": true,
"fileOutput": "macos/config/dev/GoogleService-Info.plist"
},
"Debug-prod": {
"projectId": "sharezone-c2bd8",
"appId": "1:730263787697:ios:3ff9b2cb1c2a5a31",
"uploadDebugSymbols": true,
"fileOutput": "macos/config/prod/GoogleService-Info.plist"
},
"Profile-prod": {
"projectId": "sharezone-c2bd8",
"appId": "1:730263787697:ios:3ff9b2cb1c2a5a31",
"uploadDebugSymbols": true,
"fileOutput": "macos/config/prod/GoogleService-Info.plist"
},
"Release-prod": {
"projectId": "sharezone-c2bd8",
"appId": "1:730263787697:ios:3ff9b2cb1c2a5a31",
"uploadDebugSymbols": true,
"fileOutput": "macos/config/prod/GoogleService-Info.plist"
}
}
},
"dart": {
"lib/firebase_options_dev.g.dart": {
"projectId": "sharezone-debug",
"configurations": {
"macos": "1:366164701221:ios:785f107df46335d5bfcfcc"
}
},
"lib/firebase_options_prod.g.dart": {
"projectId": "sharezone-c2bd8",
"configurations": {
"macos": "1:730263787697:ios:3ff9b2cb1c2a5a31"
}
}
}
}
]
}
]
}
Loading
Loading