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] Add DartCApi #1937

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

[native_assets_cli] Add DartCApi #1937

wants to merge 1 commit into from

Conversation

dcharkes
Copy link
Collaborator

@dcharkes dcharkes commented Jan 23, 2025

This PR adds an (optional) path to the Dart C API. Both Dart and Flutter will be able to provide this.

For C code that's compiled in the hook, the path can be used directly.

For C code that's precompiled and pulled in via from a CDN, the version number should be checked in the hook.

Does not yet update the example in pkgs/native_assets_cli/example/build/use_dart_api/ because it's run against the released Dart and Flutter on CI. We should update it after Dart and Flutter pass in the API.

Bug: #839

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

@github-actions github-actions bot added the type-infra A repository infrastructure change or enhancement label Jan 23, 2025
@coveralls
Copy link

coveralls commented Jan 23, 2025

Coverage Status

coverage: 88.37% (+0.02%) from 88.352%
when pulling 335ae24 on dart-api
into 7a72868 on main.

@dcharkes dcharkes marked this pull request as ready for review January 23, 2025 16:30
Copy link
Contributor

@brianquinlan brianquinlan left a comment

Choose a reason for hiding this comment

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

I have no context for this but it seems reasonable.

/// Only `dart_api_dl.h` should be used. `dart_api_dl.c` shoud be compiled into
/// your `CodeAsset`.
///
/// Note: If you're precompiling code assets, you must check that [version] is
Copy link
Contributor

Choose a reason for hiding this comment

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

This documentation might not be sufficient in the long wrong - how would I check that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:native_assets_builder package:native_assets_cli type-infra A repository infrastructure change or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants