-
Notifications
You must be signed in to change notification settings - Fork 53
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
[native_assets_cli] asset ids option 1 #1536
Conversation
PR HealthBreaking changes ✔️
Changelog Entry ❗
Changes to files need to be accounted for in their respective changelogs. This check can be disabled by tagging the PR with API leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
License Headers ✔️
All source files should start with a license header. Unrelated files missing license headers
Package publish validation ✔️
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
This PR explores a solution to #1410:
CodeAsset
with aString id
DataAsset
with aString package
andString name
Asset
.This leads to the following quirks:
String get id;
that produces a string representation of thepackage
andname
.package:native_toolchain_c
still only takes an asset name, because thepackage
is already read from the config.If we have a use case for having the combined string for data assets, and need for the individual components of name and package in native code assets, maybe we should embrace having both.
AssetId
extension type onString
. Enables passing around the combination and get out bothpackage
andname
. And the logic can be explained on the extension type. But, verbose constructor calls forDataAsset
andNativeCodeAsset
.[native_assets_cli] asset ids option 3 #1539
String get package
,String get name
,String get id => 'package:$package/$name';
onAsset
. More concise, in use. The logic needs to be explained on the getters. (Constructors takepackage
andname
to facilitate correct by construction.)[native_assets_cli] asset ids option 2 #1538
At the risk of more bike shedding. cc @mkustermann @mosuem @HosseinYousefi (Feel free to continue the discussion on #1410 instead of this PR.)