-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Reland "[flutter_tools] Cleanup of native asset related code (removes around 50% of the native asset related code) (#155430)" #155745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… around 50% of the native asset related code) (flutter#155430)" Changes to original CL: The code that issues an error on unsupported operating system in the dry-run case was missing a case for iOS and Android. Original CL description tl;dr Removes 50% (>1650 locs) of native asset related code in `packages/flutter_tools` Before this PR the invocation of dart build/link/dry-run was implemented per OS. This lead to very large code duplication of almost identical, but slightly different code. It also led to similarly duplicated test code. Almost the entire dart build/link/dry-run implementation is identical across OSes. There's small variations: - configuration of the build (e.g. android/macos/ios version, ios sdk, ...) - determining target locations & copying the final shared libraries This PR unifies the implementation by reducing the code to basically two main functions: * `runFlutterSpecificDartBuild` which is responsible for - obtain flutter configuration - perform dart build (& link) - determine target location & install binaries * `runFlutterSpecificDartDryRunOnPlatforms` which is responsible for a similar (but not same): - obtain flutter configuration - perform dart dry run - determine target location these two functions will call out to helpers for the OS specific functionality: * `_assetTargetLocationsForOS` for determining the location of the code assets * `_copyNativeCodeAssetsForOS` for copying the code assets (and possibly overriting the install name, etc) => Since we get rid of the code duplication across OSes and have only a single code path for the build/link/dry-run, we can also remove the duplicated tests that were pretty much identical across OSes. We also harden the building code by adding asserts, e.g. * the dry fun functionality should never be used by `flutter test` * the `build/native_assets/<os>/native_assets.yaml` should only be used by `flutter test` and the dry-run of `flutter run` => We change the tests to also comply with these invariants (so the tests are not testing things that cannot happen in reality) We also rename `{,Flutter}NativeAssetsBuildRunner` to disambiguate it from the `package:native_asset_builder`'s `NativeAssetsBuildRunner`.
dcharkes
approved these changes
Sep 26, 2024
Member
Author
|
Thanks for the quick +1, @dcharkes ! |
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Sep 26, 2024
…(removes around 50% of the native asset related code) (#155430)" (flutter/flutter#155745)
thejitenpatel
pushed a commit
to thejitenpatel/flutter
that referenced
this pull request
Sep 26, 2024
… around 50% of the native asset related code) (flutter#155430)" (flutter#155745) Changes to original CL: The code that issues an error on unsupported operating system in the dry-run case was missing a case for iOS and Android Original CL description tl;dr Removes 50% (>1650 locs) of native asset related code in `packages/flutter_tools` Before this PR the invocation of dart build/link/dry-run was implemented per OS. This lead to very large code duplication of almost identical, but slightly different code. It also led to similarly duplicated test code. Almost the entire dart build/link/dry-run implementation is identical across OSes. There's small variations: - configuration of the build (e.g. android/macos/ios version, ios sdk, ...) - determining target locations & copying the final shared libraries This PR unifies the implementation by reducing the code to basically two main functions: * `runFlutterSpecificDartBuild` which is responsible for - obtain flutter configuration - perform dart build (& link) - determine target location & install binaries * `runFlutterSpecificDartDryRunOnPlatforms` which is responsible for a similar (but not same): - obtain flutter configuration - perform dart dry run - determine target location these two functions will call out to helpers for the OS specific functionality: * `_assetTargetLocationsForOS` for determining the location of the code assets * `_copyNativeCodeAssetsForOS` for copying the code assets (and possibly overriting the install name, etc) => Since we get rid of the code duplication across OSes and have only a single code path for the build/link/dry-run, we can also remove the duplicated tests that were pretty much identical across OSes. We also harden the building code by adding asserts, e.g. * the dry fun functionality should never be used by `flutter test` * the `build/native_assets/<os>/native_assets.yaml` should only be used by `flutter test` and the dry-run of `flutter run` => We change the tests to also comply with these invariants (so the tests are not testing things that cannot happen in reality) We also rename `{,Flutter}NativeAssetsBuildRunner` to disambiguate it from the `package:native_asset_builder`'s `NativeAssetsBuildRunner`.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Sep 26, 2024
…(removes around 50% of the native asset related code) (#155430)" (flutter/flutter#155745)
thejitenpatel
pushed a commit
to thejitenpatel/flutter
that referenced
this pull request
Sep 26, 2024
… around 50% of the native asset related code) (flutter#155430)" (flutter#155745) Changes to original CL: The code that issues an error on unsupported operating system in the dry-run case was missing a case for iOS and Android Original CL description tl;dr Removes 50% (>1650 locs) of native asset related code in `packages/flutter_tools` Before this PR the invocation of dart build/link/dry-run was implemented per OS. This lead to very large code duplication of almost identical, but slightly different code. It also led to similarly duplicated test code. Almost the entire dart build/link/dry-run implementation is identical across OSes. There's small variations: - configuration of the build (e.g. android/macos/ios version, ios sdk, ...) - determining target locations & copying the final shared libraries This PR unifies the implementation by reducing the code to basically two main functions: * `runFlutterSpecificDartBuild` which is responsible for - obtain flutter configuration - perform dart build (& link) - determine target location & install binaries * `runFlutterSpecificDartDryRunOnPlatforms` which is responsible for a similar (but not same): - obtain flutter configuration - perform dart dry run - determine target location these two functions will call out to helpers for the OS specific functionality: * `_assetTargetLocationsForOS` for determining the location of the code assets * `_copyNativeCodeAssetsForOS` for copying the code assets (and possibly overriting the install name, etc) => Since we get rid of the code duplication across OSes and have only a single code path for the build/link/dry-run, we can also remove the duplicated tests that were pretty much identical across OSes. We also harden the building code by adding asserts, e.g. * the dry fun functionality should never be used by `flutter test` * the `build/native_assets/<os>/native_assets.yaml` should only be used by `flutter test` and the dry-run of `flutter run` => We change the tests to also comply with these invariants (so the tests are not testing things that cannot happen in reality) We also rename `{,Flutter}NativeAssetsBuildRunner` to disambiguate it from the `package:native_asset_builder`'s `NativeAssetsBuildRunner`.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Sep 26, 2024
…(removes around 50% of the native asset related code) (#155430)" (flutter/flutter#155745)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Sep 26, 2024
…(removes around 50% of the native asset related code) (#155430)" (flutter/flutter#155745)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Sep 26, 2024
…(removes around 50% of the native asset related code) (#155430)" (flutter/flutter#155745)
LouiseHsu
pushed a commit
to flutter/packages
that referenced
this pull request
Sep 26, 2024
flutter/flutter@538e742...fa402c8 2024-09-26 [email protected] Roll Flutter Engine from 6328a0597b68 to 9e6133e8d906 (1 revision) (flutter/flutter#155762) 2024-09-26 [email protected] Roll Packages from 7da2374 to f38b780 (2 revisions) (flutter/flutter#155760) 2024-09-26 49699333+dependabot[bot]@users.noreply.github.com Bump codecov/codecov-action from 4.4.1 to 4.5.0 (flutter/flutter#150229) 2024-09-26 [email protected] Roll Flutter Engine from 08f935236e45 to 6328a0597b68 (1 revision) (flutter/flutter#155750) 2024-09-26 [email protected] Roll Flutter Engine from 3a520a2a4399 to 08f935236e45 (1 revision) (flutter/flutter#155748) 2024-09-26 [email protected] Reland "[flutter_tools] Cleanup of native asset related code (removes around 50% of the native asset related code) (#155430)" (flutter/flutter#155745) 2024-09-26 [email protected] Roll Flutter Engine from 896208ee5828 to 3a520a2a4399 (1 revision) (flutter/flutter#155744) 2024-09-26 [email protected] Roll Flutter Engine from fc6c85292b57 to 896208ee5828 (2 revisions) (flutter/flutter#155743) 2024-09-26 [email protected] Roll Flutter Engine from 3719454a879f to fc6c85292b57 (1 revision) (flutter/flutter#155738) 2024-09-26 [email protected] added ability to configure shadow in banner (flutter/flutter#155296) 2024-09-26 [email protected] Roll Flutter Engine from d4850c1ae648 to 3719454a879f (1 revision) (flutter/flutter#155736) 2024-09-26 [email protected] Roll Flutter Engine from d6d5fdba6ae1 to d4850c1ae648 (18 revisions) (flutter/flutter#155733) 2024-09-25 [email protected] Move the Linux runner into a subdirectory (flutter/flutter#153812) 2024-09-25 49699333+dependabot[bot]@users.noreply.github.com Bump actions/checkout from 4.1.7 to 4.2.0 (flutter/flutter#155711) 2024-09-25 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[flutter_tools] Cleanup of native asset related code (removes around 50% of the native asset related code) (#155430)" (flutter/flutter#155713) 2024-09-25 [email protected] [flutter_tools] Cleanup of native asset related code (removes around 50% of the native asset related code) (flutter/flutter#155430) 2024-09-25 [email protected] reduce warnings inside flutter.groovy file #2 (flutter/flutter#155628) 2024-09-25 [email protected] [Android] Update `SystemUiMode` and `setSystemChromeEnabledSystemUIMode ` docs to note targeting Android 15+ change (flutter/flutter#153466) 2024-09-25 [email protected] mark linux packages autoroller bringup: true (flutter/flutter#155705) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
thejitenpatel
pushed a commit
to thejitenpatel/flutter
that referenced
this pull request
Sep 27, 2024
… around 50% of the native asset related code) (flutter#155430)" (flutter#155745) Changes to original CL: The code that issues an error on unsupported operating system in the dry-run case was missing a case for iOS and Android Original CL description tl;dr Removes 50% (>1650 locs) of native asset related code in `packages/flutter_tools` Before this PR the invocation of dart build/link/dry-run was implemented per OS. This lead to very large code duplication of almost identical, but slightly different code. It also led to similarly duplicated test code. Almost the entire dart build/link/dry-run implementation is identical across OSes. There's small variations: - configuration of the build (e.g. android/macos/ios version, ios sdk, ...) - determining target locations & copying the final shared libraries This PR unifies the implementation by reducing the code to basically two main functions: * `runFlutterSpecificDartBuild` which is responsible for - obtain flutter configuration - perform dart build (& link) - determine target location & install binaries * `runFlutterSpecificDartDryRunOnPlatforms` which is responsible for a similar (but not same): - obtain flutter configuration - perform dart dry run - determine target location these two functions will call out to helpers for the OS specific functionality: * `_assetTargetLocationsForOS` for determining the location of the code assets * `_copyNativeCodeAssetsForOS` for copying the code assets (and possibly overriting the install name, etc) => Since we get rid of the code duplication across OSes and have only a single code path for the build/link/dry-run, we can also remove the duplicated tests that were pretty much identical across OSes. We also harden the building code by adding asserts, e.g. * the dry fun functionality should never be used by `flutter test` * the `build/native_assets/<os>/native_assets.yaml` should only be used by `flutter test` and the dry-run of `flutter run` => We change the tests to also comply with these invariants (so the tests are not testing things that cannot happen in reality) We also rename `{,Flutter}NativeAssetsBuildRunner` to disambiguate it from the `package:native_asset_builder`'s `NativeAssetsBuildRunner`.
thejitenpatel
pushed a commit
to thejitenpatel/flutter
that referenced
this pull request
Sep 27, 2024
… around 50% of the native asset related code) (flutter#155430)" (flutter#155745) Changes to original CL: The code that issues an error on unsupported operating system in the dry-run case was missing a case for iOS and Android Original CL description tl;dr Removes 50% (>1650 locs) of native asset related code in `packages/flutter_tools` Before this PR the invocation of dart build/link/dry-run was implemented per OS. This lead to very large code duplication of almost identical, but slightly different code. It also led to similarly duplicated test code. Almost the entire dart build/link/dry-run implementation is identical across OSes. There's small variations: - configuration of the build (e.g. android/macos/ios version, ios sdk, ...) - determining target locations & copying the final shared libraries This PR unifies the implementation by reducing the code to basically two main functions: * `runFlutterSpecificDartBuild` which is responsible for - obtain flutter configuration - perform dart build (& link) - determine target location & install binaries * `runFlutterSpecificDartDryRunOnPlatforms` which is responsible for a similar (but not same): - obtain flutter configuration - perform dart dry run - determine target location these two functions will call out to helpers for the OS specific functionality: * `_assetTargetLocationsForOS` for determining the location of the code assets * `_copyNativeCodeAssetsForOS` for copying the code assets (and possibly overriting the install name, etc) => Since we get rid of the code duplication across OSes and have only a single code path for the build/link/dry-run, we can also remove the duplicated tests that were pretty much identical across OSes. We also harden the building code by adding asserts, e.g. * the dry fun functionality should never be used by `flutter test` * the `build/native_assets/<os>/native_assets.yaml` should only be used by `flutter test` and the dry-run of `flutter run` => We change the tests to also comply with these invariants (so the tests are not testing things that cannot happen in reality) We also rename `{,Flutter}NativeAssetsBuildRunner` to disambiguate it from the `package:native_asset_builder`'s `NativeAssetsBuildRunner`.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 11, 2024
…(removes around 50% of the native asset related code) (#155430)" (flutter/flutter#155745)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 12, 2024
…(removes around 50% of the native asset related code) (#155430)" (flutter/flutter#155745)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes to original CL: The code that issues an error on unsupported
operating system in the dry-run case was missing a case for iOS and
Android
Original CL description
tl;dr Removes 50% (>1650 locs) of native asset related code in
packages/flutter_toolsBefore this PR the invocation of dart build/link/dry-run was implemented
per OS. This lead to very large code duplication of almost identical,
but slightly different code. It also led to similarly duplicated test
code.
Almost the entire dart build/link/dry-run implementation is identical
across OSes. There's small variations:
This PR unifies the implementation by reducing the code to basically two
main functions:
runFlutterSpecificDartDryRunOnPlatformswhich is responsible for asimilar (but not same):
these two functions will call out to helpers for the OS specific
functionality:
_assetTargetLocationsForOSfor determining the location of the codeassets
_copyNativeCodeAssetsForOSfor copying the code assets (and possiblyoverriting the install name, etc)
=> Since we get rid of the code duplication across OSes and have only a
single code path for the build/link/dry-run, we can also remove the
duplicated tests that were pretty much identical across OSes.
We also harden the building code by adding asserts, e.g.
=> We change the tests to also comply with these invariants (so the
tests are not testing things that cannot happen in reality)
We also rename
{,Flutter}NativeAssetsBuildRunnerto disambiguate itfrom the
package:native_asset_builder'sNativeAssetsBuildRunner.