diff --git a/pkgs/native_assets_builder/CHANGELOG.md b/pkgs/native_assets_builder/CHANGELOG.md index 5ccb227cd..7f60b74ef 100644 --- a/pkgs/native_assets_builder/CHANGELOG.md +++ b/pkgs/native_assets_builder/CHANGELOG.md @@ -1,5 +1,11 @@ ## 0.9.1-wip +- **Breaking change**: Rename `supportedAssetTypes` to `buildAssetTypes`. Hooks + should no longer fail. Instead, the code should fail at runtime if an asset is + missing. This enables (1) code to run if an asset is missing but that code is + not invoked at runtime, and (2) doing fallback implementations in Dart if an + asset is missing. + ## 0.9.0 - Also lock `BuildConfig` and `LinkConfig` `outputDirectoryShared` when invoking diff --git a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart index b19c2a47d..b139f5861 100644 --- a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart +++ b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart @@ -98,7 +98,7 @@ class NativeAssetsBuildRunner { required Uri workingDirectory, PackageLayout? packageLayout, String? runPackageName, - required List supportedAssetTypes, + required List buildAssetTypes, required bool linkingEnabled, }) async { packageLayout ??= await PackageLayout.fromRootPackageRoot(workingDirectory); @@ -124,7 +124,7 @@ class NativeAssetsBuildRunner { final configBuilder = configCreator() ..setupHookConfig( targetOS: targetOS, - supportedAssetTypes: supportedAssetTypes, + buildAssetTypes: buildAssetTypes, buildMode: buildMode, packageName: package.name, packageRoot: packageLayout.packageRoot(package.name), @@ -206,7 +206,7 @@ class NativeAssetsBuildRunner { PackageLayout? packageLayout, Uri? resourceIdentifiers, String? runPackageName, - required List supportedAssetTypes, + required List buildAssetTypes, required BuildResult buildResult, }) async { packageLayout ??= await PackageLayout.fromRootPackageRoot(workingDirectory); @@ -224,7 +224,7 @@ class NativeAssetsBuildRunner { final configBuilder = configCreator() ..setupHookConfig( targetOS: targetOS, - supportedAssetTypes: supportedAssetTypes, + buildAssetTypes: buildAssetTypes, buildMode: buildMode, packageName: package.name, packageRoot: packageLayout.packageRoot(package.name), @@ -328,7 +328,7 @@ class NativeAssetsBuildRunner { required bool linkingEnabled, PackageLayout? packageLayout, String? runPackageName, - required List supportedAssetTypes, + required List buildAssetTypes, }) => _runDryRun( targetOS: targetOS, @@ -338,7 +338,7 @@ class NativeAssetsBuildRunner { workingDirectory: workingDirectory, packageLayout: packageLayout, runPackageName: runPackageName, - supportedAssetTypes: supportedAssetTypes, + buildAssetTypes: buildAssetTypes, linkingEnabled: linkingEnabled, ); @@ -350,7 +350,7 @@ class NativeAssetsBuildRunner { PackageLayout? packageLayout, String? runPackageName, required bool linkingEnabled, - required List supportedAssetTypes, + required List buildAssetTypes, }) async { const hook = Hook.build; @@ -369,7 +369,7 @@ class NativeAssetsBuildRunner { final configBuilder = configCreator(); configBuilder.setupHookConfig( targetOS: targetOS, - supportedAssetTypes: supportedAssetTypes, + buildAssetTypes: buildAssetTypes, buildMode: null, // not set in dry-run mode packageName: package.name, packageRoot: packageLayout.packageRoot(package.name), diff --git a/pkgs/native_assets_builder/test/build_runner/build_dependencies_test.dart b/pkgs/native_assets_builder/test/build_runner/build_dependencies_test.dart index fd248d658..bd8ec20ae 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_dependencies_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_dependencies_test.dart @@ -31,7 +31,7 @@ void main() async { logger, dartExecutable, capturedLogs: logMessages, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_asset_id_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_asset_id_test.dart index b31dd3c4a..1563350df 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_asset_id_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_asset_id_test.dart @@ -27,7 +27,7 @@ void main() async { packageUri, createCapturingLogger(logMessages, level: Level.SEVERE), dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -63,7 +63,7 @@ void main() async { packageUri, logger, dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_build_dry_run_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_build_dry_run_test.dart index 6fe8f68a6..caf8e980a 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_build_dry_run_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_build_dry_run_test.dart @@ -28,14 +28,14 @@ void main() async { logger, dartExecutable, linkingEnabled: false, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], buildValidator: validateCodeAssetBuildOutput, ))!; final buildResult = (await build( packageUri, logger, dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_build_output_format_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_build_output_format_test.dart index 68ddeba44..65f766341 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_build_output_format_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_build_output_format_test.dart @@ -33,7 +33,7 @@ void main() async { packageUri, createCapturingLogger(logMessages, level: Level.SEVERE), dartExecutable, - supportedAssetTypes: [], + buildAssetTypes: [], configValidator: (config) async => [], buildValidator: (config, output) async => [], applicationAssetValidator: validateCodeAssetInApplication, diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart index 851458b14..ed891573f 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart @@ -30,7 +30,7 @@ void main() async { logger, dartExecutable, capturedLogs: logMessages, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -57,7 +57,7 @@ void main() async { logger, dartExecutable, capturedLogs: logMessages, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -107,7 +107,7 @@ void main() async { packageUri, logger, dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -128,7 +128,7 @@ void main() async { packageUri, logger, dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -171,7 +171,7 @@ void main() async { packageUri, logger, dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -199,7 +199,7 @@ void main() async { packageUri, logger, dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -239,7 +239,7 @@ void main() async { packageUri, logger, dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -271,7 +271,7 @@ void main() async { packageUri, logger, dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_cycle_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_cycle_test.dart index 198029f80..17476eac1 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_cycle_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_cycle_test.dart @@ -27,7 +27,7 @@ void main() async { createCapturingLogger(logMessages, level: Level.SEVERE), dartExecutable, linkingEnabled: false, - supportedAssetTypes: [], + buildAssetTypes: [], buildValidator: (config, output) async => [], ); final fullLog = logMessages.join('\n'); @@ -47,7 +47,7 @@ void main() async { packageUri, createCapturingLogger(logMessages, level: Level.SEVERE), dartExecutable, - supportedAssetTypes: [], + buildAssetTypes: [], configValidator: (config) async => [], buildValidator: (config, output) async => [], applicationAssetValidator: (_) async => [], diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_failure_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_failure_test.dart index 7b9566828..1c5bd9e40 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_failure_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_failure_test.dart @@ -28,7 +28,7 @@ void main() async { packageUri, logger, dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -56,7 +56,7 @@ void main() async { packageUri, createCapturingLogger(logMessages, level: Level.SEVERE), dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -84,7 +84,7 @@ void main() async { packageUri, logger, dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -120,7 +120,7 @@ void main() async { logger, capturedLogs: logMessages, dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_non_root_package_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_non_root_package_test.dart index 825bbe66a..662ad2235 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_non_root_package_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_non_root_package_test.dart @@ -30,7 +30,7 @@ void main() async { dartExecutable, capturedLogs: logMessages, runPackageName: 'some_dev_dep', - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateDataAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -47,7 +47,7 @@ void main() async { dartExecutable, capturedLogs: logMessages, runPackageName: 'native_add', - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateDataAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart index 2f8d34b45..193784b08 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart @@ -38,7 +38,7 @@ void main() async { targetOS: Target.current.os, workingDirectory: packageUri, linkingEnabled: false, - supportedAssetTypes: [], + buildAssetTypes: [], buildValidator: (config, output) async => [], ); await buildRunner.buildDryRun( @@ -46,7 +46,7 @@ void main() async { targetOS: Target.current.os, workingDirectory: packageUri, linkingEnabled: false, - supportedAssetTypes: [], + buildAssetTypes: [], buildValidator: (config, output) async => [], ); await buildRunner.build( @@ -55,7 +55,7 @@ void main() async { buildMode: BuildMode.release, workingDirectory: packageUri, linkingEnabled: false, - supportedAssetTypes: [], + buildAssetTypes: [], configValidator: (config) async => [], buildValidator: (config, output) async => [], applicationAssetValidator: (_) async => [], @@ -66,7 +66,7 @@ void main() async { targetOS: OS.current, workingDirectory: packageUri, linkingEnabled: false, - supportedAssetTypes: [], + buildAssetTypes: [], configValidator: (config) async => [], buildValidator: (config, output) async => [], applicationAssetValidator: (_) async => [], diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_test.dart index 239542042..70df079d1 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_test.dart @@ -33,7 +33,7 @@ void main() async { dartExecutable, capturedLogs: logMessages, configValidator: validateCodeAssetBuildConfig, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, ))!; @@ -59,7 +59,7 @@ void main() async { dartExecutable, capturedLogs: logMessages, packageLayout: packageLayout, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, diff --git a/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart b/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart index 7b9e5d5cf..afb2c0fb8 100644 --- a/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart +++ b/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart @@ -25,7 +25,7 @@ void main(List args) async { targetOS: target.os, workingDirectory: packageUri, linkingEnabled: false, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], configValidator: validateDataAssetBuildConfig, buildValidator: (config, output) async => await validateDataAssetBuildOutput(config, output), diff --git a/pkgs/native_assets_builder/test/build_runner/concurrency_test_helper.dart b/pkgs/native_assets_builder/test/build_runner/concurrency_test_helper.dart index 6d3bf6a85..870edec6d 100644 --- a/pkgs/native_assets_builder/test/build_runner/concurrency_test_helper.dart +++ b/pkgs/native_assets_builder/test/build_runner/concurrency_test_helper.dart @@ -36,7 +36,7 @@ void main(List args) async { targetOS: OS.current, workingDirectory: packageUri, linkingEnabled: false, - supportedAssetTypes: [CodeAsset.type, DataAsset.type], + buildAssetTypes: [CodeAsset.type, DataAsset.type], configValidator: (config) async => [ ...await validateDataAssetBuildConfig(config), ...await validateCodeAssetBuildConfig(config), diff --git a/pkgs/native_assets_builder/test/build_runner/conflicting_dylib_test.dart b/pkgs/native_assets_builder/test/build_runner/conflicting_dylib_test.dart index ee0f53b55..2aee76303 100644 --- a/pkgs/native_assets_builder/test/build_runner/conflicting_dylib_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/conflicting_dylib_test.dart @@ -27,7 +27,7 @@ void main() async { packageUri, createCapturingLogger(logMessages, level: Level.SEVERE), dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -58,7 +58,7 @@ void main() async { logger, linkingEnabled: true, dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -69,7 +69,7 @@ void main() async { logger, dartExecutable, buildResult: buildResult, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetLinkConfig, linkValidator: validateCodeAssetLinkOutput, applicationAssetValidator: validateCodeAssetInApplication, diff --git a/pkgs/native_assets_builder/test/build_runner/fail_on_os_sdk_version_test.dart b/pkgs/native_assets_builder/test/build_runner/fail_on_os_sdk_version_test.dart index f56edf833..072ae2f4d 100644 --- a/pkgs/native_assets_builder/test/build_runner/fail_on_os_sdk_version_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/fail_on_os_sdk_version_test.dart @@ -73,7 +73,7 @@ void main() async { packageUri, createCapturingLogger(logMessages, level: Level.SEVERE), dartExecutable, - supportedAssetTypes: [CodeAsset.type, DataAsset.type], + buildAssetTypes: [CodeAsset.type, DataAsset.type], buildConfigValidator: (config) async => [ ...await validateDataAssetBuildConfig(config), ...await validateCodeAssetBuildConfig(config), diff --git a/pkgs/native_assets_builder/test/build_runner/helpers.dart b/pkgs/native_assets_builder/test/build_runner/helpers.dart index 61f6fa343..f252da7d4 100644 --- a/pkgs/native_assets_builder/test/build_runner/helpers.dart +++ b/pkgs/native_assets_builder/test/build_runner/helpers.dart @@ -46,7 +46,7 @@ Future build( int? targetAndroidNdkApi, Target? target, bool linkingEnabled = false, - required List supportedAssetTypes, + required List buildAssetTypes, }) async { final targetOS = target?.os ?? OS.current; return await runWithLog(capturedLogs, () async { @@ -56,7 +56,7 @@ Future build( ).build( configCreator: () { final configBuilder = BuildConfigBuilder(); - if (supportedAssetTypes.contains(CodeAsset.type)) { + if (buildAssetTypes.contains(CodeAsset.type)) { configBuilder.setupCodeConfig( targetArchitecture: target?.architecture ?? Architecture.current, linkModePreference: linkModePreference, @@ -77,7 +77,7 @@ Future build( packageLayout: packageLayout, runPackageName: runPackageName, linkingEnabled: linkingEnabled, - supportedAssetTypes: supportedAssetTypes, + buildAssetTypes: buildAssetTypes, buildValidator: buildValidator, applicationAssetValidator: applicationAssetValidator, ); @@ -112,7 +112,7 @@ Future link( int? targetMacOSVersion, int? targetAndroidNdkApi, Target? target, - required List supportedAssetTypes, + required List buildAssetTypes, }) async { final targetOS = target?.os ?? OS.current; return await runWithLog(capturedLogs, () async { @@ -122,7 +122,7 @@ Future link( ).link( configCreator: () { final configBuilder = LinkConfigBuilder(); - if (supportedAssetTypes.contains(CodeAsset.type)) { + if (buildAssetTypes.contains(CodeAsset.type)) { configBuilder.setupCodeConfig( targetArchitecture: target?.architecture ?? Architecture.current, linkModePreference: linkModePreference, @@ -143,7 +143,7 @@ Future link( packageLayout: packageLayout, buildResult: buildResult, resourceIdentifiers: resourceIdentifiers, - supportedAssetTypes: supportedAssetTypes, + buildAssetTypes: buildAssetTypes, linkValidator: linkValidator, applicationAssetValidator: applicationAssetValidator, ); @@ -176,7 +176,7 @@ Future<(BuildResult?, LinkResult?)> buildAndLink( int? targetAndroidNdkApi, Target? target, Uri? resourceIdentifiers, - required List supportedAssetTypes, + required List buildAssetTypes, }) async => await runWithLog(capturedLogs, () async { final buildRunner = NativeAssetsBuildRunner( @@ -201,7 +201,7 @@ Future<(BuildResult?, LinkResult?)> buildAndLink( packageLayout: packageLayout, runPackageName: runPackageName, linkingEnabled: true, - supportedAssetTypes: supportedAssetTypes, + buildAssetTypes: buildAssetTypes, buildValidator: buildValidator, applicationAssetValidator: applicationAssetValidator, ); @@ -234,7 +234,7 @@ Future<(BuildResult?, LinkResult?)> buildAndLink( packageLayout: packageLayout, buildResult: buildResult, resourceIdentifiers: resourceIdentifiers, - supportedAssetTypes: supportedAssetTypes, + buildAssetTypes: buildAssetTypes, linkValidator: linkValidator, applicationAssetValidator: applicationAssetValidator, ); @@ -275,7 +275,7 @@ Future buildDryRun( List? capturedLogs, PackageLayout? packageLayout, required bool linkingEnabled, - required List supportedAssetTypes, + required List buildAssetTypes, }) async => runWithLog(capturedLogs, () async { final result = await NativeAssetsBuildRunner( @@ -291,7 +291,7 @@ Future buildDryRun( workingDirectory: packageUri, packageLayout: packageLayout, linkingEnabled: linkingEnabled, - supportedAssetTypes: supportedAssetTypes, + buildAssetTypes: buildAssetTypes, buildValidator: buildValidator, ); return result; diff --git a/pkgs/native_assets_builder/test/build_runner/link_caching_test.dart b/pkgs/native_assets_builder/test/build_runner/link_caching_test.dart index ded8c8a2a..e83275b9b 100644 --- a/pkgs/native_assets_builder/test/build_runner/link_caching_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/link_caching_test.dart @@ -34,7 +34,7 @@ void main() async { logger, dartExecutable, linkingEnabled: true, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], capturedLogs: logMessages, configValidator: validateDataAssetBuildConfig, buildValidator: validateDataAssetBuildOutput, @@ -49,7 +49,7 @@ void main() async { logger, dartExecutable, buildResult: buildResult, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], capturedLogs: logMessages, configValidator: validateDataAssetLinkConfig, linkValidator: validateDataAssetLinkOutput, diff --git a/pkgs/native_assets_builder/test/build_runner/link_test.dart b/pkgs/native_assets_builder/test/build_runner/link_test.dart index 87967cb49..1ec0046b5 100644 --- a/pkgs/native_assets_builder/test/build_runner/link_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/link_test.dart @@ -31,7 +31,7 @@ void main() async { logger, dartExecutable, linkingEnabled: true, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], configValidator: validateDataAssetBuildConfig, buildValidator: validateDataAssetBuildOutput, applicationAssetValidator: (_) async => [], @@ -43,7 +43,7 @@ void main() async { logger, dartExecutable, buildResult: buildResult, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], configValidator: validateDataAssetLinkConfig, linkValidator: validateDataAssetLinkOutput, applicationAssetValidator: (_) async => [], @@ -55,7 +55,7 @@ void main() async { logger, dartExecutable, linkingEnabled: false, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], configValidator: validateDataAssetBuildConfig, buildValidator: validateDataAssetBuildOutput, applicationAssetValidator: (_) async => [], @@ -101,7 +101,7 @@ void main() async { logger, dartExecutable, linkingEnabled: true, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], configValidator: validateDataAssetBuildConfig, buildValidator: validateDataAssetBuildOutput, applicationAssetValidator: (_) async => [], @@ -119,7 +119,7 @@ void main() async { logger, dartExecutable, buildResult: buildResult, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], configValidator: validateDataAssetLinkConfig, linkValidator: validateDataAssetLinkOutput, applicationAssetValidator: (_) async => [], @@ -148,7 +148,7 @@ void main() async { logger, dartExecutable, linkingEnabled: true, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], configValidator: validateDataAssetBuildConfig, buildValidator: validateDataAssetBuildOutput, applicationAssetValidator: (_) async => [], @@ -163,7 +163,7 @@ void main() async { dartExecutable, buildResult: buildResult, capturedLogs: logMessages, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], configValidator: validateDataAssetLinkConfig, linkValidator: validateDataAssetLinkOutput, applicationAssetValidator: (_) async => [], @@ -203,7 +203,7 @@ void main() async { logger, dartExecutable, linkingEnabled: true, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -218,7 +218,7 @@ void main() async { dartExecutable, buildResult: buildResult, capturedLogs: logMessages, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetLinkConfig, linkValidator: validateCodeAssetLinkOutput, applicationAssetValidator: validateCodeAssetInApplication, diff --git a/pkgs/native_assets_builder/test/build_runner/metadata_test.dart b/pkgs/native_assets_builder/test/build_runner/metadata_test.dart index 17aa2e5d0..274b88c9c 100644 --- a/pkgs/native_assets_builder/test/build_runner/metadata_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/metadata_test.dart @@ -31,7 +31,7 @@ void main() async { logger, dartExecutable, capturedLogs: logMessages, - supportedAssetTypes: ['foo'], + buildAssetTypes: ['foo'], configValidator: (config) async => [], buildValidator: (config, output) async => [], applicationAssetValidator: (_) async => [], diff --git a/pkgs/native_assets_builder/test/build_runner/packaging_preference_test.dart b/pkgs/native_assets_builder/test/build_runner/packaging_preference_test.dart index 140d7954f..92e60dc01 100644 --- a/pkgs/native_assets_builder/test/build_runner/packaging_preference_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/packaging_preference_test.dart @@ -26,7 +26,7 @@ void main() async { logger, dartExecutable, linkModePreference: LinkModePreference.dynamic, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -37,7 +37,7 @@ void main() async { logger, dartExecutable, linkModePreference: LinkModePreference.preferDynamic, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -48,7 +48,7 @@ void main() async { logger, dartExecutable, linkModePreference: LinkModePreference.static, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -59,7 +59,7 @@ void main() async { logger, dartExecutable, linkModePreference: LinkModePreference.preferStatic, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, diff --git a/pkgs/native_assets_builder/test/build_runner/resources_test.dart b/pkgs/native_assets_builder/test/build_runner/resources_test.dart index 936c3522c..4d5a87207 100644 --- a/pkgs/native_assets_builder/test/build_runner/resources_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/resources_test.dart @@ -34,7 +34,7 @@ void main() async { logger, dartExecutable, linkingEnabled: true, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], configValidator: validateDataAssetBuildConfig, buildValidator: validateDataAssetBuildOutput, applicationAssetValidator: (_) async => [], @@ -53,7 +53,7 @@ void main() async { dartExecutable, buildResult: buildResult, resourceIdentifiers: resourcesUri, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], configValidator: validateDataAssetLinkConfig, linkValidator: validateDataAssetLinkOutput, applicationAssetValidator: (_) async => [], diff --git a/pkgs/native_assets_builder/test/build_runner/wrong_linker_test.dart b/pkgs/native_assets_builder/test/build_runner/wrong_linker_test.dart index e004fe581..4a1c58d25 100644 --- a/pkgs/native_assets_builder/test/build_runner/wrong_linker_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/wrong_linker_test.dart @@ -27,7 +27,7 @@ void main() async { packageUri, createCapturingLogger(logMessages, level: Level.SEVERE), dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, diff --git a/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart b/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart index 5865d93fb..c105e4552 100644 --- a/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart +++ b/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart @@ -37,7 +37,7 @@ void main() async { packageName: name, packageRoot: testPackageUri, targetOS: OS.current, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], buildMode: dryRun ? null : BuildMode.debug) ..setupBuildConfig(dryRun: dryRun, linkingEnabled: false) ..setupBuildRunConfig( diff --git a/pkgs/native_assets_builder/test/test_data/transformer_test.dart b/pkgs/native_assets_builder/test/test_data/transformer_test.dart index acd50699b..67c89eaa1 100644 --- a/pkgs/native_assets_builder/test/test_data/transformer_test.dart +++ b/pkgs/native_assets_builder/test/test_data/transformer_test.dart @@ -50,7 +50,7 @@ void main() async { packageName: packageName, packageRoot: packageUri, targetOS: OS.current, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], buildMode: BuildMode.debug) ..setupBuildConfig(dryRun: false, linkingEnabled: false) ..setupBuildRunConfig( diff --git a/pkgs/native_assets_builder/test_data/wrong_build_output_3/hook/build.dart b/pkgs/native_assets_builder/test_data/wrong_build_output_3/hook/build.dart index 58666acf2..b53f9c872 100644 --- a/pkgs/native_assets_builder/test_data/wrong_build_output_3/hook/build.dart +++ b/pkgs/native_assets_builder/test_data/wrong_build_output_3/hook/build.dart @@ -22,5 +22,5 @@ const _rightContents = '''{ "encodedAssets": [], "dependencies": [], "metadata": {}, - "version": "1.5.0" + "version": "1.6.0" }'''; diff --git a/pkgs/native_assets_cli/example/build/local_asset/test/build_test.dart b/pkgs/native_assets_cli/example/build/local_asset/test/build_test.dart index a178ff606..8f2ea6180 100644 --- a/pkgs/native_assets_cli/example/build/local_asset/test/build_test.dart +++ b/pkgs/native_assets_cli/example/build/local_asset/test/build_test.dart @@ -18,6 +18,6 @@ void main() async { 'package:local_asset/asset.txt', ); }, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], ); } diff --git a/pkgs/native_assets_cli/lib/src/code_assets/testing.dart b/pkgs/native_assets_cli/lib/src/code_assets/testing.dart index 21f2ad672..7bb8ef9f9 100644 --- a/pkgs/native_assets_cli/lib/src/code_assets/testing.dart +++ b/pkgs/native_assets_cli/lib/src/code_assets/testing.dart @@ -25,7 +25,7 @@ Future testCodeBuildHook({ int? targetAndroidNdkApi, CCompilerConfig? cCompiler, LinkModePreference? linkModePreference, - required List supportedAssetTypes, + required List buildAssetTypes, bool? linkingEnabled, }) async { await testBuildHook( @@ -48,7 +48,7 @@ Future testCodeBuildHook({ }, buildMode: buildMode, targetOS: targetOS, - supportedAssetTypes: supportedAssetTypes, + buildAssetTypes: buildAssetTypes, linkingEnabled: linkingEnabled, ); } diff --git a/pkgs/native_assets_cli/lib/src/config.dart b/pkgs/native_assets_cli/lib/src/config.dart index 40da1c770..093a7dcc5 100644 --- a/pkgs/native_assets_cli/lib/src/config.dart +++ b/pkgs/native_assets_cli/lib/src/config.dart @@ -73,12 +73,12 @@ sealed class HookConfig { final BuildMode? _buildMode; /// The asset types that the invoker of this hook supports. - final List supportedAssetTypes; + final List buildAssetTypes; HookConfig(this.json) : version = switch (Version.parse(json.string(_versionKey))) { final Version version => (version.major != latestVersion.major || - version < latestVersion) + version < latestParsableVersion) ? throw FormatException( 'Only compatible versions with $latestVersion are supported ' '(was: $version).') @@ -89,8 +89,9 @@ sealed class HookConfig { packageRoot = json.path(_packageRootConfigKey), packageName = json.string(_packageNameConfigKey), targetOS = OS.fromString(json.string(_targetOSConfigKey)), - supportedAssetTypes = - json.optionalStringList(_supportedAssetTypesKey) ?? const [], + buildAssetTypes = json.optionalStringList(_buildAssetTypesKey) ?? + json.optionalStringList(_supportedAssetTypesKey) ?? + const [], _buildMode = switch (json.optionalString(_buildModeConfigKey)) { String value => BuildMode.fromString(value), null => null, @@ -116,13 +117,14 @@ sealed class HookConfigBuilder { required Uri packageRoot, required String packageName, required OS targetOS, - required List supportedAssetTypes, + required List buildAssetTypes, required BuildMode? buildMode, }) { json[_packageNameConfigKey] = packageName; json[_packageRootConfigKey] = packageRoot.toFilePath(); json[_targetOSConfigKey] = targetOS.toString(); - json[_supportedAssetTypesKey] = supportedAssetTypes; + json[_buildAssetTypesKey] = buildAssetTypes; + json[_supportedAssetTypesKey] = buildAssetTypes; if (buildMode != null) { json[_buildModeConfigKey] = buildMode.toString(); } @@ -164,6 +166,7 @@ const _outDirSharedConfigKey = 'out_dir_shared'; const _packageNameConfigKey = 'package_name'; const _packageRootConfigKey = 'package_root'; const _supportedAssetTypesKey = 'supported_asset_types'; +const _buildAssetTypesKey = 'build_asset_types'; final class BuildConfig extends HookConfig { // TODO(dcharkes): Remove after 3.7.0 stable is released and bump the SDK @@ -301,7 +304,7 @@ sealed class HookOutput { String toString() => const JsonEncoder.withIndent(' ').convert(json); /// The version of [HookOutput]. - static final Version latestVersion = Version(1, 5, 0); + static final Version latestVersion = Version(1, 6, 0); } List _parseDependencies(List? list) { @@ -558,4 +561,7 @@ extension EncodedAssetLinkOutputBuilder on LinkOutputBuilder { } // The latest supported config version. -final latestVersion = Version(1, 5, 0); +final latestVersion = Version(1, 6, 0); + +// The parser can deal with configs down to this version. +final latestParsableVersion = Version(1, 5, 0); diff --git a/pkgs/native_assets_cli/lib/src/model/build_config_CHANGELOG.md b/pkgs/native_assets_cli/lib/src/model/build_config_CHANGELOG.md index f3126361e..c89032d80 100644 --- a/pkgs/native_assets_cli/lib/src/model/build_config_CHANGELOG.md +++ b/pkgs/native_assets_cli/lib/src/model/build_config_CHANGELOG.md @@ -1,5 +1,8 @@ ## 1.6.0 +- `BuildConfig.supportedAssetTypes` renamed to `BuildConfig.buildAssetTypes`. + Compatibility with older SDKs: Look for the old key. Compatibility with older + hooks: Also provide the old hook in the config. - `BuildConfig.outputDirectoryShared` for sharing between hook invocations. Compatibility with older SDKs: Create a sibling dir next to the output directory. This does not facilitate caching, but should not break the hook. diff --git a/pkgs/native_assets_cli/lib/src/validation.dart b/pkgs/native_assets_cli/lib/src/validation.dart index 66b314434..c20edd3fd 100644 --- a/pkgs/native_assets_cli/lib/src/validation.dart +++ b/pkgs/native_assets_cli/lib/src/validation.dart @@ -72,12 +72,12 @@ List _validateOutputAssetTypes( Iterable assets, ) { final errors = []; - final supportedAssetTypes = config.supportedAssetTypes; + final buildAssetTypes = config.buildAssetTypes; for (final asset in assets) { - if (!supportedAssetTypes.contains(asset.type)) { + if (!buildAssetTypes.contains(asset.type)) { final error = 'Asset with type "${asset.type}" is not a supported asset type ' - '(${supportedAssetTypes.join(' ')} are supported)'; + '(${buildAssetTypes.join(' ')} are supported)'; errors.add(error); } } diff --git a/pkgs/native_assets_cli/lib/test.dart b/pkgs/native_assets_cli/lib/test.dart index 26c0ab27b..a9e4c289a 100644 --- a/pkgs/native_assets_cli/lib/test.dart +++ b/pkgs/native_assets_cli/lib/test.dart @@ -24,7 +24,7 @@ Future testBuildHook({ check, BuildMode? buildMode, OS? targetOS, - List? supportedAssetTypes, + List? buildAssetTypes, bool? linkingEnabled, }) async { test( @@ -43,7 +43,7 @@ Future testBuildHook({ packageRoot: Directory.current.uri, packageName: _readPackageNameFromPubspec(), targetOS: targetOS ?? OS.current, - supportedAssetTypes: supportedAssetTypes ?? [], + buildAssetTypes: buildAssetTypes ?? [], buildMode: buildMode ?? BuildMode.release, ) ..setupBuildConfig( diff --git a/pkgs/native_assets_cli/test/api/build_test.dart b/pkgs/native_assets_cli/test/api/build_test.dart index 0504151f4..f43c44e32 100644 --- a/pkgs/native_assets_cli/test/api/build_test.dart +++ b/pkgs/native_assets_cli/test/api/build_test.dart @@ -35,7 +35,7 @@ void main() async { packageRoot: tempUri, packageName: packageName, targetOS: OS.iOS, - supportedAssetTypes: ['foo'], + buildAssetTypes: ['foo'], buildMode: BuildMode.release, ) ..setupBuildConfig( diff --git a/pkgs/native_assets_cli/test/build_config_test.dart b/pkgs/native_assets_cli/test/build_config_test.dart index 6c4b334df..4479eb1d1 100644 --- a/pkgs/native_assets_cli/test/build_config_test.dart +++ b/pkgs/native_assets_cli/test/build_config_test.dart @@ -42,7 +42,7 @@ void main() async { packageRoot: packageRootUri, targetOS: OS.android, buildMode: BuildMode.release, - supportedAssetTypes: ['my-asset-type'], + buildAssetTypes: ['my-asset-type'], ) ..setupBuildConfig( linkingEnabled: false, @@ -56,16 +56,8 @@ void main() async { final config = BuildConfig(configBuilder.json); final expectedConfigJson = { + 'build_asset_types': ['my-asset-type'], 'build_mode': 'release', - 'supported_asset_types': ['my-asset-type'], - 'dry_run': false, - 'linking_enabled': false, - 'out_dir': outDirUri.toFilePath(), - 'out_dir_shared': outputDirectoryShared.toFilePath(), - 'package_name': packageName, - 'package_root': packageRootUri.toFilePath(), - 'target_os': 'android', - 'version': latestVersion.toString(), 'dependency_metadata': { 'bar': { 'key': 'value', @@ -75,6 +67,15 @@ void main() async { 'key': 321, }, }, + 'dry_run': false, + 'linking_enabled': false, + 'out_dir_shared': outputDirectoryShared.toFilePath(), + 'out_dir': outDirUri.toFilePath(), + 'package_name': packageName, + 'package_root': packageRootUri.toFilePath(), + 'supported_asset_types': ['my-asset-type'], + 'target_os': 'android', + 'version': latestVersion.toString(), }; expect(config.json, expectedConfigJson); @@ -87,7 +88,7 @@ void main() async { expect(config.packageRoot, packageRootUri); expect(config.targetOS, OS.android); expect(config.buildMode, BuildMode.release); - expect(config.supportedAssetTypes, ['my-asset-type']); + expect(config.buildAssetTypes, ['my-asset-type']); expect(config.linkingEnabled, false); expect(config.dryRun, false); @@ -101,7 +102,7 @@ void main() async { packageRoot: packageRootUri, targetOS: OS.android, buildMode: null, // not available in dry run - supportedAssetTypes: ['my-asset-type'], + buildAssetTypes: ['my-asset-type'], ) ..setupBuildConfig( linkingEnabled: true, @@ -114,15 +115,16 @@ void main() async { final config = BuildConfig(configBuilder.json); final expectedConfigJson = { + 'build_asset_types': ['my-asset-type'], + 'dependency_metadata': {}, 'dry_run': true, - 'supported_asset_types': ['my-asset-type'], 'linking_enabled': true, - 'out_dir': outDirUri.toFilePath(), 'out_dir_shared': outputDirectoryShared.toFilePath(), + 'out_dir': outDirUri.toFilePath(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), + 'supported_asset_types': ['my-asset-type'], 'target_os': 'android', - 'dependency_metadata': {}, 'version': latestVersion.toString(), }; @@ -135,7 +137,7 @@ void main() async { expect(config.packageName, packageName); expect(config.packageRoot, packageRootUri); expect(config.targetOS, OS.android); - expect(config.supportedAssetTypes, ['my-asset-type']); + expect(config.buildAssetTypes, ['my-asset-type']); expect(() => config.buildMode, throwsStateError); expect(config.linkingEnabled, true); @@ -155,7 +157,7 @@ void main() async { 'target_os': 'linux', 'version': version, 'package_name': packageName, - 'supported_asset_types': ['my-asset-type'], + 'build_asset_types': ['my-asset-type'], 'dry_run': true, 'linking_enabled': false, }; @@ -189,7 +191,7 @@ void main() async { 'package_root': packageRootUri.toFilePath(), 'target_os': 'android', 'linking_enabled': true, - 'supported_asset_types': ['my-asset-type'], + 'build_asset_types': ['my-asset-type'], }), throwsA(predicate( (e) => @@ -209,7 +211,7 @@ void main() async { 'target_os': 'android', 'linking_enabled': true, 'build_mode': BuildMode.release.name, - 'supported_asset_types': ['my-asset-type'], + 'build_asset_types': ['my-asset-type'], 'dependency_metadata': { 'bar': {'key': 'value'}, 'foo': [], diff --git a/pkgs/native_assets_cli/test/build_output_test.dart b/pkgs/native_assets_cli/test/build_output_test.dart index d58f1c920..5c7e78e4f 100644 --- a/pkgs/native_assets_cli/test/build_output_test.dart +++ b/pkgs/native_assets_cli/test/build_output_test.dart @@ -49,7 +49,7 @@ void main() { // The JSON format of the build output. { - 'version': '1.5.0', + 'version': '1.6.0', 'dependencies': ['path0', 'path1', 'path2'], 'metadata': { 'meta-a': 'meta-b', diff --git a/pkgs/native_assets_cli/test/checksum_test.dart b/pkgs/native_assets_cli/test/checksum_test.dart index 915950fb4..92740e812 100644 --- a/pkgs/native_assets_cli/test/checksum_test.dart +++ b/pkgs/native_assets_cli/test/checksum_test.dart @@ -24,7 +24,7 @@ void main() { packageRoot: Uri.file('foo'), packageName: packageName, targetOS: os, - supportedAssetTypes: [assetType], + buildAssetTypes: [assetType], buildMode: buildMode, ) ..setupBuildConfig(dryRun: dryRun, linkingEnabled: linking); @@ -44,76 +44,75 @@ void main() { // If format or algorithm for checksumming changes we'd like to know (by // needing to update this list). final expectedChecksums = [ - '05cdbdf4976a68c33e75e6b57781c5f5', - 'c36ad7dc2f0846ed134029edaeb59195', - '7f90e825f08edafe99ac7314d02f46e0', - '82279ed0fb55f7e02b8e6cf857b5a7b9', - '8aa77a554828663ccfdb30d026caf729', - '6a69060c347c20000354bb9e7cca21f5', - 'c0a1cd20d08aa29044af633dec235b36', - '72a098e698316a60e6ca2b67c4de82b1', - '16dc68a85ea9cab4a9d35c77f9d8bc6c', - 'fbb47d28d4db2082f331a6710ae293f6', - 'c557d0bffbf479b85861a648ceda8912', - '7c23bce4887d70915a5d5824142cb75f', - '88d164985687d11445a1bba4c83b299e', - 'e6b3d1a31ea2ea2c37babbf8a52393de', - 'dfe63dab862fa7789f3bf4ad882c87c7', - 'b146d5dfbcb2bfdd295cdd548832d717', - '4267a4d5f5b7e1ae3278e590cab52e48', - '461e627475397d461da3c985e17466ba', - '2e5d01733c132b2801e3068bf008e023', - 'aee031592879b62e8512cc73a064c883', - '439222774886f776f2da9a5c0051310f', - 'a59d7e43b0a9562518863d6379fddd16', - '90a0e05df0f56c8d33b3bdbe7ff785b3', - 'e00db5df53778da8aaecace162d20325', - 'b4f8ef47ab0a43f0760c68d66297f1a8', - '17c758237c24c96e1d92a4681ba2b889', - 'dd6ee4832b2c11d31a2488f671d13e9a', - '7ac636c075bcc1423e80c635fed6de6c', - '427db33751df11daa8dc9809614b66e6', - 'c8d5918f01d365e0d6c2a1d610a47d1d', - '534fce1b658242d7942f3eb6e4ca987d', - '3dcea3a8a52eebea225eacd44ee370f1', - '55fe838d0d2a01e288b3faed2adc7a04', - '80727044903ebea814198f4001fdebf0', - '6198b46894c081193b9209f9ddb66b3d', - '856c0ffe90c97d9629e847ba1b3bbb67', - '3e3d7e551f1392f53d73fd3362693184', - '5244e64af596a46940892b28739737e2', - '8a875dc22c02d815e16f50386d03195d', - '50464749a3288f2d655ccef290835776', - '1982534a5ba2f13f8ed5b4ba38386d8c', - '012e03aad8221afab6200718f7e68fa6', - '9ddaa64eadc3b21ba48d77062a12bee7', - 'f2b802ce9d7c055f721e017db5582312', - 'abc578f0fe5c4a4c43b185a7940d0dd7', - '771cd5ab05e5838cccf4a75cc224f506', - 'd41f53ff6aca0cdd74bbea8b0c26b83e', - '24c8e4535afc18981f7470cbd05a5787', - 'fddca58e36cc89868114bb399bc6cec2', - 'fec6330fac0d3d9316f2f580602fc06a', - '092c7130962283f35d5de02604cc3852', - '130517517742ea571ab39d69f56c87a0', - 'e17135e1be677fb428a761b6c3b5f421', - '510c5b24f5bbd414917c96444ff41df3', - '75993da8d1508dc1e556096da0a7c00f', - 'aad9665f7c2a8e28e99c92a90d0f2168', - 'bab93955a78ab99e6157b1568e4b03d1', - 'f2ad0bb263fd38d9fba3ca9ed5c7c66b', - '7743132a908a48c183a75d8c25635de6', - '3b326f5a0ef295d3109bcf95a63b446e', - 'e0775404b93fadf74f5bce5410854346', - 'd1fd0e95194d8d4bc513666e2067548c', - '0541de11331a9ca647f7cbde69c1abf4', - 'c8c85515946c890e3056f379ca757cfe', + '10d9fce0028fdbb72b5994307ebf227c', + '4116af41354c68fd64b58cb6a308ebbb', + '157fda96bdf938d4fe055180bf4dbabc', + 'c5507af2f5f7e8601710c5c2fffb6188', + '2ab19c5f0f4c8f6c17826f6fabca2e6e', + 'c7c3e28d58191051c70c2748aa1377ef', + 'f81cf883235927d5cca9d510c2446a3a', + '8396b8b2541fe6ee9f39ece6aede06b6', + '9e092722bb54a9bdc6434119786a538c', + 'd2d421c2c497ff6a16bbd43f4ba27152', + '6c45154e7e0be87367fd000a9386aa2a', + '4b1257c34a3de0ce91171eadb84be35f', + '7a9a8d4a6e226dbd08e3c591e379d967', + '996f318e4d30a472358d7f21eb14585b', + '7adf24fb2f2cac19d41f439fed3fa5d8', + '99574fa166e54a5c740d0e85f46bc5af', + '2c592c067f97ed13d900bc2bb8c16f86', + 'e5b8f39328001ed0417e8cd70aad4fa8', + '923b4534ee62e50b596e04aaf1392901', + '4df91b08cd288e9a5069a5fe55c64395', + 'dde8372e52f886b8293f6b691a7b76f1', + 'bfeb49adc617a567671c78936130af4c', + 'de7b54bfd2d9ab26796951592967dca2', + 'f3e73bb91a351c1743e81cd32babf90c', + 'ac98097f3d916d7bde50d9c67b2a8d9e', + 'c87086e206e304191a13baed3f29da9e', + 'c85ced6ed90adc35f0dd03b27486d66e', + 'aed9f8805210068380e2556b1bab0a99', + 'e4314b23825c872590bbb384c1072cb8', + '3f9b69de7a31c609a4b6ec125adcaca5', + '0102baa7f1f5071aefa90a18179d0d7d', + '40f84eefd62ff9062b78b655ad3ee6b1', + '723e2805985a094838464d4ab4e0af7d', + 'f5ca710868b73059ce61ded27bd0faac', + '1b0e1ad58ff192d204ca9750505b2d55', + 'a2def75febdaa8a332fc588ee3ef8014', + '59a936e9e646387fcf322a794b753b54', + '8f5945499965afcb5d6eebf30bbacb77', + '4ed56caadaf9079c96dcec668624bf2a', + '0f2a4864df014a824034f9e29ed48ee8', + '0aed524d105e71a3bfd432ade52ed132', + '6ba03bd61a4d8979fcd64e5b6ae245b6', + 'cd70cfa54dad2b6859d5c1d23b83b074', + '2aa7bf1eda6a6fb1bf3edaadcbb9a804', + 'b6fd8e4dc466f8aa1b758134d454b191', + '22c71b4626f3f59463e1276afccfd2fb', + '70ff946f65f2d46be9b323d45e4edf0e', + '7862c709b255bde8debb5ee06ddbcd74', + 'b948929ac5fd276c69ab9f76e5b280f0', + 'aa479a711b010893b3bfb46d68028ed7', + '74c9bf5365c62bd9655f7b773b5e5113', + 'bc6224160b985a2c338f414899eed664', + '78ec380b3257d8b4ca35006e922978bd', + 'c0656028d1e11a2b6cd972464e23cd30', + '11b75baa322bd7cb1362852fc4238a0e', + '6eff070403ac6171ff42fdfbdc1a36ea', + '9d026a26c3788e9d2606ee0c5e0e0e10', + '2dcc623fce0dfc380761b9e2f396d955', + '9ce27557bb269768d25b5f1bd8ffdfa4', + 'e9b1c4c9511c02c64c2112dc16924598', + 'b38af392d228d193ba3d3943d7bb189a', + 'ab5753aa337cf91a224fe89e53173324', + 'a99ffcf470d3b570fed923bbf7257d37', + '630d35827f0193efbb1b439d792ebe23', ]; + printOnFailure('final expectedChecksums = ['); + printOnFailure(checksums.map((e) => " '$e',").join('\n')); + printOnFailure('];'); for (var i = 0; i < checksums.length; ++i) { - if (checksums[i] != expectedChecksums[i]) { - print('Expected ${expectedChecksums[i]} but was ${checksums[i]}'); - print('Config:\n${configs[i]}'); - } expect(checksums[i], expectedChecksums[i]); } }); diff --git a/pkgs/native_assets_cli/test/code_assets/config_test.dart b/pkgs/native_assets_cli/test/code_assets/config_test.dart index 35618b1f9..cb63f5916 100644 --- a/pkgs/native_assets_cli/test/code_assets/config_test.dart +++ b/pkgs/native_assets_cli/test/code_assets/config_test.dart @@ -46,7 +46,7 @@ void main() async { void expectCorrectCodeConfigDryRun( Map json, CodeConfig codeConfig) { { - 'supported_asset_types': [CodeAsset.type], + 'build_asset_types': [CodeAsset.type], 'link_mode_preference': 'prefer-static', }.forEach((k, v) { expect(json[k], v); @@ -63,7 +63,7 @@ void main() async { void expectCorrectCodeConfig( Map json, CodeConfig codeConfig) { { - 'supported_asset_types': [CodeAsset.type], + 'build_asset_types': [CodeAsset.type], 'link_mode_preference': 'prefer-static', 'target_android_ndk_api': 30, 'target_architecture': 'arm64', @@ -93,7 +93,7 @@ void main() async { packageRoot: packageRootUri, targetOS: OS.android, buildMode: null, // not available in dry run - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], ) ..setupBuildConfig( linkingEnabled: true, @@ -119,7 +119,7 @@ void main() async { packageRoot: packageRootUri, targetOS: OS.android, buildMode: BuildMode.release, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], ) ..setupBuildConfig( linkingEnabled: false, @@ -152,7 +152,7 @@ void main() async { packageRoot: packageRootUri, targetOS: OS.android, buildMode: BuildMode.release, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], ) ..setupLinkConfig(assets: assets) ..setupLinkRunConfig( @@ -190,7 +190,7 @@ void main() async { 'target_android_ndk_api': 30, 'target_architecture': 'invalid_architecture', 'target_os': 'android', - 'supported_asset_types': ['my-asset-type'], + 'build_asset_types': ['my-asset-type'], 'version': latestVersion.toString(), }; expect( @@ -201,7 +201,7 @@ void main() async { test('LinkConfig.codeConfig: invalid architecture', () { final config = { - 'supported_asset_types': [CodeAsset.type], + 'build_asset_types': [CodeAsset.type], 'build_mode': 'release', 'dry_run': false, 'link_mode_preference': 'prefer-static', diff --git a/pkgs/native_assets_cli/test/code_assets/validation_test.dart b/pkgs/native_assets_cli/test/code_assets/validation_test.dart index f2ad1c173..7bcbe225a 100644 --- a/pkgs/native_assets_cli/test/code_assets/validation_test.dart +++ b/pkgs/native_assets_cli/test/code_assets/validation_test.dart @@ -36,7 +36,7 @@ void main() { packageRoot: tempUri, targetOS: os, buildMode: BuildMode.release, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], ) ..setupBuildConfig( linkingEnabled: false, diff --git a/pkgs/native_assets_cli/test/data_assets/validation_test.dart b/pkgs/native_assets_cli/test/data_assets/validation_test.dart index c3f5fcd01..45712ddf1 100644 --- a/pkgs/native_assets_cli/test/data_assets/validation_test.dart +++ b/pkgs/native_assets_cli/test/data_assets/validation_test.dart @@ -36,7 +36,7 @@ void main() { packageRoot: tempUri, targetOS: OS.iOS, buildMode: BuildMode.release, - supportedAssetTypes: [DataAsset.type]) + buildAssetTypes: [DataAsset.type]) ..setupBuildConfig( linkingEnabled: false, dryRun: false, diff --git a/pkgs/native_assets_cli/test/example/local_asset_test.dart b/pkgs/native_assets_cli/test/example/local_asset_test.dart index 591d6a3e3..96207c559 100644 --- a/pkgs/native_assets_cli/test/example/local_asset_test.dart +++ b/pkgs/native_assets_cli/test/example/local_asset_test.dart @@ -45,7 +45,7 @@ void main() async { packageRoot: testPackageUri, packageName: name, targetOS: OS.current, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], buildMode: dryRun ? null : BuildMode.debug) ..setupBuildRunConfig( outputDirectory: outputDirectory, diff --git a/pkgs/native_assets_cli/test/example/native_add_library_test.dart b/pkgs/native_assets_cli/test/example/native_add_library_test.dart index 3e85e84db..c2df4cea6 100644 --- a/pkgs/native_assets_cli/test/example/native_add_library_test.dart +++ b/pkgs/native_assets_cli/test/example/native_add_library_test.dart @@ -45,7 +45,7 @@ void main() async { packageRoot: testPackageUri, packageName: name, targetOS: OS.current, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], buildMode: dryRun ? null : BuildMode.debug) ..setupBuildRunConfig( outputDirectory: outputDirectory, diff --git a/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart b/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart index a20306a4f..a721b058f 100644 --- a/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart +++ b/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart @@ -54,7 +54,7 @@ void main() async { packageRoot: testPackageUri, packageName: name, targetOS: OS.current, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], buildMode: dryRun ? null : BuildMode.debug) ..setupBuildRunConfig( outputDirectory: outputDirectory, diff --git a/pkgs/native_assets_cli/test/link_config_test.dart b/pkgs/native_assets_cli/test/link_config_test.dart index 16d394d32..7ce676bc0 100644 --- a/pkgs/native_assets_cli/test/link_config_test.dart +++ b/pkgs/native_assets_cli/test/link_config_test.dart @@ -35,7 +35,7 @@ void main() async { packageRoot: packageRootUri, targetOS: OS.android, buildMode: BuildMode.release, - supportedAssetTypes: ['asset-type-1', 'asset-type-2'], + buildAssetTypes: ['asset-type-1', 'asset-type-2'], ) ..setupLinkConfig(assets: assets) ..setupLinkRunConfig( @@ -46,15 +46,16 @@ void main() async { final config = LinkConfig(configBuilder.json); final expectedConfigJson = { + 'assets': [for (final asset in assets) asset.toJson()], + 'build_asset_types': ['asset-type-1', 'asset-type-2'], 'build_mode': 'release', - 'supported_asset_types': ['asset-type-1', 'asset-type-2'], - 'out_dir': outDirUri.toFilePath(), 'out_dir_shared': outputDirectoryShared.toFilePath(), + 'out_dir': outDirUri.toFilePath(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), + 'supported_asset_types': ['asset-type-1', 'asset-type-2'], 'target_os': 'android', 'version': latestVersion.toString(), - 'assets': [for (final asset in assets) asset.toJson()], }; expect(config.json, expectedConfigJson); expect(json.decode(config.toString()), expectedConfigJson); @@ -66,7 +67,7 @@ void main() async { expect(config.packageRoot, packageRootUri); expect(config.targetOS, OS.android); expect(config.buildMode, BuildMode.release); - expect(config.supportedAssetTypes, ['asset-type-1', 'asset-type-2']); + expect(config.buildAssetTypes, ['asset-type-1', 'asset-type-2']); expect(config.encodedAssets, assets); }); @@ -82,7 +83,7 @@ void main() async { 'target_os': 'linux', 'version': version, 'package_name': packageName, - 'supported_asset_types': ['my-asset-type'], + 'build_asset_types': ['my-asset-type'], 'dry_run': true, }; expect( @@ -108,7 +109,7 @@ void main() async { expect( () => LinkConfig({ 'version': latestVersion.toString(), - 'supported_asset_types': ['my-asset-type'], + 'build_asset_types': ['my-asset-type'], 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'target_os': 'android', @@ -125,7 +126,7 @@ void main() async { expect( () => LinkConfig({ 'version': latestVersion.toString(), - 'supported_asset_types': ['my-asset-type'], + 'build_asset_types': ['my-asset-type'], 'out_dir': outDirUri.toFilePath(), 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_name': packageName, diff --git a/pkgs/native_assets_cli/test/link_output_test.dart b/pkgs/native_assets_cli/test/link_output_test.dart index adb5e80a3..5d3a7d74d 100644 --- a/pkgs/native_assets_cli/test/link_output_test.dart +++ b/pkgs/native_assets_cli/test/link_output_test.dart @@ -35,7 +35,7 @@ void main() { // The JSON format of the link output. { - 'version': '1.5.0', + 'version': '1.6.0', 'dependencies': ['path0', 'path1', 'path2'], 'assets': [ {'a-0': 'v-0', 'type': 'my-asset-type'}, diff --git a/pkgs/native_assets_cli/test/validation_test.dart b/pkgs/native_assets_cli/test/validation_test.dart index aa291d020..a64e2f635 100644 --- a/pkgs/native_assets_cli/test/validation_test.dart +++ b/pkgs/native_assets_cli/test/validation_test.dart @@ -36,7 +36,7 @@ void main() { packageRoot: tempUri, targetOS: OS.iOS, buildMode: BuildMode.release, - supportedAssetTypes: ['my-asset-type'], + buildAssetTypes: ['my-asset-type'], ) ..setupBuildConfig( linkingEnabled: false, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart index 778471a6e..f9648e9f4 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart @@ -31,7 +31,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.current, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart index f785bbfbc..a2c64cbda 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart @@ -146,7 +146,7 @@ Future buildLib( await Directory.fromUri(tempUriShared).create(); final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.android, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart index ad765d690..7456f37d2 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart @@ -72,7 +72,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.iOS, @@ -230,7 +230,7 @@ Future buildLib( final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.iOS, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart index 5e2e4a74a..7b58957eb 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart @@ -44,7 +44,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.linux, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart index a698efb0d..5e89ca115 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart @@ -59,7 +59,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.macOS, @@ -160,7 +160,7 @@ Future buildLib( final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.macOS, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart index 6058db4e5..b256b9c5a 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart @@ -63,7 +63,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.windows, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart index 1b5630650..3906383e7 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart @@ -45,7 +45,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.current, @@ -127,7 +127,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.current, @@ -228,7 +228,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.current, @@ -295,7 +295,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.current, @@ -351,7 +351,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.current, @@ -419,7 +419,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.current, @@ -492,7 +492,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.current, @@ -573,7 +573,7 @@ Future testDefines({ final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.current, diff --git a/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart b/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart index bac97bd79..1ee88a7ac 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart @@ -43,7 +43,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: 'dummy', packageRoot: tempUri, targetOS: OS.current, @@ -83,7 +83,7 @@ void main() { final tempUri2 = await tempDirForTest(); final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: 'dummy', packageRoot: tempUri, targetOS: OS.windows, diff --git a/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart b/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart index c6ebc852e..0027cbd93 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart @@ -37,7 +37,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.current, diff --git a/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart b/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart index c9eb1ee86..a01c949b8 100644 --- a/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart +++ b/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart @@ -27,7 +27,7 @@ Future buildTestArchive( final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: os, diff --git a/pkgs/native_toolchain_c/test/clinker/objects_test.dart b/pkgs/native_toolchain_c/test/clinker/objects_test.dart index ff98f7009..b4f17841f 100644 --- a/pkgs/native_toolchain_c/test/clinker/objects_test.dart +++ b/pkgs/native_toolchain_c/test/clinker/objects_test.dart @@ -33,7 +33,7 @@ Future main() async { final linkConfigBuilder = LinkConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: 'testpackage', packageRoot: tempUri, targetOS: os, diff --git a/pkgs/native_toolchain_c/test/clinker/throws_test.dart b/pkgs/native_toolchain_c/test/clinker/throws_test.dart index e6aa79d0f..7370cbe91 100644 --- a/pkgs/native_toolchain_c/test/clinker/throws_test.dart +++ b/pkgs/native_toolchain_c/test/clinker/throws_test.dart @@ -24,7 +24,7 @@ Future main() async { final linkConfigBuilder = LinkConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: 'testpackage', packageRoot: tempUri, targetOS: os, diff --git a/pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart b/pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart index 945940166..7862b4ff1 100644 --- a/pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart +++ b/pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart @@ -63,7 +63,7 @@ Future runTests(List architectures) async { final linkConfigBuilder = LinkConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: 'testpackage', packageRoot: tempUri, targetOS: os,