Generates version.json in web directory of project. version.json can be used in the future version of package_info which will support web. version.json has the following keys : app_name, version and build_number. This file is generated every time a user runs or builds the project.
Co-authored-by: Jonah Williams <jonahwilliams@google.com>
Like the ProcessException thrown from zip running on a bad file, the tool should catch the ArchiveException thrown from windows implementation using package:archive.
Port the deprecated settings devicelab test to tool integration shard. Tests that apps can be built using the deprecated android/settings.gradle file.
Part of #65790
Some terminals stdin do not support single char mode (like an emacs terminal buffer apparently). If this is the case, then the presented choice values would always have an appended newline \n which would prevent us from finding the value in the listed index (or using it as a signal for the default choice). To fix, treat '' as the default choice and always trim the choice value.
While this has seemingly always been broken, it wasn't noticeable until the multi-device selection prompt was added a few months ago.
Fixes#65267
* [gen_l10n] Support string list as preferred-supported-locales, as documented.
* [gen_l10n] Convert preferredSupportedLocale to a list of strings.
* [gen_l10n] Accept a multi option instead of a json string in the command line.
The Windows plugin CMake generation had code to ensure that the paths
written to it used POSIX separators, but the Linux version didn't; that
meant that plugin updates run on Windows machines would corrupt the
generated (but checked in) Linux CMake file.
This change shares that code so that both will use POSIX paths
regardless of what OS they are generated on.
Fixes https://github.com/flutter/flutter/issues/64591
Integration tests must only go through the real file system/process manager/platform. The global indirection makes this code harder to understand than if it directly referred to the concrete instances that are being used.
Update the integration shard to use a const instance of a LocalFIleSystem, LocalProcessManager, and LocalPlatform. Remove global usage and apply testWithoutContext.
Currently flutter run -d web creates a server with the x-frame-options: SAMEORIGIN added by default (shelf add it's by default). This doesn't allow you to use it inside a frame.
I am trying to build an embedded simulator in vscode and it requires using an iframe.
With this PR I remove the header for debug and profile mode.
The flutter tool is currently unable to detect missing permissions in gradle/gradle.bat that would cause a gradle build to fail via process exception. Rather than crashing and exiting, we can display the exception as an error message and tool exit.
While linux/macOS are able to add the +x bit, this is not possible on windows with our current file system/OS API. These crashes represent a substantial amount of crash reporting, but are otherwise not actionable on our end.
Almost all of the flag setup on Linux, macOS, and Windows should be
identical; this pulls that common setup to a shared method.
This adds support for several flags on macOS that have all the necessary
plumbing already in place due to shared backend code, but were never
enabled.
Fixes https://github.com/flutter/flutter/issues/64944
Attempt to bypass aggressive CDN by requesting main.dart.js/sw.js with a query param and defaulting index.html to online first. This will not stop aggressive CDN caching of the index.html
#64968
Exit the tool after a repeated network error to download. previously we were returning null and continuing on, leading to a ProcessException when we unzipped a missing file.
* synthetic packages by default in gen_l10n tool
* Refactor default path for synthetic package
* Remove unused import
* Code cleanup
* Further improvements to help text
* Refactor synthetic package path
* Remove newlines
* Test cleanup
* clean up logic in inputs and outputs list function
* Update l10n.yaml usage
* only add option if value is non-null
* Update stocks app as proof of concept for synthetic package usage
* Address nits
* print pubspec contents
* add print statements
* Do not allow null value for useSyntheticPackage
* +
* +
* +
* +
* Cleanup
* Add test
* Fix text
* Dont parse pubspec directly
* Test using context
* WIP: generate synthetic packages on pub get -- needs tests
* Allow null value
* Update null handling
* Refactor to properly handle null case
* Fix yamlMap condition
* Fix yaml node for real
* WIP: struggling to write tests
* WIP - take absolute path as an option
* Add tests
* Use environment project directory for synthetic package generation pathway
* Fix typo
* Improve help text
* Update defaults
* Remove unauthorized path import
* Fix pathing issues at synthetic package generation
* Fix typo in test
* Use path.join so projectDir matches up based on OS
* Fix Windows pathing in test
* Remove unnecessary replaceApp code for projectDir.path
* Use globals.fs.currentDirectory.path in resident_runner_test.dart
* Fix merge conflict
* Add test to ensure that synthetic package is generated on pub get
* Fix resident_runner_test.dart tests
* Fix tests
* Use package:file instead of dart:io
* WIP - exploration
* Remove synthetic package use from stocks example
* Update integration test to not use synthetic packages
* Remove trailing whitespace
* flutter pub get runs synth package generation
* Remove more print statements
* Add license header
* WIP - minimally working pub.get
* Use own MockBuildSystem
* Modify test and implementation to be a little cleaner
* Fix flutter pub get invocation
* Use synthetic packages in stocks app
* Revert "Use synthetic packages in stocks app"
This reverts commit 45bf24903c.
* Add environment and buildSystem params to flutter test
* Address code review feedback
* +
* Isolate codegen into its own API
* Fix imports
* Slight refactor
* Add one more test for no l10n.yaml file
* Remove unneeded mock class and import in pub_get_test.dart
* More code review feedback
* Remove unnecessary imports
* Remove `return await`s that I missed
* use arrow functions instead
* Reland "Re-enable the Dart Development Service (DDS) (#64671)"
This reverts commit 2ae25cc2d7.
* Fix MDNS building Observatory URI with port 0 instead of forwarding the device port
* Added MDNS test
This change re-enables DDS and outputs the DDS URI in place of the VM
service URI on the console. If --disable-dds is not provided,
--host-vmservice-port will be used to determine the port for DDS rather
than the host port for the VM service, which will instead be randomly
chosen.
Avoid creating AndroidDevice discovery if the SDK cannot be located. Previously the tool would use which/where adb, however this required us to handle the AndroidSdk class being potentially null - which required an additional layer of indirection around all access. Sometimes these were forgotten leading to NPEs.
In general, not much can be done with an Android Device if the actual SDK is not installed.
Reland with fixed code + tests for null SDK + adb in AndroidDeviceDiscovery
Avoid creating AndroidDevice discovery if the SDK cannot be located. Previously the tool would use which/where adb, however this required us to handle the AndroidSdk class being potentially null - which required an additional layer of indirection around all access. Sometimes these were forgotten leading to NPEs.
In general, not much can be done with an Android Device if the actual SDK is not installed.
Fixes#64246
If decoding the string contents of a stamp file fails, treat it as if the stamp file is missing. This is always safe to do, since at worst it downloads more artifacts. The files could end up corrupted if they were edited by another program, for example