• Christopher Fujino's avatar
    Refactor prepare_package.dart (#139277) · 88710972
    Christopher Fujino authored
    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.
    88710972
Name
Last commit
Last update
..
prepare_package Loading commit data...
test Loading commit data...
README.md Loading commit data...
accept_android_sdk_licenses.sh Loading commit data...
allowlist.dart Loading commit data...
analysis_options.yaml Loading commit data...
analyze.dart Loading commit data...
analyze_snippet_code.dart Loading commit data...
browser.dart Loading commit data...
check_code_samples.dart Loading commit data...
codelabs_build_test.sh Loading commit data...
docs.sh Loading commit data...
post_process_docs.dart Loading commit data...
prepare_package.dart Loading commit data...
pubspec.yaml Loading commit data...
run_command.dart Loading commit data...
service_worker_test.dart Loading commit data...
serviceaccount.enc Loading commit data...
test.dart Loading commit data...
tool_subsharding.dart Loading commit data...
unpublish_package.dart Loading commit data...
utils.dart Loading commit data...