I plan to extend the prepare_package.dart script to upload the flutter preview device ([design doc](https://docs.google.com/document/d/1AzI-_Uk2v1LA2kKKFJ7gVD4xcakXJ6yVZiS5Ek6RHtg/edit#heading=h.byp03plw7mg9)).
However, given that that script is one large >1k line file, I decided to organize it into smaller libraries in this PR. There should be no behavioral change in this PR, this is a cleanup only. I made the following changes:
1. Created a //dev/bots/prepare_package/ directory to contain helper libraries
2. Moved everything but the `main()` function in //dev/bots/prepare_package.dart into one of 4 helper libraries under the new directory from step 1:
a. archive_creator.dart which contains the code that creates archive directory locally on disk
b. archive_publisher.dart which contains the code that uploads the archive to cloud storage
c. common.dart for shared constants and definitions
d. process_runner.dart for an abstraction over running sub-processes
3. Changed all definitions to `File` and `Directory` from `dart:io` to use the testable versions from `package:file`. This allowed me to use the `MemoryFileSystem` in the unit tests, rather than creating real temp file system directories.
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`.
* Generate local metadata even when not publishing.
For SLSA compliance we need to separate the fetch, compile and upload
steps of release artifacts. Translating this to the packaging workflows
the fetch step will checkout the prepare_package script at main ToT, the
compile step generate the bundle archives and the recipes will upload
the artifact bundles as part of the upload stage.
This change adds functionality to generate both the release bundle and
the updated metadata file in a way that both files can be uploaded as
part of the upload stage.
Bug: https://github.com/flutter/flutter/issues/115487
* Address comments.
* Update tests.
Python 2 has been end-of-life'd since January 2020, all Python scripts
on which Flutter depends have been migrated to Python 3. This changes
documentation and remaining invocations to explicitly invoke python3.
Issue: https://github.com/flutter/flutter/issues/83043
This adds avoid_dynamic_calls to the list of lints, and fixes all instances where it was violated.
Importantly, this lint is NOT turned on for flutter/packages/test, because those changes are happening in another PR: #84478
This reverts #62710, since it has a noSuchMethodError in some circumstances.
This isn't just a straight git revert, because I had to resolve the conflicts in the reverted pubspec.yaml files and re-run flutter update-packages --force-upgrade to make the checksums match.
Fixes#58003
The .dart_tool directory can contain build assets, as well as the package_config.json file - the replacement for .packages. Remove it for the same reason we remove .packages
* Update project.pbxproj files to say Flutter rather than Chromium
Also, the templates now have an empty organization so that we don't cause people to give their apps a Flutter copyright.
* Update the copyright notice checker to require a standard notice on all files
* Update copyrights on Dart files. (This was a mechanical commit.)
* Fix weird license headers on Dart files that deviate from our conventions; relicense Shrine.
Some were already marked "The Flutter Authors", not clear why. Their
dates have been normalized. Some were missing the blank line after the
license. Some were randomly different in trivial ways for no apparent
reason (e.g. missing the trailing period).
* Clean up the copyrights in non-Dart files. (Manual edits.)
Also, make sure templates don't have copyrights.
* Fix some more ORGANIZATIONNAMEs
When we package Flutter, we used to find the "current" tag (which is the version number) by starting at the revision we are building on and looking backwards in time to find the most recent tag. This causes problems on release builds when we failed to tag properly.
This PR makes the packaging script be more strict by requiring the given revision to itself have a tag, but only when we're publishing the result. When we're not publishing the result, it's more lenient, since otherwise we couldn't test packaging on non-release commits.
I also renamed ProcessRunnerException to PreparePackageException, since we were using that exception more generally than just for processes.
Adds SHA256 checksums to the released package database, in preparation for showing them on the download website. (I'll update the existing data by hand).
Fixes#28465