Skip to content
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] Move targetOS to CodeConfig #1806

Merged
merged 2 commits into from
Dec 11, 2024
Merged

Conversation

dcharkes
Copy link
Collaborator

@dcharkes dcharkes commented Dec 11, 2024

Next refactoring in:

We move config.targetOS to config.codeConfig.targetOS. Other asset types might not get access on the target OS.

This will require a manual roll into dartdev and flutter tools due to the targetOS now having to be passed in via setupCodeConfig instead of the base config.

The native assets builder will still emit the same JSON if code assets are supported. Since both Dart and Flutter support code assets currently, this will not break anything. Once data assets for web in Flutter are added, all existing build hooks that assume code assets are always supported will break.

@coveralls
Copy link

coveralls commented Dec 11, 2024

Coverage Status

coverage: 87.713% (-0.04%) from 87.75%
when pulling 7a76386 on move-targetos
into 2cecc88 on main.

@dcharkes dcharkes requested a review from mkustermann December 11, 2024 18:58
pkgs/native_assets_cli/CHANGELOG.md Outdated Show resolved Hide resolved
pkgs/native_assets_cli/lib/native_assets_cli.dart Outdated Show resolved Hide resolved
@@ -188,7 +189,7 @@ class CBuilder extends CTool implements Builder {
name: assetName!,
file: libUri,
linkMode: linkMode,
os: config.targetOS,
os: config.codeConfig.targetOS,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we pass os: and architecture: separately. It may? be more idiomatic to pass an Abi object here instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we go that direction, we should also have config.codeConfig.targetAbi instead of OS and architecture. But that might make config.codeConfig.android.ndkVersion less obvious again. Anyway, let's discuss that in a separate issue.

@dcharkes
Copy link
Collaborator Author

Thanks @mkustermann!

@auto-submit auto-submit bot merged commit 2542108 into main Dec 11, 2024
24 checks passed
@auto-submit auto-submit bot deleted the move-targetos branch December 11, 2024 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants