Skip to content

Commit 2c05819

Browse files
committed
[native_assets_cli] Nest config extensions
1 parent e2bd08e commit 2c05819

20 files changed

+532
-176
lines changed

pkgs/code_assets/doc/schema/hook/shared_definitions.generated.schema.json

+18
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
},
1414
{
1515
"$ref": "../shared/shared_definitions.generated.schema.json#/definitions/BuildInput"
16+
},
17+
{
18+
"$ref": "shared_definitions.schema.json#/definitions/BuildInput"
1619
}
1720
]
1821
},
@@ -26,6 +29,9 @@
2629
},
2730
{
2831
"$ref": "../shared/shared_definitions.generated.schema.json#/definitions/BuildOutput"
32+
},
33+
{
34+
"$ref": "shared_definitions.schema.json#/definitions/BuildOutput"
2935
}
3036
]
3137
},
@@ -36,6 +42,9 @@
3642
},
3743
{
3844
"$ref": "../shared/shared_definitions.generated.schema.json#/definitions/HookInput"
45+
},
46+
{
47+
"$ref": "shared_definitions.schema.json#/definitions/HookInput"
3948
}
4049
]
4150
},
@@ -46,6 +55,9 @@
4655
},
4756
{
4857
"$ref": "../shared/shared_definitions.generated.schema.json#/definitions/HookOutput"
58+
},
59+
{
60+
"$ref": "shared_definitions.schema.json#/definitions/HookOutput"
4961
}
5062
]
5163
},
@@ -59,6 +71,9 @@
5971
},
6072
{
6173
"$ref": "../shared/shared_definitions.generated.schema.json#/definitions/LinkInput"
74+
},
75+
{
76+
"$ref": "shared_definitions.schema.json#/definitions/LinkInput"
6277
}
6378
]
6479
},
@@ -72,6 +87,9 @@
7287
},
7388
{
7489
"$ref": "../shared/shared_definitions.generated.schema.json#/definitions/LinkOutput"
90+
},
91+
{
92+
"$ref": "shared_definitions.schema.json#/definitions/LinkOutput"
7593
}
7694
]
7795
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"$schema": "https://json-schema.org/draft-07/schema#",
3+
"title": "package:code_assets party:sdk shared definitions",
4+
"definitions": {
5+
"BuildInput": {},
6+
"BuildOutput": {},
7+
"HookInput": {
8+
"properties": {
9+
"config": {
10+
"properties": {
11+
"code": {
12+
"$comment": "Future SDKs will no longer provide 'code', 'extensions.code_config' instead.",
13+
"deprecated": true
14+
}
15+
}
16+
}
17+
}
18+
},
19+
"HookOutput": {},
20+
"LinkInput": {},
21+
"LinkOutput": {}
22+
}
23+
}

pkgs/code_assets/doc/schema/sdk/shared_definitions.generated.schema.json

+18
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
},
1414
{
1515
"$ref": "../shared/shared_definitions.generated.schema.json#/definitions/BuildInput"
16+
},
17+
{
18+
"$ref": "shared_definitions.schema.json#/definitions/BuildInput"
1619
}
1720
]
1821
},
@@ -26,6 +29,9 @@
2629
},
2730
{
2831
"$ref": "../shared/shared_definitions.generated.schema.json#/definitions/BuildOutput"
32+
},
33+
{
34+
"$ref": "shared_definitions.schema.json#/definitions/BuildOutput"
2935
}
3036
]
3137
},
@@ -36,6 +42,9 @@
3642
},
3743
{
3844
"$ref": "../shared/shared_definitions.generated.schema.json#/definitions/HookInput"
45+
},
46+
{
47+
"$ref": "shared_definitions.schema.json#/definitions/HookInput"
3948
}
4049
]
4150
},
@@ -46,6 +55,9 @@
4655
},
4756
{
4857
"$ref": "../shared/shared_definitions.generated.schema.json#/definitions/HookOutput"
58+
},
59+
{
60+
"$ref": "shared_definitions.schema.json#/definitions/HookOutput"
4961
}
5062
]
5163
},
@@ -59,6 +71,9 @@
5971
},
6072
{
6173
"$ref": "../shared/shared_definitions.generated.schema.json#/definitions/LinkInput"
74+
},
75+
{
76+
"$ref": "shared_definitions.schema.json#/definitions/LinkInput"
6277
}
6378
]
6479
},
@@ -72,6 +87,9 @@
7287
},
7388
{
7489
"$ref": "../shared/shared_definitions.generated.schema.json#/definitions/LinkOutput"
90+
},
91+
{
92+
"$ref": "shared_definitions.schema.json#/definitions/LinkOutput"
7593
}
7694
]
7795
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "https://json-schema.org/draft-07/schema#",
3+
"title": "package:code_assets party:sdk shared definitions",
4+
"definitions": {
5+
"BuildInput": {},
6+
"BuildOutput": {},
7+
"HookInput": {
8+
"properties": {
9+
"config": {
10+
"properties": {
11+
"code": {
12+
"$comment": "Old hooks still read 'code' so provide both 'code' and 'extensions.code_config'."
13+
}
14+
}
15+
}
16+
}
17+
},
18+
"HookOutput": {},
19+
"LinkInput": {},
20+
"LinkOutput": {}
21+
}
22+
}

pkgs/code_assets/doc/schema/shared/shared_definitions.schema.json

+11
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,17 @@
255255
"properties": {
256256
"code": {
257257
"$ref": "#/definitions/CodeConfig"
258+
},
259+
"extensions": {
260+
"$ref": "#/definitions/ConfigExtensions"
261+
}
262+
}
263+
},
264+
"ConfigExtensions": {
265+
"type": "object",
266+
"properties": {
267+
"code_assets": {
268+
"$ref": "#/definitions/CodeConfig"
258269
}
259270
}
260271
},

