-
Notifications
You must be signed in to change notification settings - Fork 310
pin flutter SDK version via git submodule #579
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
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
81363a8
check: pin flutter version
chrisirhc b990e53
check: add flutter-main check
chrisirhc 03e305d
Update README.md
chrisirhc 093f5e5
Update README.md
chrisirhc 44f5d2f
Update tools/setup-vendor-flutter
chrisirhc 7a97c02
Update README.md
chrisirhc 6004882
run submmodule update in the script
chrisirhc e444099
fix git.sh comment
chrisirhc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# This file is used by direnv to setup the environment when entering | ||
# to use vendored flutter SDK. | ||
|
||
# Comment out the next line if you want to use your system flutter. | ||
PATH_add vendor/flutter/bin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# The `check-flutter-main` job serves 2 purposes: | ||
# 1. It checks that the code works with the flutter's latest main | ||
# channel. | ||
# 2. It checks that tools/check and our related scripts don't embed | ||
# any hidden assumptions that the Flutter SDK lives at vendor/flutter/. | ||
name: CI | ||
|
||
on: push | ||
|
||
jobs: | ||
check-flutter-main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Clone Flutter SDK | ||
# We can't do a depth-1 clone, because we need the most recent tag | ||
# so that Flutter knows its version and sees the constraint in our | ||
# pubspec is satisfied. It's uncommon for flutter/flutter to go | ||
# more than 100 commits between tags. Fetch 1000 for good measure. | ||
run: | | ||
git clone --depth=1000 https://github.com/flutter/flutter ~/flutter | ||
TZ=UTC git --git-dir ~/flutter/.git log -1 --format='%h | %ci | %s' --date=iso8601-local | ||
echo ~/flutter/bin >> "$GITHUB_PATH" | ||
|
||
- name: Download Flutter SDK artifacts (flutter precache) | ||
run: flutter precache --universal | ||
|
||
- name: Download our dependencies (flutter pub get) | ||
run: flutter pub get | ||
|
||
- name: Run tools/check | ||
run: TERM=dumb tools/check --all --verbose |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[submodule "vendor/flutter"] | ||
path = vendor/flutter | ||
url = https://github.com/flutter/flutter.git | ||
branch = main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env bash | ||
chrisirhc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
set -euo pipefail | ||
|
||
this_dir=${BASH_SOURCE[0]%/*} | ||
|
||
# shellcheck source=tools/lib/git.sh | ||
. "${this_dir}"/lib/git.sh | ||
|
||
divider_line='================================================================' | ||
|
||
# One-time setup to let git submodule + flutter SDK know that we're | ||
# using the main channel (main branch). | ||
# Otherwise, `flutter doctor` complains about being on a user branch. | ||
# We do a quick check that there's no changes. | ||
if ! submodule_is_clean "vendor/flutter" ; then | ||
echo "Initializing 'vendor/flutter' submodule:" | ||
echo "${divider_line}" | ||
if ! git submodule update --init ; then | ||
echo "${divider_line}" | ||
echo >&2 "Failed to initialize the 'vendor/flutter' submodule, please resolve the issues indicated above then run this script again." | ||
exit 1 | ||
else | ||
echo "${divider_line}" | ||
fi | ||
fi | ||
# Check if current branch is main, if not, switch to main | ||
if [[ $(git -C vendor/flutter branch --show-current) == "main" ]]; then | ||
exit 0 | ||
fi | ||
git -C vendor/flutter checkout -B main HEAD | ||
chrisirhc marked this conversation as resolved.
Show resolved
Hide resolved
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.