Reverts flutter/flutter#126086.
This PR changed the interfaces of some classes, namely `AndroidSdk`, and deleted a global.
These classes had custom overrides in g3 that were not updated with a g3fix, so this PR has broken tests. See https://b.corp.google.com/issues/281945232 (non-public link)
This is the first step in unifying Java-finding logic across the tool. If curious, see #126029 for an example of what all the changes will probably entail.
Moves java-related functionality like `AndroidSdk.findJavaHome` to a new class, `Java`.
See tracking issue https://github.com/flutter/flutter/issues/126126 for more.
Fixes:
- https://github.com/flutter/flutter/issues/124411
This PR is cleaning up the `--disable-telemetry` help message to make it clear that opting out will opt out of all telemetry collection for flutter and dart commands. It is also adding the opposite flag `--enable-telemetry` which will enable telemetry collection
Adds the ability to rename Runner.xcodeproj and Runner.xcworkspace - fixes https://github.com/flutter/flutter/issues/9767.
To rename a project:
1. Open Runner.xcodeproj in Xcode
2. In the left panel, left click "Show File Inspector"
<img width="441" alt="Screenshot 2023-04-17 at 11 41 07 PM" src="https://user-images.githubusercontent.com/36148254/232692957-8743742d-c3ef-42e5-833f-dff31aeb2b6a.png">
3. In the right panel, the name of the project, "Runner", should be visible under "Identity and Type". Change the name and press enter.
<img width="299" alt="Screenshot 2023-04-17 at 11 40 43 PM" src="https://user-images.githubusercontent.com/36148254/232693315-b6a71165-f5e3-4a0f-8954-2f3eee5b67cf.png">
4. A wizard should pop up. Click Rename.
<img width="573" alt="Screenshot 2023-04-17 at 11 44 01 PM" src="https://user-images.githubusercontent.com/36148254/232693381-bb9cf026-2a75-4844-b42d-ae0036ae9fdd.png">
To rename the workspace:
1. Make sure Xcode is closed.
2. Rename the .xcworkspace to your new name.
If you also renamed the project
3. Reopen the .xcworkspace in Xcode. If the selected project is the old name and in red, update it to match the new project name.
Tests for schemeFor were changed as with Xcode 14, in some cases the scheme will be renamed along with the project. Thus we will get the best match scheme for either the project name, or the default name Runner. However if a flavor is present, the scheme should always match the flavor.
1. Add iOS and macOS migration to mark "last upgraded" Xcode version to 14.3 to prevent `Update to recommended settings` warning.
2. Update iOS and macOS templates to same.
3. Update iOS template to set `BuildIndependentTargetsInParallel` to YES as suggested. I didn't add a migration for this since it seems like a minor optimization and I don't think it's worth a potentially botched/corrupted migration.
4. Run all example/integration test project to see migrator work.
5. Add some missing test projects to the build shard since I noticed they were missing and I had to build those manually outside `SHARD=build_tests`.
Fixes https://github.com/flutter/flutter/issues/125817
See https://github.com/flutter/flutter/pull/90304 for Xcode 13 example.
Fixes#121468 (when considered along with https://github.com/flutter/flutter/pull/125247).
This applies the pre-existing Android Studio version detection logic to the install configured with `flutter config android-studio-dir`.
I think this is a long needed change to the `gen-l10n` command.
Essentially, the arguments to `flutter gen-l10n` can be provided by two
different methods: via command line arguments or via the `l10n.yaml`
file. The existence of a `l10n.yaml` file causes the latter approach to
take precedence.
However, currently, there's several differences in how the two
approaches are handled, and most of the default arguments are all over
the place, causing unexpected issues such as #120457 or #120023.
This PR refactors the command so that
* `LocalizationOptions` are more consistent with the actual argument
names/yaml options.
* All default values are determined in `LocalizationOptions`'s
constructor (or in `argParser.addOption(...)` in the case a boolean
value needs to be explicitly true).
* New `parseLocalizationsOptionsFromCommand` function to parse
arguments.
* Parse `LocalizationOptions` at the beginning of `runCommand()` and
pass it to `generateLocalizations`.
Fixes#120023.
Currently, the code doesn't properly handle strings which contain dollar signs. The return expression for the generated localization function is computed by `generateReturnExpr` which concatenates several strings, which are either interpolated placeholders, interpolated function calls, or normal strings, but we didn't properly escape dollar signs before sending normal strings to `generateReturnExpr`.
Fixes#125461.
Fixes#125246 by restoring the intended behavior of #101862. That is, when searching for a JDK and we encounter an Android Studio version we don't recognize, assume it to be the latest version `flutter` is aware of.
Also does some light refactoring in the tests, like using test objects instead of referencing `globals`.
`flutter test` wasn't awaiting the `_serveObservatory` request which was
causing a race condition in the `flutter test should respect
--serve-observatory` test in `test/integration.general/test_test.dart`.
Related to https://github.com/flutter/flutter/issues/123516
Rename variables, update comments, etc from `network` to `wireless` to keep it more uniform.
Also, move non-overriden messages related to device selection into the file they're used.
Part 7 in breakdown of https://github.com/flutter/flutter/pull/121262.
Fixes#124756 by removing the concept of `Version.unknown`.
`Version` fields that needed the ability to represent an unknown version have been made nullable. Assigning `null` to them represents an unknown version.
#123643
- Add task to projects evaluated by flutter.gradle that will print the
java version.
- Add integration test for the existence of javaVersion and the expected
format.
- Add gradle util to get the gradlew version for a specific platform
(gradlew everywhere but windows).
Why does this code need to exist?
Figuring out what version of java is used by flutter/gradle is done in a
few different ways that are not always aligned.
See this issue https://github.com/flutter/flutter/issues/122609 ,
this issue https://github.com/flutter/flutter/issues/121501 this feature
request https://github.com/flutter/flutter/issues/106416
As examples of why assuming the java version is dangerous.
This task is code flutter can build upon and is the version gradle is
using to build no matter how it is configured.
## 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 `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.
---------
Co-authored-by: Mitchell Goodwin <58190796+MitchellGoodwin@users.noreply.github.com>
Co-authored-by: Greg Spencer <gspencergoog@users.noreply.github.com>
Co-authored-by: Victoria Ashworth <vashworth@google.com>
Co-authored-by: Christopher Fujino <christopherfujino@gmail.com>
Co-authored-by: Jackson Gardner <jacksongardner@google.com>
Co-authored-by: Rydmike <m.rydstrom@gmail.com>
Co-authored-by: keyonghan <54558023+keyonghan@users.noreply.github.com>
Co-authored-by: chunhtai <47866232+chunhtai@users.noreply.github.com>
Co-authored-by: Taha Tesser <tessertaha@gmail.com>
Co-authored-by: Ben Konyi <bkonyi@google.com>
Co-authored-by: engine-flutter-autoroll <engine-flutter-autoroll@skia.org>
Co-authored-by: hellohuanlin <41930132+hellohuanlin@users.noreply.github.com>
Co-authored-by: Danny Tuppeny <danny@tuppeny.com>
Co-authored-by: Chris Bracken <chris@bracken.jp>
Co-authored-by: Kate Lovett <katelovett@google.com>
Co-authored-by: Michael Goderbauer <goderbauer@google.com>
Co-authored-by: Elias Yishak <42216813+eliasyishak@users.noreply.github.com>
Co-authored-by: Christopher Fujino <fujino@google.com>
https://github.com/flutter/flutter/issues/123917
Missed feedback from https://github.com/flutter/flutter/pull/123916
- Handle commented out lines in gradle-wrapper.properties
This is 1 of 2 prs to handle missed feedback. Formatting will be done in
the second whereas this one captures a weakness missed in the last pr.
## 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 `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.