Skip to content

Commit

Permalink
🔥 Remove flutter as a submodule (#9307)
Browse files Browse the repository at this point in the history
_Description of what this PR is changing or adding, and why:_
The PR removes the `flutter` repo as a submodule to avoid conflicts when
building the website on different platforms. It was first introduced in
#1257 but with no explanation so we cannot track back what's the
purpose, but removing this should not cause difficulties in maintaining
the website.

### Additional info

- The build process is slower than the previous one because the checkout
step needs an extra 3~5 minutes, depending on the network condition. See
[now](https://github.com/flutter/website/actions/runs/5985413443/job/16237673762?pr=9307)
and
[previous](https://github.com/flutter/website/actions/runs/5983398408/job/16237673076?pr=9298)
checks.

_Issues fixed (partially) by this PR (if any):_
- #6201
- #6443
- #8272

## Presubmit checklist

- [x] This PR doesn’t contain automatically generated corrections
(Grammarly or similar).
- [x] This PR follows the [Google Developer Documentation Style
Guidelines](https://developers.google.com/style) — for example, it
doesn’t use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first person).
- [x] This PR uses [semantic line
breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks)
of 80 characters or fewer.

---------

Co-authored-by: Anthony Sansone <atsansone@users.noreply.github.com>
Co-authored-by: Parker Lougheed <parlough@gmail.com>
  • Loading branch information
3 people committed Sep 21, 2023
1 parent 91b85e4 commit c8a016d
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 32 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ CONTRIBUTING.md
docker-compose.yml
LICENSE
node_modules/
README.md
README.md
flutter/
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@

# Allow dart files in examples/ to be detectable
examples/**/*.dart -linguist-documentation

# Handles files and normalization
* text=auto
*.sh text eol=lf
*.bat text eol=crlf
*.dart text eol=lf
dart text eol=lf
flutter text eol=lf
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ _site
*.swp
build
node_modules
flutter/

# Dart and Flutter, build related
.dart_tool
Expand Down
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
path = site-shared
url = https://github.com/dart-lang/site-shared
branch = main
[submodule "flutter"]
path = flutter
url = https://github.com/flutter/flutter
branch = stable
[submodule "examples/codelabs"]
path = examples/codelabs
url = https://github.com/flutter/codelabs
17 changes: 2 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,16 @@ WORKDIR /app
# or run `git submodule update --init --recursive` after cloning.
FROM base AS flutter

# This Flutter install uses/requires the local ./flutter submodule
COPY ./flutter ./flutter
COPY ./site-shared ./site-shared
COPY pubspec.yaml ./

ARG FLUTTER_BUILD_BRANCH
ARG FLUTTER_BUILD_BRANCH=stable
ENV FLUTTER_BUILD_BRANCH=$FLUTTER_BUILD_BRANCH
ENV FLUTTER_ROOT=flutter
ENV FLUTTER_BIN=flutter/bin
ENV PATH="/app/flutter/bin:$PATH"

# Used if wanting to build the container with a different branch, this
# would change the current branch of and update the mirrored submodule
# e.g. `make build FLUTTER_BUILD_BRANCH=beta`
# This is not to be confused with the $FLUTTER_TEST_BRANCH
RUN if test -n "$FLUTTER_BUILD_BRANCH" -a "$FLUTTER_BUILD_BRANCH" != "stable" ; then \
cd flutter && \
git fetch && \
git remote set-branches origin "$FLUTTER_BUILD_BRANCH" && \
git fetch --depth 1 origin "$FLUTTER_BUILD_BRANCH" && \
git checkout "$FLUTTER_BUILD_BRANCH" -- && \
git pull; \
fi
RUN git clone --branch $FLUTTER_BUILD_BRANCH --single-branch https://github.com/flutter/flutter ./flutter

# Set up Flutter
# NOTE You will get a warning "Woah! You appear to be trying to run flutter as root."
Expand Down
14 changes: 3 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,8 @@ Install the following tools, if you don't have them already:
> The GitHub documentation has general help on
> [forking][] and [cloning][] repos.
If you are working in the Windows desktop environment,
make sure you have Git `autocrlf` set to `input`
**before** initializing the submodules.
This ensures that line endings are handled correctly
_before_ any Bash scripts are executed within the submodules.
See [issue 6201][] for details.

[cloning]: https://help.github.com/articles/cloning-a-repository
[forking]: https://docs.github.com/en/get-started/quickstart/fork-a-repo
[issue 6201]: https://github.com/flutter/website/issues/6201

If you're outside of the Flutter organization,
we recommend you **create a fork** of the repo under your own account,
Expand All @@ -127,7 +119,7 @@ _choose one_ of the following submodule-cloning techniques:
```

OR

- If you've already cloned the repo without its submodule,
then run this command from the repo root:<br>
```bash
Expand All @@ -148,7 +140,7 @@ _choose one_ of the following submodule-cloning techniques:
```bash
$ git checkout -b <BRANCH_NAME>
```
1. If the Docker Desktop application isn't already running,
start it. Look at its status icon:
if it has an exclamation point (`!`),
Expand Down Expand Up @@ -196,7 +188,7 @@ _choose one_ of the following submodule-cloning techniques:
```bash
$ make down
```
> **Tip:** To find additional commands, read the [`Makefile`][].
> For example, if you need to debug the Docker infrastructure,
> you can run `make debug`.
Expand Down
1 change: 0 additions & 1 deletion flutter
Submodule flutter deleted from 367f9e

0 comments on commit c8a016d

Please sign in to comment.