`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.
Remove double.fromEnvironment from dart-define doc.
Fixes#124665
The current dart-define docs reads:
```
Additional key-value pairs that will be available as constants from the String.fromEnvironment, bool.fromEnvironment, int.fromEnvironment, and
double.fromEnvironment constructors.
```
while dart-define-from-file reads:
```
The path of a json format file where flutter define a global constant pool.
Json entry will be available as constants from the String.fromEnvironment, bool.fromEnvironment, int.fromEnvironment,
and double.fromEnvironment constructors; the key and field are json values
```
<img width="1440" alt="Screenshot 2023-04-03 at 19 31 34" src="https://user-images.githubusercontent.com/31275429/229720102-2020e1a9-c1fb-470b-89e6-ffb84096a51b.png">
However, there is no fromEnvironment constructor for double. The aim of this PR is to address this by removing double.fromEnvironment from help docs as stated in
Currently, nullable-getter defaults to false when l10n.yaml is not present, which is not the same behavior as when an l10n.yaml file is present and nullable-getter is not set.
Fixes#120457.
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>
This was an oversight from pr
https://github.com/flutter/flutter/pull/116146/files.
Comments in both files indicate that the versions should be bumped
together.
## 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].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] 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].
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
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.
https://github.com/flutter/flutter/issues/123917
Doc covering a broad set of issues related to android studio updating.
https://docs.google.com/document/d/1hTXkjbUrBnXgu8NQsth1c3aEqo77rWoEj8CcsQ39wwQ/edit?pli=1#
Specifically this pr:
- Adds new functions to find a projects AGP, Gradle and java versions,
and tests.
- Adds new functions that take versions and parse if the versions are
compatible with each other, and tests.
- Adds validator for `flutter analyze --suggestions` that evaluates the
java/gradle/agp versions and checks if they are compatible, and
integration test.
- Updates the version of gradle used by
dev/integration_tests/flutter_gallery/ to the minimum supported by java
18 so that the integration tests pass (It is unknown why the java
version is 18.9 instead of 11)
- Moves `isWithinVersionRange` to version.dart, and tests.
- Adds FakeAndroidStudio to fakes to be used in multiple tests but does
not remove existing copies.
Metrics will be included as part of the definition of done for this bug
but not as part of this cl. It is already too big.
Known work still left in this pr:
* Understand why analyze integration tests are failing.
Example output if Java and gradle are not compatible:
```
┌───────────────────────────────────────────────────────────────────┐
│ General Info │
│ [✓] App Name: espresso_example │
│ [✓] Supported Platforms: android │
│ [✓] Is Flutter Package: yes │
│ [✓] Uses Material Design: yes │
│ [✓] Is Plugin: no │
│ [✗] Java/Gradle/Android Gradle Plugin: │
│ │
│ Incompatible Java/Gradle versions. │
│ │
│ Java Version: 17.0.6, Gradle Version: 7.0.2 │
│ │
│ See the link below for more information. │
│ https://docs.gradle.org/current/userguide/compatibility.html#java │
│ │
└───────────────────────────────────────────────────────────────────┘
```
Example output if Gradle and AGP are not compatible
```
┌─────────────────────────────────────────────────────────────────────────────┐
│ General Info │
│ [✓] App Name: espresso_example │
│ [✓] Supported Platforms: android │
│ [✓] Is Flutter Package: yes │
│ [✓] Uses Material Design: yes │
│ [✓] Is Plugin: no │
│ [✗] Java/Gradle/Android Gradle Plugin: Incompatible Gradle/AGP versions. │
│ │
│ Gradle Version: 7.0.2, AGP Version: 7.4.2 │
│ │
│ Update gradle to at least "7.5". │
│ See the link below for more information: │
│ https://developer.android.com/studio/releases/gradle-plugin#updating-gradle │
│ │
│ Incompatible Java/Gradle versions. │
│ │
│ Java Version: 17.0.6, Gradle Version: 7.0.2 │
│ │
│ See the link below for more information: │
│ https://docs.gradle.org/current/userguide/compatibility.html#java │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
```
Example output if Java/Gradle/Agp are not compatible.
```
┌─────────────────────────────────────────────────────────────────────────────┐
│ General Info │
│ [✓] App Name: espresso_example │
│ [✓] Supported Platforms: android │
│ [✓] Is Flutter Package: yes │
│ [✓] Uses Material Design: yes │
│ [✓] Is Plugin: no │
│ [✗] Java/Gradle/Android Gradle Plugin: Incompatible Gradle/AGP versions. │
│ │
│ Gradle Version: 7.0.2, AGP Version: 7.4.2 │
│ │
│ Update gradle to at least "7.5". │
│ See the link below for more information: │
│ https://developer.android.com/studio/releases/gradle-plugin#updating-gradle │
│ │
│ Incompatible Java/Gradle versions. │
│ │
│ Java Version: 17.0.6, Gradle Version: 7.0.2 │
│ │
│ See the link below for more information: │
│ https://docs.gradle.org/current/userguide/compatibility.html#java │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
```
Commit messages
- Add function to gradle_utils.dart that gets the gradle version from
wrapper or system and add a test for each situation
- Add method to get agp version, add method to validate agp against
gradle version, update documentation, add tests for agp validation.
- Update dart doc for validateGradleAndAgp to describe where the info
came from and corner case behavior, create function to validate java and
gradle and hardcode return to false
- Fill out and test java gradle compatibility function in gradle_utils
- Hook up java gradle evaluateion to hasValidJavaGradleAgpVersions with
hardcoded java version
- Add java --version output parsing and tests
- Add getJavaBinary test
- Update comment in android_sdk for mac behavior with java_home -v
## 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].
- [ ] All existing and new tests are passing.
Observatory can still be enabled by providing `--serve-observatory` or
invoking the `_serveObservatory` private service RPC via web socket or
HTTP.
Related to https://github.com/dart-lang/sdk/issues/50233
* Make custom `Utf8Decoder` replacement not extend platform class.
The Dart 3.0 class modifiers will make `Utf8Decoder`, and other
pure implementation classes, be `final`.
This replacement class does not need to extend the original
class, just like the `Utf8Codec` in the same file doesn't
extend the `Ut8Codec` from the platform libraries.
Instead it can just forward to a single `const` instance of the
original class.
* Forgot one constant
* Fix merge conflict.
---------
Co-authored-by: Zachary Anderson <zanderso@users.noreply.github.com>
Use the pub cache resolved by pub itself.
To add packages to the flutter.zip download they are packaged as tar.gz and added to the pub-cache on first run by using `pub cache preload`.
* [flutter_tools] Add support for URI formats like ?line=x for "flutter test"
* Remove unnecessary function
* Handle parsing absolute paths on Windows
* Use Windows-style paths when running on Windows
* Fix paths in isFile
* Remove unnecessary clear
* Allow any JS file in flutter loader.
* Nag only if service worker API is completely unavailable.
* Add info about Secure Contexts if that may be the reason why serviceworker is not available.
* Update sanity test.
* If service worker settings are null, do not even check if the API is available.
* allow passing --file-reporter option to test running refs #69425
* Add trailing comma to help to meet style requirements
* Add space between tests for clarity
---------
Co-authored-by: daniel-v <dvarga@skawa.hu>
...and various other minor cleanup:
* Moved "FLUTTER_STORAGE_BASE_URL" into a constant throughout the code. There are other strings that we should do that to but this one was relevant to the code I was changing.
* Fixed the logger's handling of slow warnings. Previously it deleted too much text. Fixed the test for that to actually verify it entirely, too.
* Made the logger delete the slow warning when it's finished.
* Fixed 'Please choose one (To quit, press "q/Q")' message to be the cleaner 'Please choose one (or "q" to quit)'.
* Added a debug toString to ValidationResult for debugging purposes (not used).
* In http_host_validator:
- Shortened constant names to be clearer (e.g. kPubDevHttpHost -> kPubDev).
- Added GitHub as a tested host since when you run `flutter` we hit that immediately.
- Renamed the check "Network resources".
- Updated the `slowWarning` of the check to say which hosts are pending.
- Removed all timeout logic. Timeouts violate our style guide.
- Removed `int.parse(... ?? '10')`; passing a constant to `int.parse` is inefficient.
- Replaced the `_HostValidationResult` class with `String?` for simplicity.
- Improved the error messages to be more detailed.
- Removed all checks that dependened on the stringification of exceptions. That's very brittle.
- Added a warning specifically for HandshakeException that talks about the implications (MITM attacks).
- Replaced exception-message-parsing logic with just calling `Uri.tryParse` and validating the result.
- Replaced a lot of list-filtering logic with just a single for loop to check the results.
- Replaced code that added a constant to a known-empty list with just returning a constant list.
- Revamped the logic for deciding which hosts to check to just use a single chain of if/else blocks instead of getters, lists literals with `if` expressions, `??`, functions, etc spread over multiple places in the code.
* Move linux-x64-flutter-gtk.zip to linux-x64-debug location.
linux-x64-flutter-gtk.zip is being uploaded twice to linux-x64-debug
and linux-x64 as part of making a soft transition to use linux-x64-debug
location. This PR starts using the copy inside linux-x64-debug to later
remove the duplicated upload.
* Also move arm64.
* Do not override output dir.
This is already handled by pkg:shelf
There is some subtlety with String here, since String.length might not
align with the size in bytes over the wire, depending on the contents
and the encoding
Best to just let pkg:shelf handle it
* 🔥 Do not format the messages file
* ✅ Add test
* ✅ Add the link to the test
* ✅ Respect the path separator from the file system
* ✅ Add the untranslated messages file existence test
* fix when duplicate mdns results are found
* put mdns auth code in it's own function and update tests
* add comments, refactor auth code parsing, other small tweaks
* Reland "Add --serve-observatory flag to run, attach, and test (#118402)"
This reverts commit 86ab01d2bd.
* Fix flaky failures
* Fix VM service disappearing failure
* refactoring to use `ver` command instead of `systeminfo`
* fix tests to match new approach
* adding another valid validator using brazil locale text
* refactor tests to use generic fake class `ver` arg + showing output from `ver` if unsuccessful
* update reason text in test
* fix reason text to be hard coded
The dependency is currently uploaded to two different locations. This
change is required to remove the duplicate uploads and their
corresponding tech debt.
* Add usage event to track when a iOS network device is used
* update usage event to track percentage of iOS network vs usb devices, update and fix tests
* refactor tracking to happen in usageValues with a custom dimension
* Add new macos target configured for flavors
* Rename Free App copy-Info.plist to Free App Info.plist
* Remove bogus entitlements
* Remove Generated.xcconfig
* Audit project.pbxproj
* Remove unused configs
* share one info.plist
* Modify scheme so that paid app works
* Codesign automatic
* Pipe flavor as scheme into xcodebuild
* Ignore incoming flavor string
* pipe flavor for flutter run to work
* Add devicelab tests
* Error if host and target device are same for flutter install desktop
* Avoid bang (!) by promoting a local.
Co-authored-by: Jenn Magder <magder@google.com>
* Add supportsInstall property
* Override in test classes
* Add install test on macOS
* Refactor application_package and add tests for package directory
Co-authored-by: a-wallen <stephenwallen@google.com>
Co-authored-by: Jenn Magder <magder@google.com>
* [Flutter_tools] Ensure service worker starts caching assets since the first launch
* [flutter_tools] add comment to give some context on self.clients.claim()
* [flutter_tools] add comment to give some context on self.clients.claim()
* setup wireless debugging to use device IP
* fix tests
* fix unused var and missing annotation
* remove unneeded try catch
* remove commented out line, change null to package id
* better way to get package id
* update mDNS lookup to continously check for server, add messaging if takes too long to find observatory url, update flutter drive to enable publish-port if using network device
* Refactor mDNS Discovery to poll for observatories and better handle multiple instances of the same app. Update drive command to make publish-port more stable. Update attach for iOS to only use Protocol Discovery if applicable, run mDNS and Protocol Discovery simultaneously, handle --debug-port/--debug-url/--device-vmservice-port, continously poll for obseravtories with mDNS, include port in error message when mutliple available
* add and update comments, use logger spinner intead of timer in flutter attach, other small improvements
* add newline to message so next log won't be on same line
* fix install/waiting for permission status progress so it doens't double print the time it took.
* only print backtrace if observatory times out on a physical usb connected device
* fix test
* Update related references from Observatory to Dart VM Service
* fix test
Matches new location in the Dart SDK.
https://dart-review.googlesource.com/c/sdk/+/275482
Includes fall back logic so the old file location will continue to be used
until the new location change lands. Then we can remove the logic and only
use the new location in a future change.
Issue: #118119
* Add Info.plist from build directory as input path to Thin Binary build phase
* fix directive ordering
* migrate benchmark, integration, and example tests
* Use correct API doc link in create --sample help message
* Verify Flutter and Dart website links in tool help messages use https
* Adjust test failure reasoning message
* Align `flutter pub get/upgrade/add/remove/downgrade`
* Add final . to command description
* Remove trailing whitespace
* Don't print message that command is being run
* Update expectations
* Use relative path
* Remove duplicated line
* Improve function dartdoc
* Make pub get runner respect printProgress and retry parameters
* Fix typo
* Add regression test
* Improve test
* Fix implementation and test
* Test to fix flutter_drone tests
* Revert test
* Attempt #2 to fix flutter_drone tests
* Revert attempt
* Hack: Force printProgress to debug Windows tests
* Use ProcessUtils.run to avoid dangling stdout and stderr
* Update documentation
* Clean up retry argument
* Work in progress.
* Some fixes to the command line.
* Bootstrapping works.
* Change kickoff order to maximize concurrency.
* Fix analyzer errors and formatting issues.
* Fix doc comment.
* Added unit tests for some of the web targets.
* Format issue.
* Add an integration test that builds an app to wasm.
* Add a todo for depfiles.
* Formatting.
* Apparently the license header needs to say 2014.
* `file://` URIs confuse dart2wasm on Windows. Just use absolute paths.
* Update unit tests to match new path passing.
* Have a distinct build directory for wasm, and fixes for some upstream changes.
* [tools]some ui polish for build ipa validation
* do not print out a few success validations
* rename installed type to success for more general usage
* forgot nit after reverting custom validation types and re-use doctor types
* wip
* remove temp text file
* fix tests
* add test
* default to off
* restore gitignore
* update
* apply annotation to cupertino icons as well
* update reference to library in icon_tree_shaker.dart
* update tests
* fix tests
* remove hack to skip non-const check on web
* add hint about how much reduction and test
* Add an integration test to plugin template example
Dart unit tests don't exercise host-side plugin code at all, so the
example tests in the plugin template currently have very little
meaningful coverage. This adds an integration test to the example app
when creating a plugin, so that there's an example of how to actually
test that a complete round-trip plugin call works.
This is done as a separate template that's currently only used by the
plugin template because I don't know what a good example for a
non-plugin case would be that isn't largely just a duplicate of the
widget tests. However, the integration test pre-includes conditionals
around the parts that are plugin-specific so that it can more easily be
expanded to other use cases later (e.g., in
https://github.com/flutter/flutter/issues/68818).
Part of https://github.com/flutter/flutter/issues/82458
* Add integration test to expected dependencies of a plugin app
* Test fixes
* Make an explicit test case
* Roll Flutter Engine from 67254d6e4b03 to 8d83b98c55b3
* Roll Dart SDK from 35a9facce191 to e517487c5679 (Dart 3.0) (#38105)
* Bump SDK versions.
* Bump Dart SDK version constraints
* Update shrine package to 2.0.1 (null safe version)
* Fix more tests.
* Include patches from Jason for min android sdk version
* Fix analyzer warning