Skip to content

Commit

Permalink
[native_assets_cli] Add Builder and Linker interfaces and docs (#…
Browse files Browse the repository at this point in the history
…1174)

This PR adds an opinionated `Builder` and `Linker` interface with documentation on what builders and linkers should be used for.

Closes: #995

(Also, flips all versions back to WIP, now that the link hooks have landed in both Dart and Flutter.)
  • Loading branch information
dcharkes authored May 29, 2024
1 parent e5dee44 commit 7749425
Show file tree
Hide file tree
Showing 47 changed files with 306 additions and 170 deletions.
4 changes: 4 additions & 0 deletions pkgs/native_assets_builder/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.7.1-wip

- Nothing yet.

## 0.7.0

- Add support for `hook/link.dart` including dry runs.
Expand Down
10 changes: 5 additions & 5 deletions pkgs/native_assets_builder/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: native_assets_builder
description: >-
This package is the backend that invokes build hooks.
version: 0.7.0
version: 0.7.1-wip
repository: https://github.com/dart-lang/native/tree/main/pkgs/native_assets_builder

# publish_to: none
publish_to: none

environment:
sdk: '>=3.3.0 <4.0.0'
Expand All @@ -13,9 +13,9 @@ dependencies:
collection: ^1.18.0
graphs: ^2.3.1
logging: ^1.2.0
native_assets_cli: ^0.6.0
# native_assets_cli:
# path: ../native_assets_cli/
# native_assets_cli: ^0.6.0
native_assets_cli:
path: ../native_assets_cli/
package_config: ^2.1.0
yaml: ^3.1.2
yaml_edit: ^2.1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ void main(List<String> arguments) async {
dartBuildFiles: ['hook/build.dart'],
linkModePreference: LinkModePreference.dynamic,
).run(
buildConfig: config,
buildOutput: output,
config: config,
output: output,
logger: logger,
linkInPackage: 'add_asset_link',
);
Expand Down
12 changes: 6 additions & 6 deletions pkgs/native_assets_builder/test_data/add_asset_link/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ environment:
dependencies:
logging: ^1.1.1
meta: ^1.12.0
native_assets_cli: ^0.6.0
# native_assets_cli:
# path: ../../../native_assets_cli/
native_toolchain_c: ^0.4.2
# native_toolchain_c:
# path: ../../../native_toolchain_c/
# native_assets_cli: ^0.6.0
native_assets_cli:
path: ../../../native_assets_cli/
# native_toolchain_c: ^0.4.2
native_toolchain_c:
path: ../../../native_toolchain_c/

dev_dependencies:
lints: ^3.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ dependencies:
complex_link_helper:
path: ../complex_link_helper/
logging: ^1.1.1
native_assets_cli: ^0.6.0
# native_assets_cli:
# path: ../../../native_assets_cli/
# native_assets_cli: ^0.6.0
native_assets_cli:
path: ../../../native_assets_cli/

dev_dependencies:
lints: ^3.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ environment:
dependencies:
cli_config: ^0.2.0
logging: ^1.1.1
native_assets_cli: ^0.6.0
# native_assets_cli:
# path: ../../../native_assets_cli/
# native_assets_cli: ^0.6.0
native_assets_cli:
path: ../../../native_assets_cli/

