Skip to content

[native_assets_cli] Hide CodeAsset.type and DataAsset.type #2140

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 1 commit into from
Mar 28, 2025

Conversation

dcharkes
Copy link
Collaborator

@dcharkes dcharkes commented Mar 27, 2025

Bug: #2132

This PR hides the asset types inside the respective extensions:

  • In hooks:
    • Add extensions on EncodedAsset such as isCodeAsset to check if something is a certain asset.
    • Use the buildCodeAssets and buildDataAssets extensions everywhere.
  • For BuildInput builders:
    • Use setupBuildInput from the ProtocolExtensions. (ProtocolExtension.buildAssetTypes has been made private and folded into setupBuildInput and setupLinkInput.)

This enables two things:

  • Having more than one asset type per protocol, and prevent SDKs from adding in a certain asset type to the build input. (If SDKs only want to use a subset of asset types of a protocol extension, such should be configured via the constructor of protocol extension.)
  • Migrating asset types, asset types can have more than one type this way. (This enables addressing [native_assets_cli] Provide guidance on name spacing extensions #2132)

Notable cleanups

  • Some tests relied on passing around an identifier for which asset types to build, this is now addressed with enum BuildAssetType { code, data }.

Copy link

PR Health

Breaking changes ✔️
Package Change Current Version New Version Needed Version Looking good?
Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

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.

Package Leaked API symbols
License Headers ✔️
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
Files
no missing headers

All source files should start with a license header.

Unrelated files missing license headers
Files
pkgs/jni/lib/src/third_party/generated_bindings.dart
pkgs/objective_c/lib/src/ns_input_stream.dart

@dcharkes dcharkes marked this pull request as ready for review March 27, 2025 07:57
@dcharkes dcharkes removed the request for review from HosseinYousefi March 27, 2025 10:29
@dcharkes dcharkes force-pushed the code-asset-arch-os-optional branch from 41d4cc5 to 13816ef Compare March 27, 2025 13:56
@dcharkes dcharkes force-pushed the code-asset-arch-os-optional branch from 13816ef to 7d51bb6 Compare March 27, 2025 14:32
Base automatically changed from code-asset-arch-os-optional to main March 27, 2025 14:42
@coveralls
Copy link

Coverage Status

coverage: 85.376% (+0.2%) from 85.225%
when pulling c08c236 on hide-asset-type
into 4a0fbd5 on main.

@dcharkes dcharkes merged commit 875d06e into main Mar 28, 2025
33 checks passed
@dcharkes dcharkes deleted the hide-asset-type branch March 28, 2025 16:10
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