Skip to content

[native_assets_cli] Improve documentation for DynamicLoadingBundled #1058

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkgs/native_assets_cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.5.4

- Update documentation about providing `NativeCodeAsset.file` in dry runs.

## 0.5.3

- Fix V1_0_0 dry run backwards compatibility.
Expand Down
15 changes: 11 additions & 4 deletions pkgs/native_assets_cli/lib/src/api/native_code_asset.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ abstract final class NativeCodeAsset implements Asset {
/// 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 [DynamicLoadingBundled], the file name must be
/// provided in the [BuildOutput] for [BuildConfig.dryRun]. Supplying a file
/// name instead of an absolute path is enough for [BuildConfig.dryRun]. The
/// file does not have to exist on disk during a dry run.
///
/// If the [linkMode] is [DynamicLoadingSystem], [LookupInProcess], or
/// [LookupInExecutable] the file must be omitted in the [BuildOutput] for
Expand Down Expand Up @@ -126,8 +128,13 @@ abstract final class DynamicLoading implements LinkMode {}
/// At runtime, the dynamic library will be loaded and the symbols will be
/// looked up in this dynamic library.
///
/// An asset with this dynamic loading method must provide a [Asset.file]. The
/// Dart and Flutter SDK will bundle this code in the final application.
/// An asset with this dynamic loading method must provide a
/// [NativeCodeAsset.file]. The Dart and Flutter SDK will bundle this code in
/// the final application.
///
/// During a [BuildConfig.dryRun], the [NativeCodeAsset.file] can be a file name
/// instead of a the full path. The file does not have to exist during a dry
/// run.
abstract final class DynamicLoadingBundled implements DynamicLoading {
factory DynamicLoadingBundled() = DynamicLoadingBundledImpl;
}
Expand Down
2 changes: 1 addition & 1 deletion pkgs/native_assets_cli/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: >-
native assets CLI.

# Note: Bump BuildConfig.version and BuildOutput.version on breaking changes!
version: 0.5.3
version: 0.5.4
repository: https://github.com/dart-lang/native/tree/main/pkgs/native_assets_cli

topics:
Expand Down