From 2d11b6a362e1c0e9c97c8f2ea1c7377490c30dc0 Mon Sep 17 00:00:00 2001 From: Gray Mackall <34871572+gmackall@users.noreply.github.com> Date: Tue, 28 Jan 2025 18:04:50 -0800 Subject: [PATCH] Add instructions to download the Gradle wrapper to FGP readme, and add to gitignore (#162332) Fixes https://github.com/flutter/flutter/issues/161480. Ended up going with just providing instructions instead of checking in the binary, as the instructions is just one line. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md Co-authored-by: Gray Mackall --- dev/bots/analyze.dart | 4 ++-- packages/flutter_tools/gradle/.gitignore | 3 +++ packages/flutter_tools/gradle/README.md | 6 +++++- 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 packages/flutter_tools/gradle/.gitignore diff --git a/dev/bots/analyze.dart b/dev/bots/analyze.dart index 6700bc7da96..99c4b78cf22 100644 --- a/dev/bots/analyze.dart +++ b/dev/bots/analyze.dart @@ -1742,7 +1742,7 @@ class Hash256 { // We have a policy of not checking in binaries into this repository. // If you are adding/changing template images, use the flutter_template_images // package and a .img.tmpl placeholder instead. -// If you have other binaries to add, please consult Hixie for advice. +// If you have other binaries to add, please consult johnmccutchan for advice. final Set _legacyBinaries = { // DEFAULT ICON IMAGES @@ -2099,7 +2099,7 @@ Future verifyNoBinaries(String workingDirectory, {Set? legacyBina // We have a policy of not checking in binaries into this repository. // If you are adding/changing template images, use the flutter_template_images // package and a .img.tmpl placeholder instead. - // If you have other binaries to add, please consult Hixie for advice. + // If you have other binaries to add, please consult johnmccutchan for advice. assert( _legacyBinaries .expand((Hash256 hash) => [hash.a, hash.b, hash.c, hash.d]) diff --git a/packages/flutter_tools/gradle/.gitignore b/packages/flutter_tools/gradle/.gitignore new file mode 100644 index 00000000000..34398b632e2 --- /dev/null +++ b/packages/flutter_tools/gradle/.gitignore @@ -0,0 +1,3 @@ +gradlew +gradlew.bat +gradle/** diff --git a/packages/flutter_tools/gradle/README.md b/packages/flutter_tools/gradle/README.md index c36e148742f..bcf71abdee8 100644 --- a/packages/flutter_tools/gradle/README.md +++ b/packages/flutter_tools/gradle/README.md @@ -18,7 +18,11 @@ new contributions will only be accepted in `src/main/kotlin` (and `src/test/kotl ### Testing -Tests can be run in Android Studio, or directly with Gradle: `./gradle test` +To run the tests from the CLI, you first need to download the Gradle wrapper. +1. Ensure you have run gclient sync recently (i.e., from the root of your framework checkout, run `gclient sync -D`). +2. From this directory, run `../../../engine/src/flutter/third_party/gradle/bin/gradle wrapper`. + +Tests can be run in Android Studio, or directly with Gradle: `./gradlew test` (note that this directory does not contain a version controlled Gradle file. You can find one in the engines `third_party` directory at `/engine/src/flutter/third_party/gradle/bin/gradle`).