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_builder] Support pub workspaces 2 #1921

Merged
merged 2 commits into from
Jan 22, 2025

Conversation

dcharkes
Copy link
Collaborator

@dcharkes dcharkes commented Jan 22, 2025

Closes: #1905

This does a bigger refactoring to take runPackageName into account when checking for "if there are packages with native assets".

It changes the public API in the following way:

  • PackageLayout no longer has methods for if packages have hooks, as it does not take into account the dependency graph
  • NativeAssetsBuildRunner now exposes a method to query whether any packages in the dependencies have build hooks
  • (The implementation is in the BuildPlanner, and this class stays internal.)

This means that PackageLayout has the API to provide the right package layout to the NativeAssetsBuildRunner, and the NativeAssetsBuildRunner has the methods to be queried by embedders/launchers.

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 January 22, 2025 09:21
@dcharkes dcharkes force-pushed the nab-pub-workspaces-take-2 branch from 549efc9 to 79b92d2 Compare January 22, 2025 09:25
@coveralls
Copy link

Coverage Status

coverage: 83.877% (+0.04%) from 83.842%
when pulling 549efc9 on nab-pub-workspaces-take-2
into 3849808 on main.

@coveralls
Copy link

coveralls commented Jan 22, 2025

Coverage Status

coverage: 83.877% (+0.04%) from 83.842%
when pulling 4459491 on nab-pub-workspaces-take-2
into 3849808 on main.

@@ -713,7 +724,7 @@ ${compileResult.stdout}

if (input is BuildInput) {
final packagesWithLink =
(await packageLayout.packagesWithAssets(Hook.link))
(await (await _planner).packagesWithHook(Hook.link))
Copy link
Member

Choose a reason for hiding this comment

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

Nested awaits do make my skin crawl a bit ;)

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps

final planner = await _planner;
final packagesWithHook = await planner.packagesWithHook(Hook.build);

further above could be extracted to a method to alleviate this here and in other places, as the _planner is mostly accessed to run packagesWithHook. Just a nit.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed with the skin crawl, I already adopted final planner = await _planner; in other places.

@dcharkes
Copy link
Collaborator Author

Thanks @mosuem!

@auto-submit auto-submit bot merged commit 4282a79 into main Jan 22, 2025
40 checks passed
@auto-submit auto-submit bot deleted the nab-pub-workspaces-take-2 branch January 22, 2025 10:29
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.

[native_assets_builder] Support pub workspaces
3 participants