From 3832e4b9f80e98a74d54cf2c4eecc5c04250b127 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Mon, 13 Jan 2025 16:40:10 +0100 Subject: [PATCH] [native_assets_cli] Add `HookInput.outputFile` (#1882) Pass in a path to where the `output.json` should be written. This enables the output file to not be written into the output directory but next to it. This is cleaner. I don't remember where we discussed this, but some references to adding the output json can be found in the discussions here: * https://github.com/dart-lang/native/issues/1738 --- .../lib/src/build_runner/build_runner.dart | 47 +++++++++++++++---- ...build_runner_build_output_format_test.dart | 2 +- .../native_dynamic_linking_test.dart | 3 +- .../test/test_data/transformer_test.dart | 3 +- .../wrong_build_output/hook/build.dart | 3 +- .../wrong_build_output_2/hook/build.dart | 3 +- .../wrong_build_output_3/hook/build.dart | 5 +- pkgs/native_assets_cli/CHANGELOG.md | 1 + .../build/download_asset/tool/build.dart | 3 ++ pkgs/native_assets_cli/lib/src/api/build.dart | 3 +- pkgs/native_assets_cli/lib/src/api/link.dart | 3 +- pkgs/native_assets_cli/lib/src/config.dart | 22 +++++++-- .../lib/src/model/build_config_CHANGELOG.md | 14 ++++++ .../native_assets_cli/lib/src/model/hook.dart | 3 +- pkgs/native_assets_cli/lib/test.dart | 8 ++-- .../test/api/build_test.dart | 8 ++-- .../test/build_config_test.dart | 8 ++++ .../test/build_output_test.dart | 2 +- .../test/code_assets/config_test.dart | 10 +++- .../test/code_assets/validation_test.dart | 1 + .../test/data_assets/validation_test.dart | 1 + .../test/example/local_asset_test.dart | 3 +- .../test/example/native_add_library_test.dart | 3 +- .../example/native_dynamic_linking_test.dart | 3 +- .../test/link_config_test.dart | 6 +++ .../test/link_output_test.dart | 2 +- .../test/validation_test.dart | 1 + .../cbuilder/cbuilder_build_failure_test.dart | 1 + .../cbuilder/cbuilder_cross_android_test.dart | 1 + .../cbuilder/cbuilder_cross_ios_test.dart | 2 + .../cbuilder_cross_linux_host_test.dart | 1 + .../cbuilder_cross_macos_host_test.dart | 2 + .../cbuilder_cross_windows_host_test.dart | 1 + .../test/cbuilder/cbuilder_test.dart | 9 ++++ .../test/cbuilder/compiler_resolver_test.dart | 2 + .../test/cbuilder/objective_c_test.dart | 1 + .../test/clinker/build_testfiles.dart | 1 + .../test/clinker/objects_test.dart | 1 + .../test/clinker/throws_test.dart | 1 + .../test/clinker/treeshake_helper.dart | 1 + 40 files changed, 154 insertions(+), 41 deletions(-) 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 0287cc3da..78cebc353 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 @@ -146,6 +146,7 @@ class NativeAssetsBuildRunner { inputBuilder.setupShared( packageName: package.name, packageRoot: packageLayout.packageRoot(package.name), + outputFile: buildDirUri.resolve('output.json'), outputDirectory: outDirUri, outputDirectoryShared: outDirSharedUri, ); @@ -244,6 +245,7 @@ class NativeAssetsBuildRunner { inputBuilder.setupShared( packageName: package.name, packageRoot: packageLayout.packageRoot(package.name), + outputFile: buildDirUri.resolve('output.json'), outputDirectory: outDirUri, outputDirectoryShared: outDirSharedUri, ); @@ -350,21 +352,27 @@ class NativeAssetsBuildRunner { } final (hookKernelFile, hookHashes) = hookCompileResult; - final buildOutputFile = - _fileSystem.file(input.outputDirectory.resolve(hook.outputName)); + final buildOutputFile = _fileSystem.file(input.outputFile); + final buildOutputFileDeprecated = _fileSystem + // ignore: deprecated_member_use + .file(input.outputDirectory.resolve(hook.outputNameDeprecated)); + final dependenciesHashFile = input.outputDirectory .resolve('../dependencies.dependencies_hash_file.json'); final dependenciesHashes = DependenciesHashFile(_fileSystem, fileUri: dependenciesHashFile); final lastModifiedCutoffTime = DateTime.now(); - if (buildOutputFile.existsSync() && await dependenciesHashes.exists()) { + if ((buildOutputFile.existsSync() || + buildOutputFileDeprecated.existsSync()) && + await dependenciesHashes.exists()) { late final HookOutput output; try { - output = _readHookOutputFromUri(hook, buildOutputFile); + output = _readHookOutputFromUri( + hook, buildOutputFile, buildOutputFileDeprecated); } on FormatException catch (e) { logger.severe(''' Building assets for package:${input.packageName} failed. -${hook.outputName} contained a format error. +${input.outputFile.toFilePath()} contained a format error. Contents: ${buildOutputFile.readAsStringSync()}. ${e.message} @@ -458,12 +466,20 @@ ${e.message} const JsonEncoder.withIndent(' ').convert(input.json); logger.info('input.json contents: $inputFileContents'); await _fileSystem.file(inputFile).writeAsString(inputFileContents); - final hookOutputUri = input.outputDirectory.resolve(hook.outputName); + final hookOutputUri = input.outputFile; final hookOutputFile = _fileSystem.file(hookOutputUri); if (await hookOutputFile.exists()) { // Ensure we'll never read outdated build results. await hookOutputFile.delete(); } + final hookOutputUriDeprecated = + // ignore: deprecated_member_use + input.outputDirectory.resolve(hook.outputNameDeprecated); + final hookOutputFileDeprecated = _fileSystem.file(hookOutputUriDeprecated); + if (await hookOutputFileDeprecated.exists()) { + // Ensure we'll never read outdated build results. + await hookOutputFileDeprecated.delete(); + } final arguments = [ '--packages=${packageConfigUri.toFilePath()}', @@ -508,7 +524,11 @@ ${e.message} return null; } - final output = _readHookOutputFromUri(hook, hookOutputFile); + final output = _readHookOutputFromUri( + hook, + hookOutputFile, + hookOutputFileDeprecated, + ); final errors = await _validate(input, output, packageLayout, validator); if (errors.isNotEmpty) { _printErrors( @@ -521,7 +541,7 @@ ${e.message} } on FormatException catch (e) { logger.severe(''' Building assets for package:${input.packageName} failed. -${hook.outputName} contained a format error. +${input.outputFile.toFilePath()} contained a format error. Contents: ${hookOutputFile.readAsStringSync()}. ${e.message} @@ -780,10 +800,17 @@ ${compileResult.stdout} return (buildPlan, packageGraph); } - HookOutput _readHookOutputFromUri(Hook hook, File hookOutputFile) { + HookOutput _readHookOutputFromUri( + Hook hook, + File hookOutputFile, + // TODO(dcharkes): Remove when hooks with 1.7.0 are no longer supported. + File hookOutputFileDeprecated, + ) { final decode = const Utf8Decoder().fuse(const JsonDecoder()).convert; + final file = + hookOutputFile.existsSync() ? hookOutputFile : hookOutputFileDeprecated; final hookOutputJson = - decode(hookOutputFile.readAsBytesSync()) as Map; + decode(file.readAsBytesSync()) as Map; return hook == Hook.build ? BuildOutput(hookOutputJson) : LinkOutput(hookOutputJson); 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 2b4e4fb92..19a4557b2 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 @@ -49,7 +49,7 @@ void main() async { } else { expect( fullLog, - contains('build_output.json contained a format error.'), + contains('output.json contained a format error.'), ); } } 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 f6c975916..4a91440df 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 @@ -21,6 +21,7 @@ void main() async { test( 'native_dynamic_linking build', () => inTempDir((tempUri) async { + final buildOutputUri = tempUri.resolve('build_output.json'); final outputDirectory = tempUri.resolve('out/'); await Directory.fromUri(outputDirectory).create(); final outputDirectoryShared = tempUri.resolve('out_shared/'); @@ -35,6 +36,7 @@ void main() async { ..setupShared( packageName: name, packageRoot: testPackageUri, + outputFile: buildOutputUri, outputDirectory: outputDirectory, outputDirectoryShared: outputDirectoryShared, ) @@ -69,7 +71,6 @@ void main() async { } expect(processResult.exitCode, 0); - final buildOutputUri = outputDirectory.resolve('build_output.json'); final buildOutput = BuildOutput( json.decode(await File.fromUri(buildOutputUri).readAsString()) as Map); 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 faa97046b..65c1d86bc 100644 --- a/pkgs/native_assets_builder/test/test_data/transformer_test.dart +++ b/pkgs/native_assets_builder/test/test_data/transformer_test.dart @@ -33,6 +33,7 @@ void main() async { logger: logger, ); + final buildOutputUri = tempUri.resolve('build_output.json'); final outputDirectory = tempUri.resolve('out/'); await Directory.fromUri(outputDirectory).create(); final outputDirectoryShared = tempUri.resolve('out_shared/'); @@ -50,6 +51,7 @@ void main() async { ..setupShared( packageName: packageName, packageRoot: packageUri, + outputFile: buildOutputUri, outputDirectory: outputDirectory, outputDirectoryShared: outputDirectoryShared, ) @@ -87,7 +89,6 @@ void main() async { expect(processResult.exitCode, 0); stdout = processResult.stdout as String; - final buildOutputUri = outputDirectory.resolve('build_output.json'); output = BuildOutput( json.decode(await File.fromUri(buildOutputUri).readAsString()) as Map); diff --git a/pkgs/native_assets_builder/test_data/wrong_build_output/hook/build.dart b/pkgs/native_assets_builder/test_data/wrong_build_output/hook/build.dart index 6151a3917..07b16aa5c 100644 --- a/pkgs/native_assets_builder/test_data/wrong_build_output/hook/build.dart +++ b/pkgs/native_assets_builder/test_data/wrong_build_output/hook/build.dart @@ -12,8 +12,7 @@ void main(List args) async { final inputPath = getInputArgument(args); final buildInput = BuildInput( json.decode(File(inputPath).readAsStringSync()) as Map); - await File.fromUri(buildInput.outputDirectory.resolve('build_output.json')) - .writeAsString(_wrongContents); + await File.fromUri(buildInput.outputFile).writeAsString(_wrongContents); } const _wrongContents = ''' diff --git a/pkgs/native_assets_builder/test_data/wrong_build_output_2/hook/build.dart b/pkgs/native_assets_builder/test_data/wrong_build_output_2/hook/build.dart index af7921b5a..d6796c562 100644 --- a/pkgs/native_assets_builder/test_data/wrong_build_output_2/hook/build.dart +++ b/pkgs/native_assets_builder/test_data/wrong_build_output_2/hook/build.dart @@ -12,8 +12,7 @@ void main(List args) async { final inputPath = getInputArgument(args); final buildInput = BuildInput( json.decode(File(inputPath).readAsStringSync()) as Map); - await File.fromUri(buildInput.outputDirectory.resolve('build_output.json')) - .writeAsString(_wrongContents); + await File.fromUri(buildInput.outputFile).writeAsString(_wrongContents); } const _wrongContents = ''' 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 1e697f7ab..43f55e604 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 @@ -12,8 +12,7 @@ void main(List args) async { final inputPath = getInputArgument(args); final buildInput = BuildInput( json.decode(File(inputPath).readAsStringSync()) as Map); - await File.fromUri(buildInput.outputDirectory.resolve('build_output.json')) - .writeAsString(_rightContents); + await File.fromUri(buildInput.outputFile).writeAsString(_rightContents); exit(1); } @@ -22,5 +21,5 @@ const _rightContents = '''{ "encodedAssets": [], "dependencies": [], "metadata": {}, - "version": "1.7.0" + "version": "1.8.0" }'''; diff --git a/pkgs/native_assets_cli/CHANGELOG.md b/pkgs/native_assets_cli/CHANGELOG.md index c9d716c76..a77777ebf 100644 --- a/pkgs/native_assets_cli/CHANGELOG.md +++ b/pkgs/native_assets_cli/CHANGELOG.md @@ -6,6 +6,7 @@ shouldn't change on subsequent invocations of the same flutter or dart command for the same target. The `outputDirectory` is the same if the config is the same. +- **Breaking change** The `output.json` is now part of `BuildInput`. ## 0.10.0 diff --git a/pkgs/native_assets_cli/example/build/download_asset/tool/build.dart b/pkgs/native_assets_cli/example/build/download_asset/tool/build.dart index 59c2f80fb..1278e968d 100644 --- a/pkgs/native_assets_cli/example/build/download_asset/tool/build.dart +++ b/pkgs/native_assets_cli/example/build/download_asset/tool/build.dart @@ -70,12 +70,15 @@ BuildInput createBuildInput( packageRoot.resolve('.dart_tool/download_asset/$targetName/'); final outputDirectoryShared = packageRoot.resolve('.dart_tool/download_asset/shared/'); + final outputFile = + packageRoot.resolve('.dart_tool/download_asset/output.json'); final os = OS.fromString(osString); final inputBuilder = BuildInputBuilder() ..setupShared( packageRoot: packageRoot, packageName: 'download_asset', + outputFile: outputFile, outputDirectory: outputDirectory, outputDirectoryShared: outputDirectoryShared) ..config.setupShared( diff --git a/pkgs/native_assets_cli/lib/src/api/build.dart b/pkgs/native_assets_cli/lib/src/api/build.dart index 7bab01fc8..68e6f8bea 100644 --- a/pkgs/native_assets_cli/lib/src/api/build.dart +++ b/pkgs/native_assets_cli/lib/src/api/build.dart @@ -110,8 +110,7 @@ Future build( if (errors.isEmpty) { final jsonOutput = const JsonEncoder().fuse(const Utf8Encoder()).convert(output.json); - await File.fromUri(input.outputDirectory.resolve('build_output.json')) - .writeAsBytes(jsonOutput); + await File.fromUri(input.outputFile).writeAsBytes(jsonOutput); } else { final message = [ 'The output contained unsupported output:', diff --git a/pkgs/native_assets_cli/lib/src/api/link.dart b/pkgs/native_assets_cli/lib/src/api/link.dart index 6e7e45852..a818bcae3 100644 --- a/pkgs/native_assets_cli/lib/src/api/link.dart +++ b/pkgs/native_assets_cli/lib/src/api/link.dart @@ -51,8 +51,7 @@ Future link( if (errors.isEmpty) { final jsonOutput = const JsonEncoder().fuse(const Utf8Encoder()).convert(output.json); - await File.fromUri(input.outputDirectory.resolve('link_output.json')) - .writeAsBytes(jsonOutput); + await File.fromUri(input.outputFile).writeAsBytes(jsonOutput); } else { final message = [ 'The output contained unsupported output:', diff --git a/pkgs/native_assets_cli/lib/src/config.dart b/pkgs/native_assets_cli/lib/src/config.dart index c6eea6310..fcbd86eb9 100644 --- a/pkgs/native_assets_cli/lib/src/config.dart +++ b/pkgs/native_assets_cli/lib/src/config.dart @@ -52,6 +52,9 @@ sealed class HookInput { /// each other. final Uri outputDirectoryShared; + /// The file to write the [HookOutput] to at the end of a hook invocation. + Uri get outputFile; + /// The name of the package the assets are built for. final String packageName; @@ -91,9 +94,11 @@ sealed class HookInputBuilder { required String packageName, required Uri outputDirectory, required Uri outputDirectoryShared, + required Uri outputFile, }) { json[_packageNameInputKey] = packageName; json[_packageRootInputKey] = packageRoot.toFilePath(); + json[_outputFileKey] = outputFile.toFilePath(); json[_outDirInputKey] = outputDirectory.toFilePath(); json[_outDirSharedInputKey] = outputDirectoryShared.toFilePath(); } @@ -121,6 +126,7 @@ sealed class HookInputBuilder { // TODO: Bump min-SDK constraint to 3.7 and remove once stable. const _buildModeInputKeyDeprecated = 'build_mode'; const _metadataConfigKey = 'metadata'; +const _outputFileKey = 'out_file'; const _outDirInputKey = 'out_dir'; const _outDirSharedInputKey = 'out_dir_shared'; const _packageNameInputKey = 'package_name'; @@ -133,8 +139,13 @@ const _configKey = 'config'; final class BuildInput extends HookInput { final Map metadata; + @override + final Uri outputFile; + BuildInput(super.json) - : metadata = { + : outputFile = json.optionalPath(_outputFileKey) ?? + json.path(_outDirInputKey).resolve('build_output.json'), + metadata = { for (final entry in (json.optionalMap(_dependencyMetadataKey) ?? {}).entries) entry.key: Metadata.fromJson(as>(entry.value)), @@ -204,8 +215,13 @@ final class LinkInput extends HookInput { final Uri? recordedUsagesFile; + @override + final Uri outputFile; + LinkInput(super.json) - : _encodedAssets = + : outputFile = json.optionalPath(_outputFileKey) ?? + json.path(_outDirInputKey).resolve('link_output.json'), + _encodedAssets = _parseAssets(json.getOptional>(_assetsKey)), recordedUsagesFile = json.optionalPath(_recordedUsagesFileInputKey); @@ -578,7 +594,7 @@ extension type EncodedAssetLinkOutputBuilder._(LinkOutputBuilder _builder) { /// /// We'll never bump the major version. Removing old keys from the input and /// output is done via modifying [latestParsableVersion]. -final latestVersion = Version(1, 7, 0); +final latestVersion = Version(1, 8, 0); /// The parser can deal with inputs and outputs down to this version. /// 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 c460ecc8a..2c7aa6efe 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,3 +1,17 @@ +## 1.8.0 + +- Add `BuildInput.outputFile` to specify the outfile. This means the out file + can be outside the `outputDirectory` and avoid potential conflicts. + Compatibility with older hooks: If the file doesn't exist, try the previous + location. + Compatibility with older SDKs: Default the location to where it was. + +## 1.7.0 + +- Complete rewrite of JSON + Compatibility with older hooks: also emit old structure. + Compatibility with older SDKs: keep parsing old structure. + ## 1.6.0 - `BuildConfig.supportedAssetTypes` renamed to `BuildConfig.buildAssetTypes`. diff --git a/pkgs/native_assets_cli/lib/src/model/hook.dart b/pkgs/native_assets_cli/lib/src/model/hook.dart index abb69213a..2ad7f0760 100644 --- a/pkgs/native_assets_cli/lib/src/model/hook.dart +++ b/pkgs/native_assets_cli/lib/src/model/hook.dart @@ -16,5 +16,6 @@ enum Hook { String get scriptName => '$_scriptName.dart'; - String get outputName => '${_scriptName}_output.json'; + @Deprecated('Use HookInput.outputFile instead.') + String get outputNameDeprecated => '${_scriptName}_output.json'; } diff --git a/pkgs/native_assets_cli/lib/test.dart b/pkgs/native_assets_cli/lib/test.dart index 39e9e2021..aa84e4989 100644 --- a/pkgs/native_assets_cli/lib/test.dart +++ b/pkgs/native_assets_cli/lib/test.dart @@ -9,7 +9,6 @@ import 'dart:io'; import 'package:yaml/yaml.dart'; import 'native_assets_cli_builder.dart'; -import 'native_assets_cli_internal.dart' show Hook; import 'src/validation.dart'; export 'native_assets_cli_builder.dart'; @@ -41,6 +40,7 @@ Future testBuildHook({ Directory(await tempDir.resolveSymbolicLinks()).uri.normalizePath(); final outputDirectory = tempUri.resolve('output/'); final outputDirectoryShared = tempUri.resolve('output_shared/'); + final outputFile = tempUri.resolve('output.json'); await Directory.fromUri(outputDirectory).create(); await Directory.fromUri(outputDirectoryShared).create(); @@ -50,6 +50,7 @@ Future testBuildHook({ ..setupShared( packageRoot: Directory.current.uri, packageName: _readPackageNameFromPubspec(), + outputFile: outputFile, outputDirectory: outputDirectory, outputDirectoryShared: outputDirectoryShared, ) @@ -61,11 +62,10 @@ Future testBuildHook({ final input = BuildInput(inputBuilder.json); - final inputUri = tempUri.resolve(Hook.build.outputName); + final inputUri = tempUri.resolve('input.json'); _writeJsonTo(inputUri, input.json); await mainMethod(['--config=${inputUri.toFilePath()}']); - final output = BuildOutput( - _readJsonFrom(input.outputDirectory.resolve(Hook.build.outputName))); + final output = BuildOutput(_readJsonFrom(input.outputFile)); // Test conformance of protocol invariants. final validationErrors = await validateBuildOutput(input, output); diff --git a/pkgs/native_assets_cli/test/api/build_test.dart b/pkgs/native_assets_cli/test/api/build_test.dart index ace5c17a6..25fc98845 100644 --- a/pkgs/native_assets_cli/test/api/build_test.dart +++ b/pkgs/native_assets_cli/test/api/build_test.dart @@ -8,11 +8,11 @@ import 'dart:io'; import 'package:file_testing/file_testing.dart'; import 'package:native_assets_cli/native_assets_cli.dart' show build; import 'package:native_assets_cli/native_assets_cli_builder.dart'; -import 'package:native_assets_cli/native_assets_cli_internal.dart' show Hook; import 'package:test/test.dart'; void main() async { late Uri tempUri; + late Uri outFile; late Uri outDirUri; late Uri outputDirectoryShared; late String packageName; @@ -22,6 +22,7 @@ void main() async { setUp(() async { tempUri = (await Directory.systemTemp.createTemp()).uri; + outFile = tempUri.resolve('output.json'); outDirUri = tempUri.resolve('out1/'); await Directory.fromUri(outDirUri).create(); outputDirectoryShared = tempUri.resolve('out_shared1/'); @@ -34,6 +35,7 @@ void main() async { ..setupShared( packageRoot: tempUri, packageName: packageName, + outputFile: outFile, outputDirectory: outDirUri, outputDirectoryShared: outputDirectoryShared, ) @@ -45,7 +47,7 @@ void main() async { input = BuildInput(inputBuilder.json); final inputJson = json.encode(input.json); - buildInputUri = tempUri.resolve('build_input.json'); + buildInputUri = tempUri.resolve('input.json'); await File.fromUri(buildInputUri).writeAsString(inputJson); }); @@ -54,7 +56,7 @@ void main() async { (input, output) async { output.addDependency(packageRootUri.resolve('foo')); }); - final buildOutputUri = input.outputDirectory.resolve(Hook.build.outputName); + final buildOutputUri = input.outputFile; expect(File.fromUri(buildOutputUri), exists); }); } diff --git a/pkgs/native_assets_cli/test/build_config_test.dart b/pkgs/native_assets_cli/test/build_config_test.dart index 815f6d41f..1ec3b690a 100644 --- a/pkgs/native_assets_cli/test/build_config_test.dart +++ b/pkgs/native_assets_cli/test/build_config_test.dart @@ -12,6 +12,7 @@ import 'package:native_assets_cli/src/config.dart' show latestVersion; import 'package:test/test.dart'; void main() async { + late Uri outFile; late Uri outDirUri; late Uri outputDirectoryShared; late String packageName; @@ -20,6 +21,7 @@ void main() async { setUp(() async { final tempUri = Directory.systemTemp.uri; + outFile = tempUri.resolve('output.json'); outDirUri = tempUri.resolve('out1/'); outputDirectoryShared = tempUri.resolve('out_shared1/'); packageName = 'my_package'; @@ -40,6 +42,7 @@ void main() async { ..setupShared( packageName: packageName, packageRoot: packageRootUri, + outputFile: outFile, outputDirectory: outDirUri, outputDirectoryShared: outputDirectoryShared, ) @@ -73,6 +76,7 @@ void main() async { 'linking_enabled': false, 'out_dir_shared': outputDirectoryShared.toFilePath(), 'out_dir': outDirUri.toFilePath(), + 'out_file': outFile.toFilePath(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'supported_asset_types': ['my-asset-type'], @@ -99,6 +103,7 @@ void main() async { ..setupShared( packageName: packageName, packageRoot: packageRootUri, + outputFile: outFile, outputDirectory: outDirUri, outputDirectoryShared: outputDirectoryShared, ) @@ -121,6 +126,7 @@ void main() async { 'linking_enabled': true, 'out_dir_shared': outputDirectoryShared.toFilePath(), 'out_dir': outDirUri.toFilePath(), + 'out_file': outFile.toFilePath(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'supported_asset_types': ['my-asset-type'], @@ -150,6 +156,7 @@ void main() async { 'link_mode_preference': 'prefer-static', 'out_dir': outDir.toFilePath(), 'out_dir_shared': outputDirectoryShared.toFilePath(), + 'out_file': outFile.toFilePath(), 'package_root': packageRootUri.toFilePath(), 'target_os': 'linux', 'version': version, @@ -203,6 +210,7 @@ void main() async { 'version': latestVersion.toString(), 'out_dir': outDirUri.toFilePath(), 'out_dir_shared': outputDirectoryShared.toFilePath(), + 'out_file': outFile.toFilePath(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'target_os': 'android', diff --git a/pkgs/native_assets_cli/test/build_output_test.dart b/pkgs/native_assets_cli/test/build_output_test.dart index 39d4cd481..aa9a5dad9 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.7.0', + 'version': '1.8.0', 'dependencies': ['path0', 'path1', 'path2'], 'metadata': { 'meta-a': 'meta-b', 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 85fa79b41..c75565d9a 100644 --- a/pkgs/native_assets_cli/test/code_assets/config_test.dart +++ b/pkgs/native_assets_cli/test/code_assets/config_test.dart @@ -11,6 +11,7 @@ import 'package:test/test.dart'; void main() async { late Uri outDirUri; late Uri outputDirectoryShared; + late Uri outFile; late String packageName; late Uri packageRootUri; late Uri fakeClang; @@ -22,6 +23,7 @@ void main() async { setUp(() async { final tempUri = Directory.systemTemp.uri; outDirUri = tempUri.resolve('out1/'); + outFile = tempUri.resolve('output.json'); outputDirectoryShared = tempUri.resolve('out_shared1/'); packageName = 'my_package'; packageRootUri = tempUri.resolve('$packageName/'); @@ -116,6 +118,7 @@ void main() async { if (includeDeprecated) 'link_mode_preference': 'prefer-static', 'out_dir_shared': outputDirectoryShared.toFilePath(), 'out_dir': outDirUri.toFilePath(), + 'out_file': outFile.toFilePath(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), if (includeDeprecated) 'supported_asset_types': [CodeAsset.type], @@ -123,7 +126,7 @@ void main() async { 'target_android_ndk_api': 30, if (includeDeprecated) 'target_architecture': 'arm64', if (includeDeprecated) 'target_os': targetOS.name, - 'version': '1.7.0', + 'version': '1.8.0', }; void expectCorrectCodeConfig( @@ -152,6 +155,7 @@ void main() async { ..setupShared( packageName: packageName, packageRoot: packageRootUri, + outputFile: outFile, outputDirectory: outDirUri, outputDirectoryShared: outputDirectoryShared, ) @@ -176,6 +180,7 @@ void main() async { ..setupShared( packageName: packageName, packageRoot: packageRootUri, + outputFile: outFile, outputDirectory: outDirUri, outputDirectoryShared: outputDirectoryShared, ) @@ -225,6 +230,7 @@ void main() async { ..setupShared( packageName: packageName, packageRoot: packageRootUri, + outputFile: outFile, outputDirectory: outDirUri, outputDirectoryShared: outputDirectoryShared, ) @@ -275,6 +281,7 @@ void main() async { 'link_mode_preference': 'prefer-static', 'out_dir': outDirUri.toFilePath(), 'out_dir_shared': outputDirectoryShared.toFilePath(), + 'out_file': outFile.toFilePath(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'target_android_ndk_api': 30, @@ -296,6 +303,7 @@ void main() async { 'link_mode_preference': 'prefer-static', 'out_dir': outDirUri.toFilePath(), 'out_dir_shared': outputDirectoryShared.toFilePath(), + 'out_file': outFile.toFilePath(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'target_android_ndk_api': 30, 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 1092188e4..f16c2b7c2 100644 --- a/pkgs/native_assets_cli/test/code_assets/validation_test.dart +++ b/pkgs/native_assets_cli/test/code_assets/validation_test.dart @@ -34,6 +34,7 @@ void main() { ..setupShared( packageName: packageName, packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: outDirUri, outputDirectoryShared: outDirSharedUri, ) 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 a9d946aed..2ddcaae54 100644 --- a/pkgs/native_assets_cli/test/data_assets/validation_test.dart +++ b/pkgs/native_assets_cli/test/data_assets/validation_test.dart @@ -34,6 +34,7 @@ void main() { ..setupShared( packageName: packageName, packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: outDirUri, outputDirectoryShared: outDirSharedUri, ) 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 7d4a42cd8..95be6b2e0 100644 --- a/pkgs/native_assets_cli/test/example/local_asset_test.dart +++ b/pkgs/native_assets_cli/test/example/local_asset_test.dart @@ -31,6 +31,7 @@ void main() async { for (final dryRun in [true, false]) { final testSuffix = dryRun ? ' dry_run' : ''; test('local_asset build$testSuffix', () async { + final buildOutputUri = tempUri.resolve('build_output.json'); final testTempUri = tempUri.resolve('test1/'); await Directory.fromUri(testTempUri).create(); final outputDirectory = tempUri.resolve('out/'); @@ -45,6 +46,7 @@ void main() async { ..setupShared( packageRoot: testPackageUri, packageName: name, + outputFile: buildOutputUri, outputDirectory: outputDirectory, outputDirectoryShared: outputDirectoryShared, ) @@ -79,7 +81,6 @@ void main() async { } expect(processResult.exitCode, 0); - final buildOutputUri = outputDirectory.resolve('build_output.json'); final buildOutput = BuildOutput( json.decode(await File.fromUri(buildOutputUri).readAsString()) as Map); 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 2cb9ff019..5e61761d2 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 @@ -31,6 +31,7 @@ void main() async { for (final dryRun in [true, false]) { final testSuffix = dryRun ? ' dry_run' : ''; test('native_add build$testSuffix', () async { + final buildOutputUri = tempUri.resolve('build_output.json'); final testTempUri = tempUri.resolve('test1/'); await Directory.fromUri(testTempUri).create(); final outputDirectory = tempUri.resolve('out/'); @@ -45,6 +46,7 @@ void main() async { ..setupShared( packageRoot: testPackageUri, packageName: name, + outputFile: buildOutputUri, outputDirectory: outputDirectory, outputDirectoryShared: outputDirectoryShared, ) @@ -79,7 +81,6 @@ void main() async { } expect(processResult.exitCode, 0); - final buildOutputUri = outputDirectory.resolve('build_output.json'); final buildOutput = BuildOutput( json.decode(await File.fromUri(buildOutputUri).readAsString()) as Map); 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 571b4df3b..0165a113b 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 @@ -35,6 +35,7 @@ void main() async { for (final dryRun in [true, false]) { final testSuffix = dryRun ? ' dry_run' : ''; test('native_dynamic_linking build$testSuffix', () async { + final buildOutputUri = tempUri.resolve('build_output.json'); final testTempUri = tempUri.resolve('test1/'); await Directory.fromUri(testTempUri).create(); final outputDirectory = tempUri.resolve('out/'); @@ -49,6 +50,7 @@ void main() async { ..setupShared( packageRoot: testPackageUri, packageName: name, + outputFile: buildOutputUri, outputDirectory: outputDirectory, outputDirectoryShared: outputDirectoryShared, ) @@ -83,7 +85,6 @@ void main() async { } expect(processResult.exitCode, 0); - final buildOutputUri = outputDirectory.resolve('build_output.json'); final buildOutput = BuildOutput( json.decode(await File.fromUri(buildOutputUri).readAsString()) as Map); diff --git a/pkgs/native_assets_cli/test/link_config_test.dart b/pkgs/native_assets_cli/test/link_config_test.dart index acc9e430e..4f4803cd2 100644 --- a/pkgs/native_assets_cli/test/link_config_test.dart +++ b/pkgs/native_assets_cli/test/link_config_test.dart @@ -10,6 +10,7 @@ import 'package:native_assets_cli/src/config.dart' show latestVersion; import 'package:test/test.dart'; void main() async { + late Uri outFile; late Uri outDirUri; late Uri outputDirectoryShared; late String packageName; @@ -18,6 +19,7 @@ void main() async { setUp(() async { final tempUri = Directory.systemTemp.uri; + outFile = tempUri.resolve('output.json'); outDirUri = tempUri.resolve('out1/'); outputDirectoryShared = tempUri.resolve('out_shared1/'); packageName = 'my_package'; @@ -33,6 +35,7 @@ void main() async { ..setupShared( packageName: packageName, packageRoot: packageRootUri, + outputFile: outFile, outputDirectory: outDirUri, outputDirectoryShared: outputDirectoryShared, ) @@ -52,6 +55,7 @@ void main() async { }, 'out_dir_shared': outputDirectoryShared.toFilePath(), 'out_dir': outDirUri.toFilePath(), + 'out_file': outFile.toFilePath(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'supported_asset_types': ['asset-type-1', 'asset-type-2'], @@ -77,6 +81,7 @@ void main() async { 'link_mode_preference': 'prefer-static', 'out_dir': outDir.toFilePath(), 'out_dir_shared': outputDirectoryShared.toFilePath(), + 'out_file': outFile.toFilePath(), 'package_root': packageRootUri.toFilePath(), 'target_os': 'linux', 'version': version, @@ -127,6 +132,7 @@ void main() async { 'build_asset_types': ['my-asset-type'], 'out_dir': outDirUri.toFilePath(), 'out_dir_shared': outputDirectoryShared.toFilePath(), + 'out_file': outFile.toFilePath(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'target_os': 'android', diff --git a/pkgs/native_assets_cli/test/link_output_test.dart b/pkgs/native_assets_cli/test/link_output_test.dart index 9bd28313d..de17f7b99 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.7.0', + 'version': '1.8.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 d2ddea7e2..38d8633fd 100644 --- a/pkgs/native_assets_cli/test/validation_test.dart +++ b/pkgs/native_assets_cli/test/validation_test.dart @@ -34,6 +34,7 @@ void main() { ..setupShared( packageName: packageName, packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: outDirUri, outputDirectoryShared: outDirSharedUri, ) 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 9bea9ee7f..0d2eda455 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 @@ -34,6 +34,7 @@ void main() { ..setupShared( packageName: name, packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: tempUri, outputDirectoryShared: tempUri2, ) 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 35f61b829..df127d433 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 @@ -148,6 +148,7 @@ Future buildLib( ..setupShared( packageName: name, packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: tempUri, outputDirectoryShared: tempUriShared, ) 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 5e31bf7b5..ffe717f93 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 @@ -77,6 +77,7 @@ void main() { ..setupShared( packageName: name, packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: tempUri, outputDirectoryShared: tempUri2, ) @@ -232,6 +233,7 @@ Future buildLib( ..setupShared( packageName: name, packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: tempUri, outputDirectoryShared: tempUri2, ) 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 27f1db3a5..a55dd4324 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 @@ -46,6 +46,7 @@ void main() { ..setupShared( packageName: name, packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: tempUri, outputDirectoryShared: tempUri2, ) 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 412f20afd..c4aa0426e 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 @@ -61,6 +61,7 @@ void main() { ..setupShared( packageName: name, packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: tempUri, outputDirectoryShared: tempUri2, ) @@ -161,6 +162,7 @@ Future buildLib( ..setupShared( packageName: name, packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: tempUri, outputDirectoryShared: tempUri2, ) 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 11bb9152c..f3f875401 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 @@ -65,6 +65,7 @@ void main() { ..setupShared( packageName: name, packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: tempUri, outputDirectoryShared: tempUri2, ) diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart index e67cfc85e..410d4d993 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart @@ -51,6 +51,7 @@ void main() { ..setupShared( packageName: name, packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: tempUri, outputDirectoryShared: tempUri2, ) @@ -133,6 +134,7 @@ void main() { ..setupShared( packageName: name, packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: tempUri, outputDirectoryShared: tempUri2, ) @@ -242,6 +244,7 @@ void main() { ..setupShared( packageName: name, packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: tempUri, outputDirectoryShared: tempUri2, ) @@ -308,6 +311,7 @@ void main() { ..setupShared( packageName: name, packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: tempUri, outputDirectoryShared: tempUri2, ) @@ -365,6 +369,7 @@ void main() { ..setupShared( packageName: name, packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: tempUri, outputDirectoryShared: tempUri2, ) @@ -434,6 +439,7 @@ void main() { ..setupShared( packageName: name, packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: tempUri, outputDirectoryShared: tempUri2, ) @@ -507,6 +513,7 @@ void main() { ..setupShared( packageName: name, packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: tempUri, outputDirectoryShared: tempUri2, ) @@ -591,6 +598,7 @@ void main() { ..setupShared( packageName: name, packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: tempUri, outputDirectoryShared: tempUri2, ) @@ -692,6 +700,7 @@ Future testDefines({ ..setupShared( packageName: name, packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: tempUri, outputDirectoryShared: tempUri2, ) 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 9b1190663..0de8fa018 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart @@ -47,6 +47,7 @@ void main() { ..setupShared( packageName: 'dummy', packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: tempUri, outputDirectoryShared: tempUri2, ) @@ -92,6 +93,7 @@ void main() { ..setupShared( packageName: 'dummy', packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectoryShared: tempUri2, outputDirectory: tempUri, ) 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 8a4a1e433..704bbc6d2 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart @@ -40,6 +40,7 @@ void main() { ..setupShared( packageName: name, packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: tempUri, outputDirectoryShared: tempUri2, ) diff --git a/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart b/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart index 06b0c4731..e0c97a903 100644 --- a/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart +++ b/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart @@ -30,6 +30,7 @@ Future buildTestArchive( ..setupShared( packageName: name, packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: tempUri, outputDirectoryShared: tempUri2, ) diff --git a/pkgs/native_toolchain_c/test/clinker/objects_test.dart b/pkgs/native_toolchain_c/test/clinker/objects_test.dart index 020e82381..3d2ae2041 100644 --- a/pkgs/native_toolchain_c/test/clinker/objects_test.dart +++ b/pkgs/native_toolchain_c/test/clinker/objects_test.dart @@ -35,6 +35,7 @@ Future main() async { ..setupShared( packageName: 'testpackage', packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: tempUri, outputDirectoryShared: tempUri2, ) diff --git a/pkgs/native_toolchain_c/test/clinker/throws_test.dart b/pkgs/native_toolchain_c/test/clinker/throws_test.dart index 741d26afd..557472da4 100644 --- a/pkgs/native_toolchain_c/test/clinker/throws_test.dart +++ b/pkgs/native_toolchain_c/test/clinker/throws_test.dart @@ -26,6 +26,7 @@ Future main() async { ..setupShared( packageName: 'testpackage', packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectoryShared: tempUri2, outputDirectory: tempUri, ) diff --git a/pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart b/pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart index d359b88af..476a3aefe 100644 --- a/pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart +++ b/pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart @@ -65,6 +65,7 @@ Future runTests(List architectures) async { ..setupShared( packageName: 'testpackage', packageRoot: tempUri, + outputFile: tempUri.resolve('output.json'), outputDirectory: tempUri, outputDirectoryShared: tempUri2, )