Skip to content

Commit b324678

Browse files
authored
[infra] Split up package:native_assets_cli (#2259)
Closes: #999 Splits up `package:native_assets_cli` in `package:hooks`, `package:code_assets` and `package:data_assets`. Renames `package:native_assets_builder` to `package:hooks_runner`. The dependencies are as follows: * `hooks` has dev dependencies on `code_assets` and `data_assets` because all the integration tests use these asset types. * `hooks_runner` has a dependency on `code_assets` due to the kernel-encoding `KernelAssets` which is used to bundle the code-assets asset-mapping in various SDKs. * `hooks_runner` has a dev dependency on `data_assets` because the integration tests use it. Versions: * The split up packages continue numbering from the original version. (It doesn't really matter, we'll need to go to 1.0.0 in the future anyway.) Internal package structure: * This PR does not reorganize packages. It moves the files exactly to the same path. This could use cleanup, but let's try to get this PR as small as possible. CI: * Two workflows are combined. (This could likely use some cleanup, especially trying to collect coverage across all packages in the workspace instead of a single package at the time.) Publishing: * These packages will now need their autopublishing set up. I'll do this after we bump the version to non-wip. Rolling: * This will need to be rolled into the Dart and Flutter SDKs. Changing the dependencies there and fixing whatever test setup explicitly mentioning the package names.
1 parent 7bca903 commit b324678

File tree

521 files changed

+1005
-1099
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

521 files changed

+1005
-1099
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
name: "package:code_assets"
3+
about: "Create a bug or file a feature request against package:code_assets."
4+
labels: "package:code_assets"
5+
---
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
name: "package:data_assets"
3+
about: "Create a bug or file a feature request against package:data_assets."
4+
labels: "package:data_assets"
5+
---

.github/ISSUE_TEMPLATE/hooks.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
name: "package:hooks"
3+
about: "Create a bug or file a feature request against package:hooks."
4+
labels: "package:hooks"
5+
---
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
name: "package:hooks_runner"
3+
about: "Create a bug or file a feature request against package:hooks_runner."
4+
labels: "package:hooks_runner"
5+
---

.github/ISSUE_TEMPLATE/native_assets_builder.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/native_assets_cli.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/labeler.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,21 @@
2020
- changed-files:
2121
- any-glob-to-any-file: 'pkgs/jnigen/**'
2222

23-
'package:native_assets_builder':
23+
'package:code_assets':
2424
- changed-files:
25-
- any-glob-to-any-file: 'pkgs/native_assets_builder/**'
25+
- any-glob-to-any-file: 'pkgs/code_assets/**'
2626

27-
'package:native_assets_cli':
27+
'package:data_assets':
2828
- changed-files:
29-
- any-glob-to-any-file: 'pkgs/native_assets_cli/**'
29+
- any-glob-to-any-file: 'pkgs/data_assets/**'
30+
31+
'package:hooks':
32+
- changed-files:
33+
- any-glob-to-any-file: 'pkgs/hooks/**'
34+
35+
'package:hooks_runner':
36+
- changed-files:
37+
- any-glob-to-any-file: 'pkgs/hooks_runner/**'
3038

3139
'package:native_toolchain_c':
3240
- changed-files:

.github/pr-title-checker-config.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
{
22
"CHECKS": {
33
"prefixes": [
4+
"[code_assets] ",
5+
"[data_assets] ",
46
"[ffi] ",
57
"[ffigen] ",
8+
"[hooks_runner] ",
9+
"[hooks] ",
610
"[infra] ",
711
"[jni] ",
812
"[jnigen] ",
9-
"[native_assets_builder] ",
10-
"[native_assets_cli] ",
1113
"[native_toolchain_c] ",
1214
"[objective_c] ",
1315
"[swift2objc] ",

.github/workflows/hooks.yaml

Lines changed: 0 additions & 63 deletions
This file was deleted.

.github/workflows/native.yaml

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,20 @@ on:
1010
# No `branches:` to enable stacked PRs on GitHub.
1111
paths:
1212
- ".github/workflows/native.yaml"
13-
- "pkgs/native_assets_builder/**"
14-
- "pkgs/native_assets_cli/**"
13+
- "pkgs/code_assets/**"
14+
- "pkgs/data_assets/**"
15+
- "pkgs/hooks_runner/**"
16+
- "pkgs/hooks/**"
1517
- "pkgs/native_toolchain_c/**"
1618
- "tools/**"
1719
push:
1820
branches: [main]
1921
paths:
2022
- ".github/workflows/native.yaml"
21-
- "pkgs/native_assets_builder/**"
22-
- "pkgs/native_assets_cli/**"
23+
- "pkgs/code_assets/**"
24+
- "pkgs/data_assets/**"
25+
- "pkgs/hooks_runner/**"
26+
- "pkgs/hooks/**"
2327
- "pkgs/native_toolchain_c/**"
2428
- "tools/**"
2529
schedule:
@@ -32,8 +36,13 @@ jobs:
3236
matrix:
3337
os: [ubuntu, macos, windows]
3438
sdk: [dev]
35-
package: [native_assets_builder, native_assets_cli, native_toolchain_c]
36-
# Breaking changes temporarily break the example run on the Dart SDK until native_assets_builder is rolled into the Dart SDK dev build.
39+
package:
40+
- code_assets
41+
- data_assets
42+
- hooks
43+
- hooks_runner
44+
- native_toolchain_c
45+
# Breaking changes temporarily break the example run on the Dart SDK until hooks_runner is rolled into the Dart SDK dev build.
3746
breaking-change: [false]
3847

3948
runs-on: ${{ matrix.os }}-latest
@@ -57,10 +66,10 @@ jobs:
5766
- run: dart pub get
5867

5968
- run: dart pub get -C test_data/native_add_version_skew/
60-
if: ${{ matrix.package == 'native_assets_builder' }}
69+
if: ${{ matrix.package == 'hooks_runner' }}
6170

6271
- run: dart pub get -C test_data/native_add_version_skew_2/
63-
if: ${{ matrix.package == 'native_assets_builder' }}
72+
if: ${{ matrix.package == 'hooks_runner' }}
6473

6574
- run: dart analyze --fatal-infos
6675
# Run on dev to ensure we're not depending on deprecated SDK things.
@@ -75,35 +84,43 @@ jobs:
7584

7685
- run: dart --enable-experiment=native-assets test
7786
working-directory: pkgs/${{ matrix.package }}/example/build/native_dynamic_linking/
78-
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'dev' && !matrix.breaking-change }}
87+
if: ${{ matrix.package == 'hooks' && matrix.sdk == 'dev' && !matrix.breaking-change }}
7988

8089
- run: dart --enable-experiment=native-assets test
8190
working-directory: pkgs/${{ matrix.package }}/example/build/native_add_app/
82-
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'dev' && !matrix.breaking-change }}
91+
if: ${{ matrix.package == 'hooks' && matrix.sdk == 'dev' && !matrix.breaking-change }}
8392

