Skip to content

Commit 555f66b

Browse files
authored
[native_assets_cli] Improve documentation for DynamicLoadingBundled (#1058)
1 parent 86a6724 commit 555f66b

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

pkgs/native_assets_cli/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.5.4
2+
3+
- Update documentation about providing `NativeCodeAsset.file` in dry runs.
4+
15
## 0.5.3
26

37
- Fix V1_0_0 dry run backwards compatibility.

pkgs/native_assets_cli/lib/src/api/native_code_asset.dart

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ abstract final class NativeCodeAsset implements Asset {
6464
/// How this file is bundled depends on the kind of asset, represented by a
6565
/// concrete subtype of [Asset], and the SDK (Dart or Flutter).
6666
///
67-
/// If the [linkMode] is [DynamicLoadingBundled], the file most be provided in
68-
/// the [BuildOutput] for [BuildConfig.dryRun].
67+
/// If the [linkMode] is [DynamicLoadingBundled], the file name must be
68+
/// provided in the [BuildOutput] for [BuildConfig.dryRun]. Supplying a file
69+
/// name instead of an absolute path is enough for [BuildConfig.dryRun]. The
70+
/// file does not have to exist on disk during a dry run.
6971
///
7072
/// If the [linkMode] is [DynamicLoadingSystem], [LookupInProcess], or
7173
/// [LookupInExecutable] the file must be omitted in the [BuildOutput] for
@@ -126,8 +128,13 @@ abstract final class DynamicLoading implements LinkMode {}
126128
/// At runtime, the dynamic library will be loaded and the symbols will be
127129
/// looked up in this dynamic library.
128130
///
129-
/// An asset with this dynamic loading method must provide a [Asset.file]. The
130-
/// Dart and Flutter SDK will bundle this code in the final application.
131+
/// An asset with this dynamic loading method must provide a
132+
/// [NativeCodeAsset.file]. The Dart and Flutter SDK will bundle this code in
133+
/// the final application.
134+
///
135+
/// During a [BuildConfig.dryRun], the [NativeCodeAsset.file] can be a file name
136+
/// instead of a the full path. The file does not have to exist during a dry
137+
/// run.
131138
abstract final class DynamicLoadingBundled implements DynamicLoading {
132139
factory DynamicLoadingBundled() = DynamicLoadingBundledImpl;
133140
}

pkgs/native_assets_cli/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: >-
44
native assets CLI.
55
66
# Note: Bump BuildConfig.version and BuildOutput.version on breaking changes!
7-
version: 0.5.3
7+
version: 0.5.4
88
repository: https://github.com/dart-lang/native/tree/main/pkgs/native_assets_cli
99

1010
topics:

0 commit comments

Comments
 (0)