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] Drop Config suffixes v1 #1829

Closed
wants to merge 1 commit into from
Closed

Conversation

dcharkes
Copy link
Collaborator

@dcharkes dcharkes commented Dec 18, 2024

Addresses:

A variant of:

This PR normalizes the code and data specific APIs on the config, config builder, output and output builders under a .code and .data extension. Except for the assets, the are available under config/output.assets.code and config/output.assets.data.

Example link hook code:

void main(List<String> args) async {
  await link(
    args,
    (config, output) async =>
        output.data.addAssets(treeshake(config.assets.data)),
  );
}

Example build hook code:

void main(List<String> arguments) async {
  await build(arguments, (config, output) async {
    if (config.code.targetOS == OS.android) {
      config.code.android.targetNdkApi;
    }

    output.code.addAsset( ... );
  });
}

This drops Config suffixes from the various config accessors.
This changes output.codeAssets.add( to output.code.addAsset(.

The weird quirk in this PR is that the list of assets per type is available under config.assets.code while all the other code related things are available under config.code and output.code. To address this see:

@coveralls
Copy link

coveralls commented Dec 18, 2024

Coverage Status

coverage: 88.07% (+0.1%) from 87.965%
when pulling c9c6362 on config-names-v1
into 8c16b6c on main.

@dcharkes
Copy link
Collaborator Author

#1738 (comment)

@dcharkes dcharkes closed this Dec 19, 2024
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.

2 participants