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

Use FVM #146

Merged
merged 6 commits into from
Apr 23, 2022
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 4 additions & 0 deletions .fvm/fvm_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"flutterSdkVersion": "2.5.2",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will update the Flutter version in a seperate PR

"flavors": {}
}
6 changes: 4 additions & 2 deletions .github/workflows/deploy_web_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ on:
workflow_dispatch:

env:
FLUTTER_VERSION: "2.5.2"
CI_CD_DART_SCRIPTS_PACKAGE_PATH: "tools/sz_repo_cli/"

jobs:
Expand All @@ -35,11 +34,14 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set Flutter version from FVM config file to environment variables
uses: kuhnroyal/flutter-fvm-config-action@v1

- name: Install Flutter
uses: subosito/flutter-action@v1
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: any
channel: ${{ env.FLUTTER_CHANNEL }}

- name: Activate sz_repo_cli package
run: pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ on:
workflow_dispatch:

env:
FLUTTER_VERSION: "2.5.2"
CI_CD_DART_SCRIPTS_PACKAGE_PATH: "tools/sz_repo_cli/"

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
Expand All @@ -33,10 +32,13 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set Flutter version from FVM config file to environment variables
uses: kuhnroyal/flutter-fvm-config-action@v1

- uses: subosito/flutter-action@v1
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'any'
channel: ${{ env.FLUTTER_CHANNEL }}

- name: Activate sz_repo_cli package
run: pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
Expand All @@ -62,10 +64,13 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set Flutter version from FVM config file to environment variables
uses: kuhnroyal/flutter-fvm-config-action@v1

- uses: subosito/flutter-action@v1
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'any'
channel: ${{ env.FLUTTER_CHANNEL }}

- name: Activate sz_repo_cli package
run: pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
Expand Down Expand Up @@ -95,10 +100,13 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set Flutter version from FVM config file to environment variables
uses: kuhnroyal/flutter-fvm-config-action@v1

- uses: subosito/flutter-action@v1
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'any'
channel: ${{ env.FLUTTER_CHANNEL }}

- name: Build web app
working-directory: app
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@
# IDE
.vscode/*
!.vscode/launch.json
!.vscode/settings.json

# FVM will create a relative symlink in your project from .fvm/flutter_sdk to
# the cache of the selected version. We should add this to our .gitignore.
#
# Source: https://fvm.app/docs/getting_started/configuration#project
.fvm/flutter_sdk
17 changes: 17 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
// Set the path of the Flutter SDK to the path of the FVM Flutter version.
//
// VS Code will always use the version selected within the project for all
// IDE tooling.
//
// Source: https://fvm.app/docs/getting_started/configuration#option-1---automatic-switching-recommended
"dart.flutterSdkPath": ".fvm/flutter_sdk",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Android Studio users need to set up FVM for themselves in Android Studio, because I think in Android Studio isn't something like settings.json which can commit to git (I think the .idea/workspace.xml contains also information about the local machine): https://fvm.app/docs/getting_started/configuration/#android-studio

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the info, then we should add this to our setup documentation doc as well

"search.exclude": {
// Remove .fvm files from search
"**/.fvm": true
},
"files.watcherExclude": {
// Remove .fvm files from file watching
"**/.fvm": true
}
}