From 4da003553853fefc5f6790431159990f9a9d7185 Mon Sep 17 00:00:00 2001 From: guidezpl <6655696+guidezpl@users.noreply.github.com> Date: Tue, 26 Apr 2022 14:25:03 +0200 Subject: [PATCH 01/13] use automatic release notes --- .../release_draft_github_release.yml | 40 ++++--------------- 1 file changed, 8 insertions(+), 32 deletions(-) diff --git a/.github/workflows/release_draft_github_release.yml b/.github/workflows/release_draft_github_release.yml index c591f9554..10431c49e 100644 --- a/.github/workflows/release_draft_github_release.yml +++ b/.github/workflows/release_draft_github_release.yml @@ -2,56 +2,32 @@ name: Draft Github Release on: # Enable manual run workflow_dispatch: + inputs: + environment: + description: "Tag to create (e.g. v2.9.2). Must match pubspec." + required: true + default: "v." # Refs/tags push events to matching v*, i.e. v1.0, v20.15.10 push: tags: - "v*" jobs: - generate-changelog: - name: Generate changelog - runs-on: ubuntu-latest - steps: - - name: Get latest published release tag - id: get_latest_release - uses: pozetroninc/github-action-get-latest-release@2b51d48e904071035d6632715d41966f516711dd - with: - repository: ${{ github.repository }} - excludes: prerelease, draft - - name: Generate changelog since last published release - uses: charmixer/auto-changelog-action@5c6320ae4dedc8743e4439a3c56294c294553fb9 - with: - token: ${{ secrets.FLUTTERGALLERYRELEASEBOT_TOKEN }} - future_release: ${{ github.ref }} - since_tag: ${{ steps.get_latest_release.outputs.release }} - - name: Upload changelog - uses: actions/upload-artifact@v2 - with: - name: changelog - path: CHANGELOG.md - draft-release: name: Draft Github release - needs: generate-changelog runs-on: ubuntu-20.04 outputs: upload_url: ${{ steps.create_release.outputs.upload_url }} steps: - - name: Download changelog - uses: actions/download-artifact@v2 - with: - name: changelog - - name: Draft release with changelog + - name: Draft release with release notes id: create_release - uses: actions/create-release@v1 + uses: softprops/action-gh-release@v0.1.14 env: GITHUB_TOKEN: ${{ secrets.FLUTTERGALLERYRELEASEBOT_TOKEN }} with: - tag_name: ${{ github.ref }} - release_name: Flutter Gallery ${{ github.ref }} - body_path: CHANGELOG.md draft: true prerelease: false + generate_release_notes: true create-build: name: Create ${{ matrix.target }} build From b8578b884d6d0c57be91627c0bef39f4b1c2be37 Mon Sep 17 00:00:00 2001 From: guidezpl <6655696+guidezpl@users.noreply.github.com> Date: Tue, 26 Apr 2022 14:34:12 +0200 Subject: [PATCH 02/13] remove tags as trigger --- .github/workflows/release_deploy_play_store.yml | 8 ++++---- .github/workflows/release_deploy_web.yml | 8 ++++---- .github/workflows/release_draft_github_release.yml | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release_deploy_play_store.yml b/.github/workflows/release_deploy_play_store.yml index 37a25804d..bec4b6979 100644 --- a/.github/workflows/release_deploy_play_store.yml +++ b/.github/workflows/release_deploy_play_store.yml @@ -7,10 +7,10 @@ on: description: "Fastlane lane to use (beta OR promote_to_production OR production)" required: true default: "beta" - # Refs/tags push events to matching v*, i.e. v1.0, v20.15.10 - push: - tags: - - "v*" + # # Refs/tags push events to matching v*, i.e. v1.0, v20.15.10 + # push: + # tags: + # - "v*" jobs: fastlane-deploy: diff --git a/.github/workflows/release_deploy_web.yml b/.github/workflows/release_deploy_web.yml index b9b361f31..81d0f08a6 100644 --- a/.github/workflows/release_deploy_web.yml +++ b/.github/workflows/release_deploy_web.yml @@ -7,10 +7,10 @@ on: description: "Environment to deploy to (staging OR prod)" required: true default: "staging" - # Refs/tags push events to matching v*, i.e. v1.0, v20.15.10 - push: - tags: - - "v*" + # # Refs/tags push events to matching v*, i.e. v1.0, v20.15.10 + # push: + # tags: + # - "v*" jobs: build-and-deploy: diff --git a/.github/workflows/release_draft_github_release.yml b/.github/workflows/release_draft_github_release.yml index 10431c49e..eef973acf 100644 --- a/.github/workflows/release_draft_github_release.yml +++ b/.github/workflows/release_draft_github_release.yml @@ -6,11 +6,11 @@ on: environment: description: "Tag to create (e.g. v2.9.2). Must match pubspec." required: true - default: "v." - # Refs/tags push events to matching v*, i.e. v1.0, v20.15.10 - push: - tags: - - "v*" + default: "v.2.9.3" + # # Refs/tags push events to matching v*, i.e. v1.0, v20.15.10 + # push: + # tags: + # - "v*" jobs: draft-release: From 79de431dd1336b0b3f7e75404c6b8d0b12163d27 Mon Sep 17 00:00:00 2001 From: guidezpl <6655696+guidezpl@users.noreply.github.com> Date: Tue, 17 May 2022 21:28:08 +0200 Subject: [PATCH 03/13] Update release_draft_github_release.yml --- .github/workflows/release_draft_github_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_draft_github_release.yml b/.github/workflows/release_draft_github_release.yml index eef973acf..5846df52c 100644 --- a/.github/workflows/release_draft_github_release.yml +++ b/.github/workflows/release_draft_github_release.yml @@ -21,7 +21,7 @@ jobs: steps: - name: Draft release with release notes id: create_release - uses: softprops/action-gh-release@v0.1.14 + uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 env: GITHUB_TOKEN: ${{ secrets.FLUTTERGALLERYRELEASEBOT_TOKEN }} with: From d84c7ad49298c48429b5d4fedf851744a28607f1 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Guidez Date: Mon, 30 May 2022 13:08:48 +0200 Subject: [PATCH 04/13] specify tag name --- .github/workflows/release_draft_github_release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release_draft_github_release.yml b/.github/workflows/release_draft_github_release.yml index 242d65ab3..1fdc71a11 100644 --- a/.github/workflows/release_draft_github_release.yml +++ b/.github/workflows/release_draft_github_release.yml @@ -6,7 +6,7 @@ on: environment: description: "Tag to create (e.g. v2.9.2). Must match pubspec." required: true - default: "v.2.9.3" + default: "v2.9.3" # # Refs/tags push events to matching v*, i.e. v1.0, v20.15.10 # push: # tags: @@ -28,6 +28,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.FLUTTERGALLERYRELEASEBOT_TOKEN }} with: + tag_name: v2.9.3 draft: true prerelease: false generate_release_notes: true From d5038e13b86e3eb011f959dbdacc40c36fc13424 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Guidez Date: Mon, 30 May 2022 15:41:20 +0200 Subject: [PATCH 05/13] x --- .../workflows/release_draft_github_release.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release_draft_github_release.yml b/.github/workflows/release_draft_github_release.yml index 1fdc71a11..7703d34f0 100644 --- a/.github/workflows/release_draft_github_release.yml +++ b/.github/workflows/release_draft_github_release.yml @@ -3,14 +3,14 @@ on: # Enable manual run workflow_dispatch: inputs: - environment: - description: "Tag to create (e.g. v2.9.2). Must match pubspec." - required: true - default: "v2.9.3" - # # Refs/tags push events to matching v*, i.e. v1.0, v20.15.10 - # push: - # tags: - # - "v*" + version: + description: "Tag to create (e.g. v2.10.0). Must match pubspec." + required: true + type: string + environment: + description: "Environment to run tests against" + type: environment + required: true # Declare default permissions as read only. permissions: read-all @@ -28,7 +28,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.FLUTTERGALLERYRELEASEBOT_TOKEN }} with: - tag_name: v2.9.3 + tag_name: ${{ github.event.inputs.version }} draft: true prerelease: false generate_release_notes: true From da9b39b6f751b7183116e0b01fce6c220d47f34f Mon Sep 17 00:00:00 2001 From: Pierre-Louis Guidez Date: Mon, 30 May 2022 15:44:07 +0200 Subject: [PATCH 06/13] x --- .github/workflows/release_deploy_play_store.yml | 9 +++++---- .github/workflows/release_deploy_web.yml | 11 +++++------ .github/workflows/release_draft_github_release.yml | 6 +----- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release_deploy_play_store.yml b/.github/workflows/release_deploy_play_store.yml index 13598e3cd..383190e18 100644 --- a/.github/workflows/release_deploy_play_store.yml +++ b/.github/workflows/release_deploy_play_store.yml @@ -7,10 +7,11 @@ on: description: "Fastlane lane to use (beta OR promote_to_production OR production)" required: true default: "beta" - # # Refs/tags push events to matching v*, i.e. v1.0, v20.15.10 - # push: - # tags: - # - "v*" + type: choice + options: + - beta + - promote_to_production + - production # Declare default permissions as read only. permissions: read-all diff --git a/.github/workflows/release_deploy_web.yml b/.github/workflows/release_deploy_web.yml index fc50aca33..8969c803c 100644 --- a/.github/workflows/release_deploy_web.yml +++ b/.github/workflows/release_deploy_web.yml @@ -4,13 +4,12 @@ on: workflow_dispatch: inputs: environment: - description: "Environment to deploy to (staging OR prod)" - required: true + description: "Environment to deploy web build" default: "staging" - # # Refs/tags push events to matching v*, i.e. v1.0, v20.15.10 - # push: - # tags: - # - "v*" + type: choice + options: + - staging + - prod # Declare default permissions as read only. permissions: read-all diff --git a/.github/workflows/release_draft_github_release.yml b/.github/workflows/release_draft_github_release.yml index 7703d34f0..177227bcf 100644 --- a/.github/workflows/release_draft_github_release.yml +++ b/.github/workflows/release_draft_github_release.yml @@ -4,13 +4,9 @@ on: workflow_dispatch: inputs: version: - description: "Tag to create (e.g. v2.10.0). Must match pubspec." + description: "Tag to create (e.g. v2.10.0). Must include 'v' and must match pubspec." required: true type: string - environment: - description: "Environment to run tests against" - type: environment - required: true # Declare default permissions as read only. permissions: read-all From 07f40d0d73d30e6c24e91e689c1955a0d88e228b Mon Sep 17 00:00:00 2001 From: Pierre-Louis Guidez Date: Mon, 30 May 2022 15:45:16 +0200 Subject: [PATCH 07/13] x --- .github/workflows/release_deploy_play_store.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_deploy_play_store.yml b/.github/workflows/release_deploy_play_store.yml index 383190e18..46be0efaf 100644 --- a/.github/workflows/release_deploy_play_store.yml +++ b/.github/workflows/release_deploy_play_store.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: lane: - description: "Fastlane lane to use (beta OR promote_to_production OR production)" + description: "Fastlane lane" required: true default: "beta" type: choice From 27de9928de3fea48cc042a1deb9cf1ed712b942f Mon Sep 17 00:00:00 2001 From: Pierre-Louis Guidez Date: Mon, 30 May 2022 16:16:37 +0200 Subject: [PATCH 08/13] x --- .../release_draft_github_release.yml | 2 +- README.md | 88 ++++++++++--------- .../android/en-US/changelogs/default.txt | 2 +- 3 files changed, 47 insertions(+), 45 deletions(-) diff --git a/.github/workflows/release_draft_github_release.yml b/.github/workflows/release_draft_github_release.yml index 177227bcf..a5356ebea 100644 --- a/.github/workflows/release_draft_github_release.yml +++ b/.github/workflows/release_draft_github_release.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: version: - description: "Tag to create (e.g. v2.10.0). Must include 'v' and must match pubspec." + description: "Tag to create (e.g. v2.10.0). Must include 'v' and must match pubspec" required: true type: string diff --git a/README.md b/README.md index a2e7245d5..2c3da89b0 100644 --- a/README.md +++ b/README.md @@ -8,28 +8,8 @@ wild. ![Flutter Gallery](https://user-images.githubusercontent.com/6655696/73928238-0d7fcc80-48d3-11ea-8a7e-ea7dc5d6e713.png) -## Running Flutter Gallery on Flutter's master channel - -The Flutter Gallery targets Flutter's master channel. As such, it can take advantage -of new SDK features that haven't landed in the stable channel. - -If you'd like to run the Flutter Gallery, make sure to switch to the master channel -first: - -```bash -flutter channel master -flutter upgrade -``` - -When you're done, use this command to return to the safety of the stable -channel: - -```bash -flutter channel stable -flutter upgrade -``` - ## Features + - Showcase for `material`, `cupertino`, and other widgets - [Adpative layout](lib/layout/adaptive.dart) for mobile and desktop - State restoration support @@ -52,6 +32,8 @@ These include: - Linux ([.tar.gz][latest release]) - Windows ([.zip][latest release]) +## Running + One can run the gallery locally for any of these platforms. For desktop platforms, please see the [Flutter docs](https://docs.flutter.dev/desktop) for the latest requirements. @@ -62,6 +44,32 @@ flutter pub get flutter run ``` +
+Troubleshooting + +### Flutter `master` channel + +The Flutter Gallery targets Flutter's `master` channel. As such, it can take advantage +of new SDK features that haven't landed in the stable channel. + +If you'd like to run the Flutter Gallery, you may have to switch to the `master` channel +first: + +```bash +flutter channel master +flutter upgrade +``` + +When you're done, use this command to return to the safety of the `stable` +channel: + +```bash +flutter channel stable +flutter upgrade +``` + +
+ ## Development
@@ -113,35 +121,29 @@ more details.
-## Creating a new release (for Flutter org members) +## Releasing -1. **Version bump**: Bump the `pubspec.yaml` version number. This can be in a PR making a change or a separate PR. - Use [semantic versioning](https://semver.org/) to determine - which part to increment. The version number after the `+` should also be incremented. For example `1.2.3+010203` - with a patch should become `1.2.4+010204`. +
+ for flutter-hackers members -2. **Staging**: After the version bump PR is merged, push a new version tag to main. +The process is largely automated and easy to set in motion. -```bash -git pull upstream main -git tag v1.2.4 # note the v -git push upstream v1.2.4 -``` +First things first, bump the `pubspec.yaml` version number. This can be in a PR making a change or a separate PR. +Use [semantic versioning](https://semver.org/) to determine +which part to increment. The version number after the `+` should also be incremented. For example `1.2.3+010203` +with a patch should become `1.2.4+010204`. -This will trigger a set of GitHub Actions [workflows](https://github.com/flutter/gallery/tree/main/.github/workflows) that will: +Then, use the following workflows. It is strongly recommended to run a workflow using the staging/beta environment before deploying to production. -- Draft a [GitHub release](<(https://github.com/flutter/gallery/releases)>) with automatically generated release notes and packaged builds (.apk, macOS, Windows, and Linux) -- Deploy the gallery to the Firebase hosted [staging site](https://gallery-staging-flutter-dev.web.app/) -- Deploy a new Android build to the Play Store [beta track](https://play.google.com/apps/testing/io.flutter.demo.gallery) +- [Deploy to Play Store](https://github.com/flutter/gallery/actions/workflows/release_deploy_play_store.yml): Uses Fastlane to create a [beta](https://play.google.com/console/u/0/developers/7661132837216938445/app/4974617875198505129/tracks/open-testing) (freely available on the [Play Store](https://play.google.com/apps/testing/io.flutter.demo.gallery)), promote an existing beta to production, or publish straight to [production](https://play.google.com/console/u/0/developers/7661132837216938445/app/4974617875198505129/tracks/production) ([Play Store](https://play.google.com/store/apps/details?id=io.flutter.demo.gallery)). + > **Note** + > Once an .aab is released with a particular version number, it can't be replaced. The version number must be incremented again. +- [Deploy to web](https://github.com/flutter/gallery/actions/workflows/release_deploy_web.yml): Deploys a web build to the Firebase-hosted [staging](https://gallery-flutter-staging.web.app) or [production](https://gallery.flutter.dev) site. +- [Draft GitHub release](https://github.com/flutter/gallery/actions/workflows/release_draft_github_release.yml): Drafts a GitHub release, including automatically generated release notes and packaged builds for Android, macOS, Linux, and Windows. Upon being published, the specified version tag will be created. -Note: all GitHub Action workflows can also be [run manually](https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow) +For posterity, information about doing these things locally is available at [go/flutter-gallery-manual-deployment](http://go/flutter-gallery-manual-deployment). -3. **Production**: Once satisfied, - - Publish the drafted [GitHub release](https://github.com/flutter/gallery/releases) (`Edit draft` -> `Publish release`). - - Deploy the gallery to the Firebase hosted [production site](https://gallery.flutter.dev) by running [this workflow](https://github.com/flutter/gallery/actions/workflows/deploy_web.yml) with `prod` using GitHub's UI. - - Promote the Play Store beta to production by running [this workflow](https://github.com/flutter/gallery/actions/workflows/deploy_play_store.yml) with `promote_to_production` using GitHub's UI. - -More information about doing these things locally is available at [go/flutter-gallery-manual-deployment](http://go/flutter-gallery-manual-deployment). +
## Tests diff --git a/android/fastlane/metadata/android/en-US/changelogs/default.txt b/android/fastlane/metadata/android/en-US/changelogs/default.txt index c5c1fdfd8..04ca3dac1 100644 --- a/android/fastlane/metadata/android/en-US/changelogs/default.txt +++ b/android/fastlane/metadata/android/en-US/changelogs/default.txt @@ -1,3 +1,3 @@ We made improvements and squashed bugs. -The complete list of changes is available at https://github.com/flutter/gallery/releases +The complete list of contributions is available at https://github.com/flutter/gallery/releases. From 5cc11495910d3574b0b6e11c3d754a4d02215090 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Guidez Date: Mon, 30 May 2022 16:25:09 +0200 Subject: [PATCH 09/13] x --- README.md | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 2c3da89b0..3902080d8 100644 --- a/README.md +++ b/README.md @@ -72,24 +72,6 @@ flutter upgrade ## Development -
- Including a new splash animation - -1. Convert your animation to a `.gif` file. - Ideally, use a background color of `0xFF030303` to ensure the animation - blends into the background of the app. - -2. Add your new `.gif` file to the assets directory under - `assets/splash_effects`. Ensure the name follows the format - `splash_effect_$num.gif`. The number should be the next number after the - current largest number in the repository. - -3. Update the map `_effectDurations` in -[splash.dart](lib/pages/splash.dart) to include the number of the -new `.gif` as well as its estimated duration. The duration is used to -determine how long to display the splash animation at launch. -
-
Generating localizations @@ -121,6 +103,24 @@ more details.
+
+ Including a new splash animation + +1. Convert your animation to a `.gif` file. + Ideally, use a background color of `0xFF030303` to ensure the animation + blends into the background of the app. + +2. Add your new `.gif` file to the assets directory under + `assets/splash_effects`. Ensure the name follows the format + `splash_effect_$num.gif`. The number should be the next number after the + current largest number in the repository. + +3. Update the map `_effectDurations` in +[splash.dart](lib/pages/splash.dart) to include the number of the +new `.gif` as well as its estimated duration. The duration is used to +determine how long to display the splash animation at launch. +
+ ## Releasing
@@ -133,13 +133,15 @@ Use [semantic versioning](https://semver.org/) to determine which part to increment. The version number after the `+` should also be incremented. For example `1.2.3+010203` with a patch should become `1.2.4+010204`. -Then, use the following workflows. It is strongly recommended to run a workflow using the staging/beta environment before deploying to production. +Then, use the following workflows. It is strongly recommended to use the staging/beta environments when available, before deploying to production. - [Deploy to Play Store](https://github.com/flutter/gallery/actions/workflows/release_deploy_play_store.yml): Uses Fastlane to create a [beta](https://play.google.com/console/u/0/developers/7661132837216938445/app/4974617875198505129/tracks/open-testing) (freely available on the [Play Store](https://play.google.com/apps/testing/io.flutter.demo.gallery)), promote an existing beta to production, or publish straight to [production](https://play.google.com/console/u/0/developers/7661132837216938445/app/4974617875198505129/tracks/production) ([Play Store](https://play.google.com/store/apps/details?id=io.flutter.demo.gallery)). > **Note** > Once an .aab is released with a particular version number, it can't be replaced. The version number must be incremented again. - [Deploy to web](https://github.com/flutter/gallery/actions/workflows/release_deploy_web.yml): Deploys a web build to the Firebase-hosted [staging](https://gallery-flutter-staging.web.app) or [production](https://gallery.flutter.dev) site. -- [Draft GitHub release](https://github.com/flutter/gallery/actions/workflows/release_draft_github_release.yml): Drafts a GitHub release, including automatically generated release notes and packaged builds for Android, macOS, Linux, and Windows. Upon being published, the specified version tag will be created. +- [Draft GitHub release](https://github.com/flutter/gallery/actions/workflows/release_draft_github_release.yml): Drafts a GitHub release, including automatically generated release notes and packaged builds for Android, macOS, Linux, and Windows. + > **Note** + > The release draft is private until published. Upon being published, the specified version tag will be created. For posterity, information about doing these things locally is available at [go/flutter-gallery-manual-deployment](http://go/flutter-gallery-manual-deployment). @@ -147,7 +149,9 @@ For posterity, information about doing these things locally is available at [go/ ## Tests -The gallery has its own set of unit and integration tests. Flutter itself also uses it in tests. To enable breaking changes, the gallery version is pinned in two places: +The gallery has its own set of unit, golden, and integration tests. + +In addition, Flutter itself uses the gallery in tests. To enable breaking changes, the gallery version is pinned in two places: - `flutter analyze`: https://github.com/flutter/tests/blob/master/registry/flutter_gallery.test - DeviceLab tests: https://github.com/flutter/flutter/blob/master/dev/devicelab/lib/versions/gallery.dart From 135090c307de9f12779269e94eff825243adb2ef Mon Sep 17 00:00:00 2001 From: Pierre-Louis Guidez Date: Mon, 30 May 2022 16:28:34 +0200 Subject: [PATCH 10/13] x --- .github/workflows/release_deploy_web.yml | 1 + .github/workflows/release_draft_github_release.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/release_deploy_web.yml b/.github/workflows/release_deploy_web.yml index 8969c803c..fe3837bed 100644 --- a/.github/workflows/release_deploy_web.yml +++ b/.github/workflows/release_deploy_web.yml @@ -5,6 +5,7 @@ on: inputs: environment: description: "Environment to deploy web build" + required: true default: "staging" type: choice options: diff --git a/.github/workflows/release_draft_github_release.yml b/.github/workflows/release_draft_github_release.yml index a5356ebea..391cfcd88 100644 --- a/.github/workflows/release_draft_github_release.yml +++ b/.github/workflows/release_draft_github_release.yml @@ -6,6 +6,7 @@ on: version: description: "Tag to create (e.g. v2.10.0). Must include 'v' and must match pubspec" required: true + default: "v2.10.0" type: string # Declare default permissions as read only. From 81364b1fa3ce5c9f6de13dd003abf46074e827fa Mon Sep 17 00:00:00 2001 From: Pierre-Louis Guidez Date: Mon, 30 May 2022 17:13:27 +0200 Subject: [PATCH 11/13] =?UTF-8?q?gallery=20=E2=87=92=20Flutter=20Gallery?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- linux/my_application.cc | 4 ++-- windows/CMakeLists.txt | 2 +- windows/runner/Runner.rc | 6 +++--- windows/runner/main.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/linux/my_application.cc b/linux/my_application.cc index 30c8ff82a..5ee50e6a8 100644 --- a/linux/my_application.cc +++ b/linux/my_application.cc @@ -40,12 +40,12 @@ static void my_application_activate(GApplication* application) { if (use_header_bar) { GtkHeaderBar *header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); gtk_widget_show(GTK_WIDGET(header_bar)); - gtk_header_bar_set_title(header_bar, "gallery"); + gtk_header_bar_set_title(header_bar, "Flutter Gallery"); gtk_header_bar_set_show_close_button(header_bar, TRUE); gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); } else { - gtk_window_set_title(window, "gallery"); + gtk_window_set_title(window, "Flutter Gallery"); } gtk_window_set_default_size(window, 1280, 720); diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index cc31d66bd..f9d6edae2 100644 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.15) project(gallery LANGUAGES CXX) -set(BINARY_NAME "gallery") +set(BINARY_NAME "Flutter Gallery") cmake_policy(SET CMP0063 NEW) diff --git a/windows/runner/Runner.rc b/windows/runner/Runner.rc index f47930078..ef8d4d37f 100644 --- a/windows/runner/Runner.rc +++ b/windows/runner/Runner.rc @@ -92,10 +92,10 @@ BEGIN VALUE "CompanyName", "io.flutter.demo" "\0" VALUE "FileDescription", "A new Flutter project." "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" - VALUE "InternalName", "gallery" "\0" + VALUE "InternalName", "Flutter Gallery" "\0" VALUE "LegalCopyright", "Copyright (C) 2021 io.flutter.demo. All rights reserved." "\0" - VALUE "OriginalFilename", "gallery.exe" "\0" - VALUE "ProductName", "gallery" "\0" + VALUE "OriginalFilename", "Flutter Gallery.exe" "\0" + VALUE "ProductName", "Flutter Gallery" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" END END diff --git a/windows/runner/main.cpp b/windows/runner/main.cpp index 595cb4077..e51c875de 100644 --- a/windows/runner/main.cpp +++ b/windows/runner/main.cpp @@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(10, 10); Win32Window::Size size(1280, 720); - if (!window.CreateAndShow(L"gallery", origin, size)) { + if (!window.CreateAndShow(L"Flutter Gallery", origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true); From fe0a6e04f024c4674be2b02e9ce1a85023c93272 Mon Sep 17 00:00:00 2001 From: guidezpl <6655696+guidezpl@users.noreply.github.com> Date: Mon, 30 May 2022 17:22:06 +0200 Subject: [PATCH 12/13] regen windows --- .metadata | 24 ++++++++++++++++++++++-- windows/CMakeLists.txt | 24 +++++++++++++++--------- windows/flutter/CMakeLists.txt | 3 ++- windows/runner/CMakeLists.txt | 17 ++++++++++++++++- windows/runner/Runner.rc | 10 +++++----- windows/runner/utils.cpp | 6 +++--- 6 files changed, 63 insertions(+), 21 deletions(-) diff --git a/.metadata b/.metadata index 9ce83ab05..3f4a94d43 100644 --- a/.metadata +++ b/.metadata @@ -1,10 +1,30 @@ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # -# This file should be version controlled and should not be manually edited. +# This file should be version controlled. version: - revision: f5733f7a62ebc7c2ba324a2b410cd81215956b7d + revision: 2aa348b9407e96ffe4eca8e8f213c7984afad3f7 channel: master project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 2aa348b9407e96ffe4eca8e8f213c7984afad3f7 + base_revision: 2aa348b9407e96ffe4eca8e8f213c7984afad3f7 + - platform: windows + create_revision: 2aa348b9407e96ffe4eca8e8f213c7984afad3f7 + base_revision: 2aa348b9407e96ffe4eca8e8f213c7984afad3f7 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index f9d6edae2..c10317280 100644 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -1,13 +1,16 @@ -cmake_minimum_required(VERSION 3.15) +# Project-level configuration. +cmake_minimum_required(VERSION 3.14) project(gallery LANGUAGES CXX) -set(BINARY_NAME "Flutter Gallery") +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "gallery") +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. cmake_policy(SET CMP0063 NEW) -set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") - -# Configure build options. +# Define build configuration option. get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(IS_MULTICONFIG) set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" @@ -20,7 +23,7 @@ else() "Debug" "Profile" "Release") endif() endif() - +# Define settings for the Profile build mode. set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") @@ -30,6 +33,10 @@ set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") add_definitions(-DUNICODE -D_UNICODE) # Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. function(APPLY_STANDARD_SETTINGS TARGET) target_compile_features(${TARGET} PUBLIC cxx_std_17) target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") @@ -38,12 +45,11 @@ function(APPLY_STANDARD_SETTINGS TARGET) target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") endfunction() -set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") - # Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") add_subdirectory(${FLUTTER_MANAGED_DIR}) -# Application build +# Application build; see runner/CMakeLists.txt. add_subdirectory("runner") # Generated plugin build rules, which manage building the plugins and adding diff --git a/windows/flutter/CMakeLists.txt b/windows/flutter/CMakeLists.txt index b02c5485c..930d2071a 100644 --- a/windows/flutter/CMakeLists.txt +++ b/windows/flutter/CMakeLists.txt @@ -1,4 +1,5 @@ -cmake_minimum_required(VERSION 3.15) +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.14) set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") diff --git a/windows/runner/CMakeLists.txt b/windows/runner/CMakeLists.txt index 0b899a0bc..b9e550fba 100644 --- a/windows/runner/CMakeLists.txt +++ b/windows/runner/CMakeLists.txt @@ -1,6 +1,11 @@ -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.14) project(runner LANGUAGES CXX) +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. add_executable(${BINARY_NAME} WIN32 "flutter_window.cpp" "main.cpp" @@ -10,8 +15,18 @@ add_executable(${BINARY_NAME} WIN32 "Runner.rc" "runner.exe.manifest" ) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. apply_standard_settings(${BINARY_NAME}) + +# Disable Windows macros that collide with C++ standard library functions. target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") + +# Add dependency libraries and include directories. Add any application-specific +# dependencies here. target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") + +# Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/windows/runner/Runner.rc b/windows/runner/Runner.rc index ef8d4d37f..b0bb38280 100644 --- a/windows/runner/Runner.rc +++ b/windows/runner/Runner.rc @@ -90,12 +90,12 @@ BEGIN BLOCK "040904e4" BEGIN VALUE "CompanyName", "io.flutter.demo" "\0" - VALUE "FileDescription", "A new Flutter project." "\0" + VALUE "FileDescription", "gallery" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" - VALUE "InternalName", "Flutter Gallery" "\0" - VALUE "LegalCopyright", "Copyright (C) 2021 io.flutter.demo. All rights reserved." "\0" - VALUE "OriginalFilename", "Flutter Gallery.exe" "\0" - VALUE "ProductName", "Flutter Gallery" "\0" + VALUE "InternalName", "gallery" "\0" + VALUE "LegalCopyright", "Copyright (C) 2022 io.flutter.demo. All rights reserved." "\0" + VALUE "OriginalFilename", "gallery.exe" "\0" + VALUE "ProductName", "gallery" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" END END diff --git a/windows/runner/utils.cpp b/windows/runner/utils.cpp index d19bdbbcc..f5bf9fa0f 100644 --- a/windows/runner/utils.cpp +++ b/windows/runner/utils.cpp @@ -48,10 +48,10 @@ std::string Utf8FromUtf16(const wchar_t* utf16_string) { int target_length = ::WideCharToMultiByte( CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, -1, nullptr, 0, nullptr, nullptr); - if (target_length == 0) { - return std::string(); - } std::string utf8_string; + if (target_length == 0 || target_length > utf8_string.max_size()) { + return utf8_string; + } utf8_string.resize(target_length); int converted_length = ::WideCharToMultiByte( CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, From a470f80987ac8b88254c751a62e64e5ae2d947b3 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Guidez Date: Mon, 30 May 2022 17:34:04 +0200 Subject: [PATCH 13/13] Update release_draft_github_release.yml --- .github/workflows/release_draft_github_release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release_draft_github_release.yml b/.github/workflows/release_draft_github_release.yml index 391cfcd88..9d2c31cf1 100644 --- a/.github/workflows/release_draft_github_release.yml +++ b/.github/workflows/release_draft_github_release.yml @@ -148,3 +148,4 @@ jobs: asset_path: ./flutter_gallery_${{ matrix.target }}${{ matrix.asset_extension }} asset_name: flutter_gallery_${{ matrix.target }}${{ matrix.asset_extension }} asset_content_type: ${{ matrix.asset_content_type }} + overwrite: true