dev_dependencies:
lints: ^3.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ environment:
dependencies:
cyclic_package_2:
path: ../cyclic_package_2
native_assets_cli: ^0.6.0
# native_assets_cli:
# path: ../../../native_assets_cli/
# native_assets_cli: ^0.6.0
native_assets_cli:
path: ../../../native_assets_cli/
yaml: ^3.1.1
yaml_edit: ^2.1.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ environment:
dependencies:
cyclic_package_1:
path: ../cyclic_package_1
native_assets_cli: ^0.6.0
# native_assets_cli:
# path: ../../../native_assets_cli/
# native_assets_cli: ^0.6.0
native_assets_cli:
path: ../../../native_assets_cli/
yaml: ^3.1.1
yaml_edit: ^2.1.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ void main(List<String> arguments) async {
dartBuildFiles: ['hook/build.dart'],
linkModePreference: LinkModePreference.dynamic,
).run(
buildConfig: config,
buildOutput: output,
config: config,
output: output,
logger: logger,
linkInPackage: packageName,
);
Expand All @@ -39,8 +39,8 @@ void main(List<String> arguments) async {
dartBuildFiles: ['hook/build.dart'],
linkModePreference: LinkModePreference.dynamic,
).run(
buildConfig: config,
buildOutput: output,
config: config,
output: output,
logger: logger,
linkInPackage: packageName,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ environment:
dependencies:
logging: ^1.1.1
meta: ^1.12.0
native_assets_cli: ^0.6.0
# native_assets_cli:
# path: ../../../native_assets_cli/
native_toolchain_c: ^0.4.2
# native_toolchain_c:
# path: ../../../native_toolchain_c/
# native_assets_cli: ^0.6.0
native_assets_cli:
path: ../../../native_assets_cli/
# native_toolchain_c: ^0.4.2
native_toolchain_c:
path: ../../../native_toolchain_c/

dev_dependencies:
lints: ^3.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ void main(List<String> arguments) async {
dartBuildFiles: ['hook/build.dart'],
);
await cbuilder.run(
buildConfig: config,
buildOutput: output,
config: config,
output: output,
logger: Logger('')
..level = Level.ALL
..onRecord.listen((record) {
Expand Down
12 changes: 6 additions & 6 deletions pkgs/native_assets_builder/test_data/native_add/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ environment:

dependencies:
logging: ^1.1.1
native_assets_cli: ^0.6.0
# native_assets_cli:
# path: ../../../native_assets_cli/
native_toolchain_c: ^0.4.2
# native_toolchain_c:
# path: ../../../native_toolchain_c/
# native_assets_cli: ^0.6.0
native_assets_cli:
path: ../../../native_assets_cli/
# native_toolchain_c: ^0.4.2
native_toolchain_c:
path: ../../../native_toolchain_c/

dev_dependencies:
ffigen: ^8.0.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ void main(List<String> arguments) async {
dartBuildFiles: ['hook/build.dart'],
);
await cbuilder.run(
buildConfig: config,
buildOutput: output,
config: config,
output: output,
logger: Logger('')
..level = Level.ALL
..onRecord.listen((record) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ environment:

dependencies:
logging: ^1.1.1
native_assets_cli: ^0.6.0
# native_assets_cli:
# path: ../../../native_assets_cli/
native_toolchain_c: ^0.4.2
# native_toolchain_c:
# path: ../../../native_toolchain_c/
# native_assets_cli: ^0.6.0
native_assets_cli:
path: ../../../native_assets_cli/
# native_toolchain_c: ^0.4.2
native_toolchain_c:
path: ../../../native_toolchain_c/

dev_dependencies:
ffigen: ^8.0.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ void main(List<String> arguments) async {
dartBuildFiles: ['hook/build.dart'],
);
await cbuilder.run(
buildConfig: config,
buildOutput: output,
config: config,
output: output,
logger: Logger('')
..level = Level.ALL
..onRecord.listen((record) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ environment:

dependencies:
logging: ^1.1.1
native_assets_cli: ^0.6.0
# native_assets_cli:
# path: ../../../native_assets_cli/
native_toolchain_c: ^0.4.2
# native_toolchain_c:
# path: ../../../native_toolchain_c/
# native_assets_cli: ^0.6.0
native_assets_cli:
path: ../../../native_assets_cli/
# native_toolchain_c: ^0.4.2
native_toolchain_c:
path: ../../../native_toolchain_c/

dev_dependencies:
ffigen: ^8.0.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ environment:
dependencies:
logging: ^1.1.1
meta: ^1.12.0
native_assets_cli: ^0.6.0
# native_assets_cli:
# path: ../../../native_assets_cli/
# native_assets_cli: ^0.6.0
native_assets_cli:
path: ../../../native_assets_cli/

dev_dependencies:
lints: ^3.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ environment:
sdk: '>=3.3.0 <4.0.0'

dependencies:
native_assets_cli: ^0.6.0
# native_assets_cli:
# path: ../../../native_assets_cli/
# native_assets_cli: ^0.6.0
native_assets_cli:
path: ../../../native_assets_cli/
package_with_metadata:
path: ../package_with_metadata/
yaml: ^3.1.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ environment:
sdk: '>=3.3.0 <4.0.0'

dependencies:
native_assets_cli: ^0.6.0
# native_assets_cli:
# path: ../../../native_assets_cli/
# native_assets_cli: ^0.6.0
native_assets_cli:
path: ../../../native_assets_cli/
yaml: ^3.1.1
yaml_edit: ^2.1.0

Expand Down
6 changes: 3 additions & 3 deletions pkgs/native_assets_builder/test_data/simple_link/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ environment:
dependencies:
cli_config: ^0.2.0
logging: ^1.1.1
native_assets_cli: ^0.6.0
# native_assets_cli:
# path: ../../../native_assets_cli/
# native_assets_cli: ^0.6.0
native_assets_cli:
path: ../../../native_assets_cli/

dev_dependencies:
lints: ^3.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ environment:
sdk: '>=3.3.0 <4.0.0'

dependencies:
native_assets_cli: ^0.6.0
# native_assets_cli:
# path: ../../../native_assets_cli/
# native_assets_cli: ^0.6.0
native_assets_cli:
path: ../../../native_assets_cli/
yaml: ^3.1.1
yaml_edit: ^2.1.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ environment:
sdk: '>=3.3.0 <4.0.0'

dependencies:
native_assets_cli: ^0.6.0
# native_assets_cli:
# path: ../../../native_assets_cli/
# native_assets_cli: ^0.6.0
native_assets_cli:
path: ../../../native_assets_cli/
yaml: ^3.1.1
yaml_edit: ^2.1.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ environment:
sdk: '>=3.3.0 <4.0.0'

dependencies:
native_assets_cli: ^0.6.0
# native_assets_cli:
# path: ../../../native_assets_cli/
# native_assets_cli: ^0.6.0
native_assets_cli:
path: ../../../native_assets_cli/
yaml: ^3.1.1
yaml_edit: ^2.1.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ environment:
sdk: '>=3.3.0 <4.0.0'

dependencies:
native_assets_cli: ^0.6.0
# native_assets_cli:
# path: ../../../native_assets_cli/
# native_assets_cli: ^0.6.0
native_assets_cli:
path: ../../../native_assets_cli/
yaml: ^3.1.1
yaml_edit: ^2.1.0

Expand Down
4 changes: 4 additions & 0 deletions pkgs/native_assets_cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.6.1-wip

- Introduce `Builder` and `Linker` interface.

## 0.6.0

- Add support for `hook/link.dart`.
Expand Down
6 changes: 3 additions & 3 deletions pkgs/native_assets_cli/example/build/local_asset/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ environment:

dependencies:
logging: ^1.1.1
native_assets_cli: ^0.6.0
# native_assets_cli:
# path: ../../../../native_assets_cli/
# native_assets_cli: ^0.6.0
native_assets_cli:
path: ../../../../native_assets_cli/

dev_dependencies:
ffigen: ^8.0.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ void main(List<String> args) async {
dartBuildFiles: ['hook/build.dart'],
);
await cbuilder.run(
buildConfig: config,
buildOutput: output,
config: config,
output: output,
logger: Logger('')
..level = Level.ALL
..onRecord.listen((record) => print(record.message)),
Expand Down
Loading

0 comments on commit 7749425

Please sign in to comment.