• Lau Ching Jun's avatar
    Avoid depending on files from build_system/targets other than from top level... · ac7879e2
    Lau Ching Jun authored
    Avoid depending on files from build_system/targets other than from top level entrypoints in flutter_tools. (#142760)
    
    Add a new `BuildTargets` class that provides commonly used build targets. And avoid importing files from `build_system/targets` except from the top level entrypoints or from top level commands.
    
    Also move `scene_importer.dart` and `shader_compiler.dart` into `build_system/tools` because they are not `Target` classes, but wrapper for certain tools.
    
    With this change, we can ignore all files in `build_system/targets` internally and make PR #142709 easier to land internally. See cl/603434066 for the corresponding internal change.
    
    Related to:
    https://github.com/flutter/flutter/pull/142709
    https://github.com/flutter/flutter/issues/142041
    
    Also note that I have opted to add a new variable in `globals.dart` for `BuildTargets` in this PR, but I know that we are trying to get rid of globals. Several alternatives that I was considering:
    
    1. Add a new field in `BuildSystem` that returns a `BuildTargets` instance. Since `BuildSystem` is already in `globals`, we can access build targets using `globals.buildSystem.buildTargets` without adding a new global variable.
    2. Properly inject the `BuildTargetsImpl` instance from the top level `executable.dart` and top level commands.
    
    Let me know if you want me to do one of the above instead. Thanks!
    ac7879e2
Name
Last commit
Last update
..
android_common.dart Loading commit data...
common.dart Loading commit data...
context.dart Loading commit data...
custom_devices_common.dart Loading commit data...
fake_devices.dart Loading commit data...
fake_http_client.dart Loading commit data...
fake_process_manager.dart Loading commit data...
fake_vm_services.dart Loading commit data...
fakes.dart Loading commit data...
io.dart Loading commit data...
logging_logger.dart Loading commit data...
pubspec_schema.dart Loading commit data...
test_build_system.dart Loading commit data...
test_flutter_command_runner.dart Loading commit data...
test_wrapper.dart Loading commit data...
testbed.dart Loading commit data...
throwing_pub.dart Loading commit data...