8493
- run: dart --enable-experiment=native-assets run
8594
working-directory: pkgs/${{ matrix.package }}/example/build/native_add_app/
86-
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'dev' && !matrix.breaking-change }}
95+
if: ${{ matrix.package == 'hooks' && matrix.sdk == 'dev' && !matrix.breaking-change }}
8796

8897
- run: dart --enable-experiment=native-assets build bin/native_add_app.dart
8998
working-directory: pkgs/${{ matrix.package }}/example/build/native_add_app/
90-
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'dev' && !matrix.breaking-change }}
99+
if: ${{ matrix.package == 'hooks' && matrix.sdk == 'dev' && !matrix.breaking-change }}
91100

92101
- run: ./native_add_app.exe
93102
working-directory: pkgs/${{ matrix.package }}/example/build/native_add_app/bin/native_add_app/
94-
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'dev' && !matrix.breaking-change }}
103+
if: ${{ matrix.package == 'hooks' && matrix.sdk == 'dev' && !matrix.breaking-change }}
95104

96105
- run: dart --enable-experiment=native-assets test
97106
working-directory: pkgs/${{ matrix.package }}/example/build/use_dart_api/
98-
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'dev' && !matrix.breaking-change }}
107+
if: ${{ matrix.package == 'hooks' && matrix.sdk == 'dev' && !matrix.breaking-change }}
99108

100109
- run: dart --enable-experiment=native-assets test
101110
working-directory: pkgs/${{ matrix.package }}/example/build/download_asset/
102-
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'dev' && !matrix.breaking-change }}
111+
if: ${{ matrix.package == 'hooks' && matrix.sdk == 'dev' && !matrix.breaking-change }}
103112

104113
- run: dart --enable-experiment=native-assets test
105114
working-directory: pkgs/${{ matrix.package }}/example/build/system_library/
106-
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'dev' && !matrix.breaking-change }}
115+
if: ${{ matrix.package == 'hooks' && matrix.sdk == 'dev' && !matrix.breaking-change }}
116+
117+
- run: |
118+
dart tool/generate_schemas.dart
119+
dart tool/generate_syntax.dart
120+
dart tool/normalize.dart
121+
git diff --exit-code
122+
working-directory: pkgs/${{ matrix.package }}
123+
if: ${{ matrix.package == 'hook' && matrix.sdk == 'dev' }}
107124
108125
- name: Install coverage
109126
run: dart pub global activate coverage

0 commit comments

Comments
 (0)