From 8d0ec0e1d01db7d8e17379fdb5af7b1bcb108d68 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 1 May 2025 11:30:20 +0200 Subject: [PATCH] [native assets] Roll dependencies --- .../hook_user_defines/hook/build.dart | 2 +- .../hook_user_defines/pubspec.yaml | 7 +++--- .../link_hook/hook/build.dart | 4 ++-- .../link_hook/hook/link.dart | 4 ++-- dev/integration_tests/link_hook/pubspec.yaml | 7 +++--- .../native_assets/android/native_assets.dart | 4 ++-- .../native_assets/ios/native_assets.dart | 4 ++-- .../native_assets/linux/native_assets.dart | 2 +- .../native_assets/macos/native_assets.dart | 4 ++-- .../macos/native_assets_host.dart | 2 +- .../isolated/native_assets/native_assets.dart | 10 ++++---- .../native_assets/test/native_assets.dart | 2 +- .../native_assets/windows/native_assets.dart | 2 +- .../lib/src/update_packages_pins.dart | 10 ++++---- packages/flutter_tools/pubspec.yaml | 7 +++--- .../package_ffi/hook/build.dart.tmpl | 2 +- .../templates/package_ffi/pubspec.yaml.tmpl | 5 ++-- .../isolated/android/native_assets_test.dart | 2 +- .../fake_native_assets_build_runner.dart | 10 ++++---- .../isolated/ios/native_assets_test.dart | 4 ++-- .../isolated/linux/native_assets_test.dart | 2 +- .../macos/native_assets_host_test.dart | 2 +- .../isolated/macos/native_assets_test.dart | 4 ++-- .../isolated/native_assets_test.dart | 2 +- .../isolated/windows/native_assets_test.dart | 6 ++--- .../isolated/native_assets_test.dart | 6 ++--- .../isolated/native_assets_test_utils.dart | 4 ++-- ...e_assets_without_cbuild_assemble_test.dart | 24 +++++++++---------- 28 files changed, 75 insertions(+), 69 deletions(-) diff --git a/dev/integration_tests/hook_user_defines/hook/build.dart b/dev/integration_tests/hook_user_defines/hook/build.dart index a1a1c0cb2fea8..d1d857e7b8598 100644 --- a/dev/integration_tests/hook_user_defines/hook/build.dart +++ b/dev/integration_tests/hook_user_defines/hook/build.dart @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:hooks/hooks.dart'; import 'package:logging/logging.dart'; -import 'package:native_assets_cli/native_assets_cli.dart'; import 'package:native_toolchain_c/native_toolchain_c.dart'; void main(List args) async { diff --git a/dev/integration_tests/hook_user_defines/pubspec.yaml b/dev/integration_tests/hook_user_defines/pubspec.yaml index 51b62df1fd87e..9f2f9fc5b9a71 100644 --- a/dev/integration_tests/hook_user_defines/pubspec.yaml +++ b/dev/integration_tests/hook_user_defines/pubspec.yaml @@ -11,9 +11,10 @@ hooks: magic_value: 1000 dependencies: + code_assets: 0.19.0 + hooks: 0.19.0 logging: 1.3.0 - native_assets_cli: 0.18.0 - native_toolchain_c: 0.15.0 + native_toolchain_c: 0.16.0 async: 2.13.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" collection: 1.19.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" @@ -74,4 +75,4 @@ dev_dependencies: webkit_inspection_protocol: 1.2.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" yaml_edit: 2.2.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" -# PUBSPEC CHECKSUM: 63c9 +# PUBSPEC CHECKSUM: c6ed diff --git a/dev/integration_tests/link_hook/hook/build.dart b/dev/integration_tests/link_hook/hook/build.dart index fbe50f4b60925..5321dea6df855 100644 --- a/dev/integration_tests/link_hook/hook/build.dart +++ b/dev/integration_tests/link_hook/hook/build.dart @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:code_assets/code_assets.dart'; +import 'package:hooks/hooks.dart'; import 'package:logging/logging.dart'; -import 'package:native_assets_cli/code_assets.dart'; -import 'package:native_assets_cli/native_assets_cli.dart'; import 'package:native_toolchain_c/native_toolchain_c.dart'; void main(List args) async { diff --git a/dev/integration_tests/link_hook/hook/link.dart b/dev/integration_tests/link_hook/hook/link.dart index af7910d3e494d..3934d9f95b817 100644 --- a/dev/integration_tests/link_hook/hook/link.dart +++ b/dev/integration_tests/link_hook/hook/link.dart @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:native_assets_cli/code_assets.dart'; -import 'package:native_assets_cli/native_assets_cli.dart'; +import 'package:code_assets/code_assets.dart'; +import 'package:hooks/hooks.dart'; void main(List args) async { await link(args, (LinkInput input, LinkOutputBuilder output) async { diff --git a/dev/integration_tests/link_hook/pubspec.yaml b/dev/integration_tests/link_hook/pubspec.yaml index 1c613bbc758b4..4b8672b0ed0b4 100644 --- a/dev/integration_tests/link_hook/pubspec.yaml +++ b/dev/integration_tests/link_hook/pubspec.yaml @@ -6,9 +6,10 @@ environment: sdk: ^3.7.0-0 dependencies: + code_assets: 0.19.0 + hooks: 0.19.0 logging: 1.3.0 - native_assets_cli: 0.18.0 - native_toolchain_c: 0.15.0 + native_toolchain_c: 0.16.0 async: 2.13.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" collection: 1.19.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" @@ -69,4 +70,4 @@ dev_dependencies: webkit_inspection_protocol: 1.2.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" yaml_edit: 2.2.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" -# PUBSPEC CHECKSUM: 63c9 +# PUBSPEC CHECKSUM: c6ed diff --git a/packages/flutter_tools/lib/src/isolated/native_assets/android/native_assets.dart b/packages/flutter_tools/lib/src/isolated/native_assets/android/native_assets.dart index 3ab77560145c5..9f507317a4670 100644 --- a/packages/flutter_tools/lib/src/isolated/native_assets/android/native_assets.dart +++ b/packages/flutter_tools/lib/src/isolated/native_assets/android/native_assets.dart @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:native_assets_builder/native_assets_builder.dart'; -import 'package:native_assets_cli/code_assets.dart'; +import 'package:code_assets/code_assets.dart'; +import 'package:hooks_runner/hooks_runner.dart'; import '../../../android/android_sdk.dart'; import '../../../android/gradle_utils.dart'; diff --git a/packages/flutter_tools/lib/src/isolated/native_assets/ios/native_assets.dart b/packages/flutter_tools/lib/src/isolated/native_assets/ios/native_assets.dart index 0b6c18dd592e8..e0fb0920a9a47 100644 --- a/packages/flutter_tools/lib/src/isolated/native_assets/ios/native_assets.dart +++ b/packages/flutter_tools/lib/src/isolated/native_assets/ios/native_assets.dart @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:native_assets_builder/native_assets_builder.dart'; -import 'package:native_assets_cli/code_assets.dart'; +import 'package:code_assets/code_assets.dart'; +import 'package:hooks_runner/hooks_runner.dart'; import '../../../base/file_system.dart'; import '../../../build_info.dart'; diff --git a/packages/flutter_tools/lib/src/isolated/native_assets/linux/native_assets.dart b/packages/flutter_tools/lib/src/isolated/native_assets/linux/native_assets.dart index 4f33ec8d544c1..2beb32e405393 100644 --- a/packages/flutter_tools/lib/src/isolated/native_assets/linux/native_assets.dart +++ b/packages/flutter_tools/lib/src/isolated/native_assets/linux/native_assets.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:native_assets_cli/code_assets.dart'; +import 'package:code_assets/code_assets.dart'; import '../../../base/common.dart'; import '../../../base/file_system.dart'; diff --git a/packages/flutter_tools/lib/src/isolated/native_assets/macos/native_assets.dart b/packages/flutter_tools/lib/src/isolated/native_assets/macos/native_assets.dart index 231eed776537e..22084fee56216 100644 --- a/packages/flutter_tools/lib/src/isolated/native_assets/macos/native_assets.dart +++ b/packages/flutter_tools/lib/src/isolated/native_assets/macos/native_assets.dart @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:native_assets_builder/native_assets_builder.dart'; -import 'package:native_assets_cli/code_assets.dart'; +import 'package:code_assets/code_assets.dart'; +import 'package:hooks_runner/hooks_runner.dart'; import '../../../base/file_system.dart'; import '../../../build_info.dart'; diff --git a/packages/flutter_tools/lib/src/isolated/native_assets/macos/native_assets_host.dart b/packages/flutter_tools/lib/src/isolated/native_assets/macos/native_assets_host.dart index 463bec7d7981d..854fb2f0b2393 100644 --- a/packages/flutter_tools/lib/src/isolated/native_assets/macos/native_assets_host.dart +++ b/packages/flutter_tools/lib/src/isolated/native_assets/macos/native_assets_host.dart @@ -4,7 +4,7 @@ // Shared logic between iOS and macOS implementations of native assets. -import 'package:native_assets_cli/code_assets.dart'; +import 'package:code_assets/code_assets.dart'; import '../../../base/common.dart'; import '../../../base/file_system.dart'; diff --git a/packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart b/packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart index 9e61660cb6239..647d803070037 100644 --- a/packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart +++ b/packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart @@ -4,10 +4,10 @@ // Logic for native assets shared between all host OSes. +import 'package:code_assets/code_assets.dart'; +import 'package:hooks/hooks.dart'; +import 'package:hooks_runner/hooks_runner.dart'; import 'package:logging/logging.dart' as logging; -import 'package:native_assets_builder/native_assets_builder.dart'; -import 'package:native_assets_cli/code_assets.dart'; -import 'package:native_assets_cli/native_assets_cli.dart'; import 'package:package_config/package_config_types.dart'; import '../../base/common.dart'; @@ -179,7 +179,7 @@ Future installCodeAssets({ /// Programmatic API to be used by Dart launchers to invoke native builds. /// -/// It enables mocking `package:native_assets_builder` package. +/// It enables mocking `package:hooks_runner` package. /// It also enables mocking native toolchain discovery via [cCompilerConfig]. abstract interface class FlutterNativeAssetsBuildRunner { /// All packages in the transitive dependencies that have a `build.dart`. @@ -204,7 +204,7 @@ abstract interface class FlutterNativeAssetsBuildRunner { Future get ndkCCompilerConfig; } -/// Uses `package:native_assets_builder` for its implementation. +/// Uses `package:hooks_runner` for its implementation. class FlutterNativeAssetsBuildRunnerImpl implements FlutterNativeAssetsBuildRunner { FlutterNativeAssetsBuildRunnerImpl( this.packageConfigPath, diff --git a/packages/flutter_tools/lib/src/isolated/native_assets/test/native_assets.dart b/packages/flutter_tools/lib/src/isolated/native_assets/test/native_assets.dart index c1c373f537777..28d8d6951935c 100644 --- a/packages/flutter_tools/lib/src/isolated/native_assets/test/native_assets.dart +++ b/packages/flutter_tools/lib/src/isolated/native_assets/test/native_assets.dart @@ -4,7 +4,7 @@ // Logic for native assets shared between all host OSes. -import 'package:native_assets_cli/code_assets.dart' show OS; +import 'package:code_assets/code_assets.dart' show OS; import 'package:package_config/package_config_types.dart'; import '../../../base/platform.dart'; diff --git a/packages/flutter_tools/lib/src/isolated/native_assets/windows/native_assets.dart b/packages/flutter_tools/lib/src/isolated/native_assets/windows/native_assets.dart index b95727778e27d..bdd0d8ba9117f 100644 --- a/packages/flutter_tools/lib/src/isolated/native_assets/windows/native_assets.dart +++ b/packages/flutter_tools/lib/src/isolated/native_assets/windows/native_assets.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:native_assets_cli/code_assets.dart'; +import 'package:code_assets/code_assets.dart'; import '../../../globals.dart' as globals; import '../../../windows/visual_studio.dart'; diff --git a/packages/flutter_tools/lib/src/update_packages_pins.dart b/packages/flutter_tools/lib/src/update_packages_pins.dart index 6ea2dd226a9f0..c783af1786e07 100644 --- a/packages/flutter_tools/lib/src/update_packages_pins.dart +++ b/packages/flutter_tools/lib/src/update_packages_pins.dart @@ -21,13 +21,15 @@ const Map kManuallyPinnedDependencies = { // Add pinned packages here. Please leave a comment explaining why. 'archive': '3.6.1', // https://github.com/flutter/flutter/issues/115660 + 'code_assets': + '0.19.0', // Under active development with breaking changes until 1.0.0. Manually rolled by @dcharkes. 'flutter_gallery_assets': '1.0.2', // Tests depend on the exact version. 'flutter_template_images': '5.0.0', // Must always exactly match flutter_tools template. 'google_mobile_ads': '5.1.0', // https://github.com/flutter/flutter/issues/156912 - 'native_assets_builder': - '0.18.0', // Under active development with breaking changes until 1.0.0. Manually rolled by @dcharkes. - 'native_assets_cli': - '0.18.0', // Under active development with breaking changes until 1.0.0. Manually rolled by @dcharkes. + 'hooks': + '0.19.0', // Under active development with breaking changes until 1.0.0. Manually rolled by @dcharkes. + 'hooks_runner': + '0.19.0', // Under active development with breaking changes until 1.0.0. Manually rolled by @dcharkes. 'material_color_utilities': '0.11.1', // Keep pinned to latest until 1.0.0. 'leak_tracker': '11.0.1', // https://github.com/flutter/devtools/issues/3951 'leak_tracker_testing': '3.0.2', // https://github.com/flutter/devtools/issues/3951 diff --git a/packages/flutter_tools/pubspec.yaml b/packages/flutter_tools/pubspec.yaml index cc5df6676db1e..0666dfcebdcc4 100644 --- a/packages/flutter_tools/pubspec.yaml +++ b/packages/flutter_tools/pubspec.yaml @@ -55,8 +55,9 @@ dependencies: unified_analytics: 8.0.1 graphs: 2.3.2 - native_assets_builder: 0.18.0 - native_assets_cli: 0.18.0 + hooks_runner: 0.19.0 + hooks: 0.19.0 + code_assets: 0.19.0 # We depend on very specific internal implementation details of the # 'test' package, which change between versions, so when upgrading @@ -123,4 +124,4 @@ dartdoc: # Exclude this package from the hosted API docs. nodoc: true -# PUBSPEC CHECKSUM: 38a0 +# PUBSPEC CHECKSUM: 771f diff --git a/packages/flutter_tools/templates/package_ffi/hook/build.dart.tmpl b/packages/flutter_tools/templates/package_ffi/hook/build.dart.tmpl index 0510ff2e323b7..e33e0554bfc68 100644 --- a/packages/flutter_tools/templates/package_ffi/hook/build.dart.tmpl +++ b/packages/flutter_tools/templates/package_ffi/hook/build.dart.tmpl @@ -1,6 +1,6 @@ import 'package:native_toolchain_c/native_toolchain_c.dart'; import 'package:logging/logging.dart'; -import 'package:native_assets_cli/native_assets_cli.dart'; +import 'package:hooks/hooks.dart'; void main(List args) async { await build(args, (input, output) async { diff --git a/packages/flutter_tools/templates/package_ffi/pubspec.yaml.tmpl b/packages/flutter_tools/templates/package_ffi/pubspec.yaml.tmpl index 51b55e7626e6f..5549010254c2a 100644 --- a/packages/flutter_tools/templates/package_ffi/pubspec.yaml.tmpl +++ b/packages/flutter_tools/templates/package_ffi/pubspec.yaml.tmpl @@ -7,9 +7,10 @@ environment: sdk: {{dartSdkVersionBounds}} dependencies: + code_assets: ^0.19.0 + hooks: ^0.19.0 logging: ^1.3.0 - native_assets_cli: ^0.18.0 - native_toolchain_c: ^0.15.0 + native_toolchain_c: ^0.16.0 dev_dependencies: ffi: ^2.1.3 diff --git a/packages/flutter_tools/test/general.shard/isolated/android/native_assets_test.dart b/packages/flutter_tools/test/general.shard/isolated/android/native_assets_test.dart index 84991197bb1c9..d044ad15ba44b 100644 --- a/packages/flutter_tools/test/general.shard/isolated/android/native_assets_test.dart +++ b/packages/flutter_tools/test/general.shard/isolated/android/native_assets_test.dart @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:code_assets/code_assets.dart'; import 'package:file/file.dart'; import 'package:file/memory.dart'; import 'package:file_testing/file_testing.dart'; @@ -17,7 +18,6 @@ import 'package:flutter_tools/src/build_system/targets/native_assets.dart'; import 'package:flutter_tools/src/features.dart'; import 'package:flutter_tools/src/globals.dart' as globals; import 'package:flutter_tools/src/isolated/native_assets/native_assets.dart'; -import 'package:native_assets_cli/code_assets.dart'; import '../../../src/common.dart'; import '../../../src/context.dart'; diff --git a/packages/flutter_tools/test/general.shard/isolated/fake_native_assets_build_runner.dart b/packages/flutter_tools/test/general.shard/isolated/fake_native_assets_build_runner.dart index d0f59f865c576..c5896ddaf790e 100644 --- a/packages/flutter_tools/test/general.shard/isolated/fake_native_assets_build_runner.dart +++ b/packages/flutter_tools/test/general.shard/isolated/fake_native_assets_build_runner.dart @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:code_assets/code_assets.dart'; import 'package:flutter_tools/src/isolated/native_assets/native_assets.dart'; -import 'package:native_assets_builder/native_assets_builder.dart'; -import 'package:native_assets_cli/code_assets.dart'; -import 'package:native_assets_cli/native_assets_cli.dart'; +import 'package:hooks/hooks.dart'; +import 'package:hooks_runner/hooks_runner.dart'; -export 'package:native_assets_cli/code_assets.dart' show CodeAsset, DynamicLoadingBundled; +export 'package:code_assets/code_assets.dart' show CodeAsset, DynamicLoadingBundled; -/// Mocks all logic instead of using `package:native_assets_builder`, which +/// Mocks all logic instead of using `package:hooks_runner`, which /// relies on doing process calls to `pub` and the local file system. class FakeFlutterNativeAssetsBuildRunner implements FlutterNativeAssetsBuildRunner { FakeFlutterNativeAssetsBuildRunner({ diff --git a/packages/flutter_tools/test/general.shard/isolated/ios/native_assets_test.dart b/packages/flutter_tools/test/general.shard/isolated/ios/native_assets_test.dart index 804ce72b2f182..b3a51c41d1ee4 100644 --- a/packages/flutter_tools/test/general.shard/isolated/ios/native_assets_test.dart +++ b/packages/flutter_tools/test/general.shard/isolated/ios/native_assets_test.dart @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:code_assets/code_assets.dart'; import 'package:file/file.dart'; import 'package:file/memory.dart'; import 'package:file_testing/file_testing.dart'; @@ -15,8 +16,7 @@ import 'package:flutter_tools/src/build_system/targets/native_assets.dart'; import 'package:flutter_tools/src/features.dart'; import 'package:flutter_tools/src/globals.dart' as globals; import 'package:flutter_tools/src/isolated/native_assets/native_assets.dart'; -import 'package:native_assets_cli/code_assets.dart'; -import 'package:native_assets_cli/native_assets_cli.dart'; +import 'package:hooks/hooks.dart'; import '../../../src/common.dart'; import '../../../src/context.dart'; diff --git a/packages/flutter_tools/test/general.shard/isolated/linux/native_assets_test.dart b/packages/flutter_tools/test/general.shard/isolated/linux/native_assets_test.dart index 318e9dd84b8cc..8e5fcc0545437 100644 --- a/packages/flutter_tools/test/general.shard/isolated/linux/native_assets_test.dart +++ b/packages/flutter_tools/test/general.shard/isolated/linux/native_assets_test.dart @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:code_assets/code_assets.dart'; import 'package:file/file.dart'; import 'package:file/memory.dart'; import 'package:flutter_tools/src/artifacts.dart'; @@ -15,7 +16,6 @@ import 'package:flutter_tools/src/dart/package_map.dart'; import 'package:flutter_tools/src/features.dart'; import 'package:flutter_tools/src/globals.dart' as globals; import 'package:flutter_tools/src/isolated/native_assets/native_assets.dart'; -import 'package:native_assets_cli/code_assets.dart'; import 'package:package_config/package_config_types.dart'; import '../../../src/common.dart'; diff --git a/packages/flutter_tools/test/general.shard/isolated/macos/native_assets_host_test.dart b/packages/flutter_tools/test/general.shard/isolated/macos/native_assets_host_test.dart index 9a95f7143a3c4..f8579865de740 100644 --- a/packages/flutter_tools/test/general.shard/isolated/macos/native_assets_host_test.dart +++ b/packages/flutter_tools/test/general.shard/isolated/macos/native_assets_host_test.dart @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:code_assets/code_assets.dart'; import 'package:flutter_tools/src/isolated/native_assets/macos/native_assets_host.dart'; -import 'package:native_assets_cli/code_assets.dart'; import '../../../src/common.dart'; diff --git a/packages/flutter_tools/test/general.shard/isolated/macos/native_assets_test.dart b/packages/flutter_tools/test/general.shard/isolated/macos/native_assets_test.dart index 1924fedf7a0b3..9991bdf5a534e 100644 --- a/packages/flutter_tools/test/general.shard/isolated/macos/native_assets_test.dart +++ b/packages/flutter_tools/test/general.shard/isolated/macos/native_assets_test.dart @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:code_assets/code_assets.dart'; import 'package:file/file.dart'; import 'package:file/memory.dart'; import 'package:flutter_tools/src/artifacts.dart'; @@ -15,8 +16,7 @@ import 'package:flutter_tools/src/dart/package_map.dart'; import 'package:flutter_tools/src/features.dart'; import 'package:flutter_tools/src/globals.dart' as globals; import 'package:flutter_tools/src/isolated/native_assets/native_assets.dart'; -import 'package:native_assets_cli/code_assets.dart'; -import 'package:native_assets_cli/native_assets_cli.dart'; +import 'package:hooks/hooks.dart'; import 'package:package_config/package_config_types.dart'; import '../../../src/common.dart'; diff --git a/packages/flutter_tools/test/general.shard/isolated/native_assets_test.dart b/packages/flutter_tools/test/general.shard/isolated/native_assets_test.dart index e4c8c054e72d2..927158595124f 100644 --- a/packages/flutter_tools/test/general.shard/isolated/native_assets_test.dart +++ b/packages/flutter_tools/test/general.shard/isolated/native_assets_test.dart @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:code_assets/code_assets.dart'; import 'package:file/file.dart'; import 'package:file/memory.dart'; import 'package:file_testing/file_testing.dart'; @@ -13,7 +14,6 @@ import 'package:flutter_tools/src/build_system/build_system.dart'; import 'package:flutter_tools/src/build_system/targets/native_assets.dart'; import 'package:flutter_tools/src/features.dart'; import 'package:flutter_tools/src/isolated/native_assets/native_assets.dart'; -import 'package:native_assets_cli/code_assets.dart'; import '../../src/common.dart'; import '../../src/context.dart'; diff --git a/packages/flutter_tools/test/general.shard/isolated/windows/native_assets_test.dart b/packages/flutter_tools/test/general.shard/isolated/windows/native_assets_test.dart index 317a53da3b56b..c9a57faa2b9a2 100644 --- a/packages/flutter_tools/test/general.shard/isolated/windows/native_assets_test.dart +++ b/packages/flutter_tools/test/general.shard/isolated/windows/native_assets_test.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:code_assets/code_assets.dart' as code_assets; +import 'package:code_assets/code_assets.dart'; import 'package:file/file.dart'; import 'package:file/memory.dart'; import 'package:flutter_tools/src/artifacts.dart'; @@ -15,8 +17,6 @@ import 'package:flutter_tools/src/dart/package_map.dart'; import 'package:flutter_tools/src/features.dart'; import 'package:flutter_tools/src/globals.dart' as globals; import 'package:flutter_tools/src/isolated/native_assets/native_assets.dart'; -import 'package:native_assets_cli/code_assets.dart' as native_assets_cli; -import 'package:native_assets_cli/code_assets.dart'; import 'package:package_config/package_config_types.dart'; import '../../../src/common.dart'; @@ -113,7 +113,7 @@ void main() { buildRunner: buildRunner, ); final String expectedDirectory = - flutterTester ? native_assets_cli.OS.current.toString() : 'windows'; + flutterTester ? code_assets.OS.current.toString() : 'windows'; final Uri nativeAssetsFileUri = flutterTester ? projectUri.resolve( diff --git a/packages/flutter_tools/test/integration.shard/isolated/native_assets_test.dart b/packages/flutter_tools/test/integration.shard/isolated/native_assets_test.dart index df86832693817..8d78631f4501c 100644 --- a/packages/flutter_tools/test/integration.shard/isolated/native_assets_test.dart +++ b/packages/flutter_tools/test/integration.shard/isolated/native_assets_test.dart @@ -14,12 +14,12 @@ library; import 'dart:convert'; import 'dart:io'; +import 'package:code_assets/code_assets.dart'; import 'package:file/file.dart'; import 'package:file_testing/file_testing.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/base/os.dart'; -import 'package:native_assets_cli/code_assets.dart'; -import 'package:native_assets_cli/native_assets_cli.dart'; +import 'package:hooks/hooks.dart'; import '../../src/common.dart'; import '../test_utils.dart' show fileSystem, flutterBin, platform; @@ -455,7 +455,7 @@ void expectDylibIsBundledWithFrameworks(Directory appDirectory, String buildMode /// This inspects the build configuration to see if the C compiler was configured. void expectCCompilerIsConfigured(Directory appDirectory) { final Directory nativeAssetsBuilderDir = appDirectory.childDirectory( - '.dart_tool/native_assets_builder/$packageName/', + '.dart_tool/hooks_runner/$packageName/', ); for (final Directory subDir in nativeAssetsBuilderDir.listSync().whereType()) { // We only want to look at build/link hook invocation directories. The diff --git a/packages/flutter_tools/test/integration.shard/isolated/native_assets_test_utils.dart b/packages/flutter_tools/test/integration.shard/isolated/native_assets_test_utils.dart index ff68e61294340..8a693986ef9f9 100644 --- a/packages/flutter_tools/test/integration.shard/isolated/native_assets_test_utils.dart +++ b/packages/flutter_tools/test/integration.shard/isolated/native_assets_test_utils.dart @@ -214,8 +214,8 @@ FFI_PLUGIN_EXPORT intptr_t add(intptr_t a, intptr_t b) { const String builderSource = r''' import 'package:logging/logging.dart'; -import 'package:native_assets_cli/native_assets_cli.dart'; -import 'package:native_assets_cli/code_assets.dart'; +import 'package:hooks/hooks.dart'; +import 'package:code_assets/code_assets.dart'; import 'package:native_toolchain_c/native_toolchain_c.dart'; void main(List args) async { diff --git a/packages/flutter_tools/test/integration.shard/isolated/native_assets_without_cbuild_assemble_test.dart b/packages/flutter_tools/test/integration.shard/isolated/native_assets_without_cbuild_assemble_test.dart index d4ac366b39d34..81f6478208def 100644 --- a/packages/flutter_tools/test/integration.shard/isolated/native_assets_without_cbuild_assemble_test.dart +++ b/packages/flutter_tools/test/integration.shard/isolated/native_assets_without_cbuild_assemble_test.dart @@ -16,15 +16,15 @@ import 'native_assets_test_utils.dart'; /// Regression test as part of https://github.com/flutter/flutter/pull/150742. /// /// Previously, creating a new (blank, i.e. from `flutter create`) Flutter -/// project, adding `native_assets_cli`, and adding an otherwise valid build hook +/// project, adding `hooks`, and adding an otherwise valid build hook /// (`/hook/build.dart`) would fail to build due to the accompanying shell script /// (at least on macOS) assuming the glob would find at least one output. /// -/// This test verifies that a blank Flutter project with native_assets_cli can +/// This test verifies that a blank Flutter project with hooks can /// build, and does so across all of the host platform and target platform /// combinations that could trigger this error. /// -/// The version of `native_assets_cli` is derived from the template used by +/// The version of `hooks` is derived from the template used by /// `flutter create --type=packages_ffi`. See /// [_getPackageFfiTemplatePubspecVersion]. void main() { @@ -54,7 +54,7 @@ void main() { _testBuildCommand( buildCommand: buildCommand, processManager: processManager, - nativeAssetsCliVersionConstraint: constraint, + hooksVersionConstraint: constraint, codeSign: buildCommand != 'ios', ); } @@ -62,13 +62,13 @@ void main() { void _testBuildCommand({ required String buildCommand, - required String nativeAssetsCliVersionConstraint, + required String hooksVersionConstraint, required ProcessManager processManager, required bool codeSign, }) { testWithoutContext('flutter build "$buildCommand" succeeds without libraries', () async { await inTempDir((Directory tempDirectory) async { - const String packageName = 'uses_package_native_assets_cli'; + const String packageName = 'uses_package_hooks'; // Create a new (plain Dart SDK) project. await expectLater( @@ -83,14 +83,14 @@ void _testBuildCommand({ final Directory packageDirectory = tempDirectory.childDirectory(packageName); - // Add native_assets_cli and resolve implicitly (pub add does pub get). + // Add hooks and resolve implicitly (pub add does pub get). // See https://dart.dev/tools/pub/cmd/pub-add#version-constraint. await expectLater( processManager.run([ flutterBin, 'packages', 'add', - 'native_assets_cli:$nativeAssetsCliVersionConstraint', + 'hooks:$hooksVersionConstraint', ], workingDirectory: packageDirectory.path), completion(const ProcessResultMatcher()), ); @@ -99,7 +99,7 @@ void _testBuildCommand({ packageDirectory.childDirectory('hook').childFile('build.dart') ..createSync(recursive: true) ..writeAsStringSync(''' -import 'package:native_assets_cli/native_assets_cli.dart'; +import 'package:hooks/hooks.dart'; void main(List args) async { await build(args, (config, output) async {}); @@ -132,10 +132,10 @@ void main(List args) async { /// For example, if the template would output: /// ```yaml /// dependencies: -/// native_assets_cli: ^0.8.0 +/// hooks: ^0.19.0 /// ``` /// -/// ... then this function would return `'^0.8.0'`. +/// ... then this function would return `'^0.19.0'`. String _getPackageFfiTemplatePubspecVersion() { final String path = Context().join( getFlutterRoot(), @@ -151,6 +151,6 @@ String _getPackageFfiTemplatePubspecVersion() { ); final YamlMap rootNode = yaml.contents as YamlMap; final YamlMap dependencies = rootNode.nodes['dependencies']! as YamlMap; - final String version = dependencies['native_assets_cli']! as String; + final String version = dependencies['hooks']! as String; return version; }