Commit Graph

2716 Commits

Author SHA1 Message Date
Tomasz Gucio
99c7e9f088
Add spaces after flow control statements (#126320) 2023-05-15 11:07:30 +02:00
Andrew Kolos
5b2f658ff5
Revert "[tool] Move Java functions to their own file" (#126569)
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)
2023-05-11 17:06:57 +00:00
Andrew Kolos
0a63cd70f1
[tool] Move Java functions to their own file (#126086)
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.
2023-05-11 04:32:25 +00:00
Kevin Moore
1b831a2c70
tool/web: correctly log all options to web wasm compile (#126379)
Filtering on 'true' omitted non-bool values
2023-05-10 19:26:08 +00:00
Elias Yishak
0d5875274b
Clearer text about what happens with --disable-telemetry + enable-telemetry command (#125995)
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
2023-05-08 13:01:25 +00:00
chunhtai
78ed142f30
Rename iosdeeplinksettings to iosuniversallinksettings (#126173)
as title
2023-05-05 20:02:27 +00:00
Kevin Moore
f9d455134a
tool: replace top-level functions with enum properties (#126167) 2023-05-05 19:10:07 +00:00
chunhtai
b00f1c4599
Adding vmservice to get iOS app settings (#123156)
fixes https://github.com/flutter/flutter/issues/120405
2023-05-04 22:14:11 +00:00
Kevin Moore
529b919f09
tool-web-wasm: make wasm-opt an "option" instead of a "flag" (#126035)
Allows controlling a broader set of variables than just on/off.

Also make wasm-opt "full" the default
2023-05-04 22:07:12 +00:00
Kevin Moore
5816da8074
[tool] consistently use environment (not globals) in targets/web.dart (#125937)
Also update the order of args to commands so that testing has less repeated "stuff"
2023-05-04 00:47:06 +00:00
Kevin Moore
0f9d66aad6
tool: use switch expressions (#125930) 2023-05-03 21:00:08 +00:00
gmackall
c12488a707
[Reland] Add migrator to upgrade gradle version when conflict with Android Studio bundled Java version is detected (#125836)
This is an attempt to reland https://github.com/flutter/flutter/pull/124085.

Differences from this attempt and the last: 
1. Adds a check for null android studio versions and a test for this case.
2. Wraps the migrate code in a try-catch [per the suggestion here](https://github.com/flutter/flutter/pull/125728/files#r1181747899).

Old PR description:
This PR adds an android project migrator that checks the version of android studio and the version of gradle for conflicts, and upgrades to 7.4 if a conflict is detected. For more detail about the particular conflict, see https://github.com/flutter/flutter/issues/122376.

The PR also upgrades older gradle versions being used in integration testing to 7.4.

Fixes/related to: https://github.com/flutter/flutter/issues/122376 and https://github.com/flutter/flutter/issues/123636
2023-05-03 21:00:06 +00:00
Kevin Moore
4bd9bcd7cb
tool: DRY up DepfileService (#125922) 2023-05-03 20:54:51 +00:00
LouiseHsu
c9b132d079
Allow .xcworkspace and .xcodeproj to be renamed from default name 'Runner' (#124533)
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

&nbsp; 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.
2023-05-03 05:52:58 +00:00
Jenn Magder
1861ac470a
Migrate Xcode projects last version checks to Xcode 14.3 (#125827)
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.
2023-05-02 00:06:33 +00:00
gmackall
db7196c52c
Revert "Add migrator to upgrade gradle version when conflict with And… (#125813)
…roid Studio bundled Java version is detected (#124085)"

This reverts commit eba2a520b4.
2023-05-01 18:47:01 +00:00
Andrew Kolos
9dbd6e6139
[tools] Apply Android Studio version detection logic to explicitly configured installation directory (flutter config --android-studio-dir) (#125596)
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`.
2023-05-01 07:10:20 +00:00
Jenn Magder
6b73885e2d
Increase Xcode minimum version to 14 (#125639)
Looks like CocoaPods 1.12.1 is incompatible with < Xcode 14 due to https://github.com/CocoaPods/CocoaPods/pull/11828 (see https://github.com/flutter/flutter/issues/123890 for context).

Bump the minimum Xcode version allowed by tooling to 14, released September 2022.

```
[!] Xcode - develop for iOS and macOS (Xcode 13.4)
    ✗ Flutter requires Xcode 14 or higher.
      Download the latest version or update via the Mac App Store.
```

Fixes https://github.com/flutter/flutter/issues/125286.
Previous bump at #97746.
2023-04-27 23:17:56 +00:00
gmackall
eba2a520b4
Add migrator to upgrade gradle version when conflict with Android Studio bundled Java version is detected (#124085)
This PR adds an android project migrator that checks the version of android studio and the version of gradle for conflicts, and upgrades to 7.4 if a conflict is detected. For more detail about the particular conflict, see https://github.com/flutter/flutter/issues/122376.

The PR also upgrades older gradle versions being used in integration testing to 7.4. 

Fixes/related to: https://github.com/flutter/flutter/issues/122376 and https://github.com/flutter/flutter/issues/123636
2023-04-27 23:07:50 +00:00
Tae Hyung Kim
5c44b1df0f
Refactor "gen-l10n" command to use same code path when "l10n.yaml" is present or not present (#125429)
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.
2023-04-26 11:49:25 -07:00
Tae Hyung Kim
8be335f24c
Handle dollar signs properly when generating localizations (#125514)
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.
2023-04-25 22:52:24 +00:00
Kevin Moore
7d9f2082f1
tool: Move cdKey to CustomDimensionsEnum (#125335) 2023-04-24 22:59:20 +00:00
Kevin Moore
702f0144e0
[tool,web] track web-renderer, and Wasm build args in analytics (#125336)
Addresses part of https://github.com/flutter/flutter/issues/125164
2023-04-21 23:09:00 +00:00
Christopher Fujino
1561b65812
add gradle error handler for when the remote ssl host terminates handshake process (#125270)
Will fix transient network failures as in: https://github.com/flutter/flutter/issues/125108#issuecomment-1516519929
2023-04-21 21:59:10 +00:00
Michael Thomsen
dc481b23d1
Cleanup flutter config output (#122384) 2023-04-21 16:45:43 +02:00
Andrew Kolos
cf76b24df1
When searching for the JDK bundled with an unrecognized version of Android Studio, assume the version to be the latest (#125247)
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`.
2023-04-21 01:12:59 +00:00
Ben Konyi
0d023144d9
Fix race condition in flutter test when passing --serve-observatory (#123556)
`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
2023-04-20 13:46:33 -04:00
Kevin Moore
f5b0f0a2b6
Report web compiler used with buildEventSettings (#125092)
Fixes https://github.com/flutter/flutter/issues/125085
2023-04-19 22:19:21 +00:00
Victoria Ashworth
48bb3c0bc9
Use term wireless instead of network (#124232)
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.
2023-04-19 19:59:11 +00:00
Elias Yishak
ca3a900d5d
[reland] Update helper message for --suppress-analytics (#125145)
Relanding: https://github.com/flutter/flutter/pull/124810

Fixes: https://github.com/flutter/flutter/issues/124808
2023-04-19 18:51:08 +00:00
godofredoc
03d725620a
Revert "Update helper message for --suppress-analytics" (#125141)
Reverts flutter/flutter#124810
2023-04-19 16:43:29 +00:00
Elias Yishak
3476b96652
Update helper message for --suppress-analytics (#124810)
Fixes: https://github.com/flutter/flutter/issues/124808
2023-04-19 14:00:20 +00:00
chunhtai
55502fc36a
Add vmservice for android build options (#123034)
https://github.com/flutter/flutter/issues/120408
2023-04-18 18:16:09 +00:00
Andrew Kolos
68ec71f46c
[flutter_tools] Remove Version.unknown (#124771)
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.
2023-04-15 19:56:41 +00:00
Jackson Gardner
2269dc10b3
Add option to run wasm-opt on module output. (#124831)
This fixes https://github.com/flutter/flutter/issues/124159

Adds the command line argument `--wasm-opt` to optimize the web assembly output.
2023-04-14 17:19:21 +00:00
Andrew Kolos
2cd768b893
[flutter_tools] Reorganize android_studio_test.dart (#124834)
[flutter_tools] Reorganize android_studio_test.dart
2023-04-14 03:20:35 +00:00
Jenn Magder
44fe615c5c
Remove Finder extended attributes in build target before code signing iOS frameworks (#123896)
Remove Finder extended attributes in build target before code signing iOS frameworks
2023-04-14 02:26:15 +00:00
Kevin Moore
3bc07c1cef
flutter-tool, web: update HTML template serviceWorkerVersion to be const (#124826)
flutter-tool, web: update HTML template serviceWorkerVersion to be const
2023-04-14 02:01:21 +00:00
Kevin Moore
76e587bf78
flutter-tool: enum cleanup (#124760)
flutter-tool: enum cleanup
2023-04-14 01:55:05 +00:00
Reid Baker
2723266466
i123643 print java version gradle (#123644)
#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>
2023-04-13 18:13:58 -04:00
Camille Simon
f582b56e45
Update re-thrown error for incompatible Java/Gradle versions to include migration guide (#124327)
Update re-thrown error for incompatible Java/Gradle versions to include migration guide
2023-04-12 22:15:07 +00:00
Elias Yishak
51b23bc961
Update runner to handle logic for both analytics packages (#124606)
Update runner to handle logic for both analytics packages
2023-04-12 19:34:11 +00:00
Jackson Gardner
ac9b501dc2
Remove the old canvaskit artifacts to not confuse the web runner. (#124641)
Remove the old canvaskit artifacts to not confuse the web runner.
2023-04-12 16:57:41 +00:00
Kevin Moore
895879c195
flutter_tools: Flutter Web CLI cleanup (#124564)
flutter_tools: Flutter Web CLI cleanup
2023-04-12 00:01:15 +00:00
Kevin Moore
ecf6a66387
Add omit-type-checks flag for wasm builds (#124341)
Add omit-type-checks flag for wasm builds
2023-04-11 00:38:35 +00:00
Lau Ching Jun
c8b38b20bf
Debounce the proxied connection over proxied devices. (#124540)
Debounce the proxied connection over proxied devices.
2023-04-10 23:20:01 +00:00
Lau Ching Jun
5923ae41d2
Allow daemon to start DDS remotely when proxied devices are used. (#124061)
Allow daemon to start DDS remotely when proxied devices are used.
2023-04-10 20:21:07 +00:00
Jackson Gardner
07b89dada4
Add support to the flutter tool to compile against the skwasm renderer (#124296)
Add support to the flutter tool to compile against the skwasm renderer
2023-04-10 15:52:40 +00:00
Reid Baker
7a791b5dbf
Update getGradleVersion to ignore commented out lines (#124260)
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.
2023-04-07 12:45:37 -04:00
Kevin Moore
97d5cd5ecc
flutter tool: log dart2wasm vs dart2js as appropriate during build (#124331)
flutter tool: log dart2wasm vs dart2js as appropriate during build
2023-04-06 20:49:26 +00:00