pkgs/code_assets/test/data/build_input_android.json

+15
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,21 @@
1717
"target_architecture": "arm",
1818
"target_os": "android"
1919
},
20+
"extensions": {
21+
"code_assets": {
22+
"android": {
23+
"target_ndk_api": 21
24+
},
25+
"c_compiler": {
26+
"ar": "/Users/dacoharkes/Library/Android/sdk/ndk/28.0.12674087/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ar",
27+
"cc": "/Users/dacoharkes/Library/Android/sdk/ndk/28.0.12674087/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang",
28+
"ld": "/Users/dacoharkes/Library/Android/sdk/ndk/28.0.12674087/toolchains/llvm/prebuilt/darwin-x86_64/bin/ld.lld"
29+
},
30+
"link_mode_preference": "dynamic",
31+
"target_architecture": "arm",
32+
"target_os": "android"
33+
}
34+
},
2035
"linking_enabled": true
2136
},
2237
"out_dir": "/Users/dacoharkes/src/dacoharkes/playground/my_package/example/.dart_tool/native_assets_builder/my_package/c540d75d10834674921701cd6c3c7c15/out/",

pkgs/code_assets/test/data/build_input_ios.json

+16
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,22 @@
1818
"target_architecture": "arm64",
1919
"target_os": "ios"
2020
},
21+
"extensions": {
22+
"code_assets": {
23+
"c_compiler": {
24+
"ar": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar",
25+
"cc": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang",
26+
"ld": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld"
27+
},
28+
"ios": {
29+
"target_sdk": "iphonesimulator",
30+
"target_version": 12
31+
},
32+
"link_mode_preference": "dynamic",
33+
"target_architecture": "arm64",
34+
"target_os": "ios"
35+
}
36+
},
2137
"linking_enabled": false
2238
},
2339
"out_dir": "/Users/dacoharkes/src/dacoharkes/playground/my_package/example/.dart_tool/native_assets_builder/my_package/51d66b45a7c440edc44bf124509a5dda/out/",

pkgs/code_assets/test/data/build_input_linux.json

+12
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@
1414
"target_architecture": "x64",
1515
"target_os": "linux"
1616
},
17+
"extensions": {
18+
"code_assets": {
19+
"c_compiler": {
20+
"ar": "/usr/lib/llvm-16/bin/llvm-ar",
21+
"cc": "/usr/lib/llvm-16/bin/clang",
22+
"ld": "/usr/lib/llvm-16/bin/ld.lld"
23+
},
24+
"link_mode_preference": "dynamic",
25+
"target_architecture": "x64",
26+
"target_os": "linux"
27+
}
28+
},
1729
"linking_enabled": false
1830
},
1931
"out_dir": "/usr/local/google/home/dacoharkes/src/dacoharkes/playground/my_package/example/.dart_tool/native_assets_builder/my_package/79cc7fbaec53b1465c3e388e6848234b/out/",

pkgs/code_assets/test/data/build_input_macos.json

+15
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,21 @@
1717
"target_architecture": "arm64",
1818
"target_os": "macos"
1919
},
20+
"extensions": {
21+
"code_assets": {
22+
"c_compiler": {
23+
"ar": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar",
24+
"cc": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang",
25+
"ld": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld"
26+
},
27+
"link_mode_preference": "dynamic",
28+
"macos": {
29+
"target_version": 13
30+
},
31+
"target_architecture": "arm64",
32+
"target_os": "macos"
33+
}
34+
},
2035
"linking_enabled": false
2136
},
2237
"dependency_metadata": {

pkgs/code_assets/test/data/build_input_windows.json

+20
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,26 @@
2222
"target_architecture": "x64",
2323
"target_os": "windows"
2424
},
25+
"extensions": {
26+
"code_assets": {
27+
"c_compiler": {
28+
"ar": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.35.32215\\bin\\Hostx64\\x64\\lib.exe",
29+
"cc": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.35.32215\\bin\\Hostx64\\x64\\cl.exe",
30+
"env_script": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat",
31+
"env_script_arguments": [],
32+
"ld": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.35.32215\\bin\\Hostx64\\x64\\link.exe",
33+
"windows": {
34+
"developer_command_prompt": {
35+
"arguments": [],
36+
"script": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat"
37+
}
38+
}
39+
},
40+
"link_mode_preference": "dynamic",
41+
"target_architecture": "x64",
42+
"target_os": "windows"
43+
}
44+
},
2545
"linking_enabled": false
2646
},
2747
"out_dir": "C:\\src\\dacoharkes\\playground\\my_package\\example\\.dart_tool\\native_assets_builder\\my_package\\190c04c47dc2f9eb26d2411b1968b2cf\\out\\",

pkgs/code_assets/test/data/link_input_macos.json

+15
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@
2828
},
2929
"target_architecture": "arm64",
3030
"target_os": "macos"
31+
},
32+
"extensions": {
33+
"code_assets": {
34+
"c_compiler": {
35+
"ar": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar",
36+
"cc": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang",
37+
"ld": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld"
38+
},
39+
"link_mode_preference": "dynamic",
40+
"macos": {
41+
"target_version": 13
42+
},
43+
"target_architecture": "arm64",
44+
"target_os": "macos"
45+
}
3146
}
3247
},
3348
"out_dir": "/Users/dacoharkes/src/dacoharkes/playground/my_package/example/.dart_tool/native_assets_builder/my_package/ca4e7d3d4e7b8912cbd24d9e8a6cecdc/out/",

0 commit comments

Comments
 (0)