From 34a038baf38e637004559d768af451b170f6c00f Mon Sep 17 00:00:00 2001 From: Alex Li Date: Sun, 17 Sep 2023 04:42:08 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20Remove=20`flutter`=20as=20a=20su?= =?UTF-8?q?bmodule=20(#9307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _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):_ - https://github.com/flutter/website/issues/6201 - https://github.com/flutter/website/issues/6443 - https://github.com/flutter/website/issues/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 Co-authored-by: Parker Lougheed --- .dockerignore | 3 ++- .gitattributes | 8 ++++++++ .gitignore | 1 + .gitmodules | 4 ---- Dockerfile | 17 ++--------------- README.md | 14 +++----------- flutter | 1 - 7 files changed, 16 insertions(+), 32 deletions(-) delete mode 160000 flutter diff --git a/.dockerignore b/.dockerignore index cbc4bf9b9e..ac1848431c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,4 +5,5 @@ CONTRIBUTING.md docker-compose.yml LICENSE node_modules/ -README.md \ No newline at end of file +README.md +flutter/ diff --git a/.gitattributes b/.gitattributes index 6c1cce5559..6dc8a437fa 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/.gitignore b/.gitignore index 27d9aef0b2..494fd9bee4 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ _site *.swp build node_modules +flutter/ # Dart and Flutter, build related .dart_tool diff --git a/.gitmodules b/.gitmodules index 55a93572cb..0aac8b8cc9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/Dockerfile b/Dockerfile index 946dd63750..138bee52c2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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." diff --git a/README.md b/README.md index 555049e1d3..a6552c2438 100644 --- a/README.md +++ b/README.md @@ -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, @@ -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:
```bash @@ -148,7 +140,7 @@ _choose one_ of the following submodule-cloning techniques: ```bash $ git checkout -b ``` - + 1. If the Docker Desktop application isn't already running, start it. Look at its status icon: if it has an exclamation point (`!`), @@ -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`. diff --git a/flutter b/flutter deleted file mode 160000 index 367f9ea16b..0000000000 --- a/flutter +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 367f9ea16bfae1ca451b9cc27c1366870b187ae2