From 25ba30049ab23db233a892830ba25e07f480b16b Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Fri, 22 Mar 2024 16:32:54 +0100 Subject: [PATCH] [native_assets_cli] Document `NativeCodeAsset.file` requiredness (#1051) --- pkgs/native_assets_cli/CHANGELOG.md | 5 +++++ .../lib/src/api/native_code_asset.dart | 14 ++++++++++++++ pkgs/native_assets_cli/pubspec.yaml | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/pkgs/native_assets_cli/CHANGELOG.md b/pkgs/native_assets_cli/CHANGELOG.md index 83a787c74..89b06f8ca 100644 --- a/pkgs/native_assets_cli/CHANGELOG.md +++ b/pkgs/native_assets_cli/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.5.1 + +- Update documentation about providing `NativeCodeAsset.file` in dry runs. + https://github.com/dart-lang/native/issues/1049 + ## 0.5.0 - **Breaking change** Completely rewritten API. diff --git a/pkgs/native_assets_cli/lib/src/api/native_code_asset.dart b/pkgs/native_assets_cli/lib/src/api/native_code_asset.dart index 171af2fa0..83ecb31f0 100644 --- a/pkgs/native_assets_cli/lib/src/api/native_code_asset.dart +++ b/pkgs/native_assets_cli/lib/src/api/native_code_asset.dart @@ -59,6 +59,20 @@ abstract final class NativeCodeAsset implements Asset { /// Either dynamic loading or static linking. LinkMode get linkMode; + /// The file to be bundled with the Dart or Flutter application. + /// + /// How this file is bundled depends on the kind of asset, represented by a + /// concrete subtype of [Asset], and the SDK (Dart or Flutter). + /// + /// If the [linkMode] is [DynamicLoadingBundled], the file most be provided in + /// the [BuildOutput] for [BuildConfig.dryRun]. + /// + /// If the [linkMode] is [DynamicLoadingSystem], [LookupInProcess], or + /// [LookupInExecutable] the file must be omitted in the [BuildOutput] for + /// [BuildConfig.dryRun]. + @override + Uri? get file; + /// Constructs a native code asset. /// /// The [id] of this asset is a uri `package:/` from [package] diff --git a/pkgs/native_assets_cli/pubspec.yaml b/pkgs/native_assets_cli/pubspec.yaml index 1921fe9c7..1a6437578 100644 --- a/pkgs/native_assets_cli/pubspec.yaml +++ b/pkgs/native_assets_cli/pubspec.yaml @@ -4,7 +4,7 @@ description: >- native assets CLI. # Note: Bump BuildConfig.version and BuildOutput.version on breaking changes! -version: 0.5.0 +version: 0.5.1 repository: https://github.com/dart-lang/native/tree/main/pkgs/native_assets_cli topics: