From 33b69bb0070d5519cc4aa97d7c6a218a0c1298bb Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Tue, 3 Sep 2024 13:22:49 +0200 Subject: [PATCH 1/3] [native_*] Back to wip --- pkgs/native_assets_builder/CHANGELOG.md | 4 ++ pkgs/native_assets_builder/pubspec.yaml | 10 +-- .../test_data/add_asset_link/pubspec.yaml | 12 ++-- .../test_data/complex_link/pubspec.yaml | 6 +- .../complex_link_helper/pubspec.yaml | 6 +- .../test_data/cyclic_package_1/pubspec.yaml | 6 +- .../test_data/cyclic_package_2/pubspec.yaml | 6 +- .../test_data/drop_dylib_link/pubspec.yaml | 12 ++-- .../fail_on_os_sdk_version/pubspec.yaml | 6 +- .../fail_on_os_sdk_version_link/pubspec.yaml | 6 +- .../pubspec.yaml | 6 +- .../test_data/native_add/pubspec.yaml | 12 ++-- .../native_add_add_source/pubspec.yaml | 12 ++-- .../test_data/native_subtract/pubspec.yaml | 12 ++-- .../test_data/no_asset_for_link/pubspec.yaml | 6 +- .../package_reading_metadata/pubspec.yaml | 6 +- .../package_with_metadata/pubspec.yaml | 6 +- .../test_data/simple_data_asset/pubspec.yaml | 6 +- .../test_data/simple_link/pubspec.yaml | 6 +- .../treeshaking_native_libs/pubspec.yaml | 12 ++-- .../test_data/wrong_build_output/pubspec.yaml | 6 +- .../wrong_build_output_2/pubspec.yaml | 6 +- .../wrong_build_output_3/pubspec.yaml | 6 +- .../wrong_namespace_asset/pubspec.yaml | 6 +- pkgs/native_assets_cli/CHANGELOG.md | 4 ++ .../example/build/local_asset/pubspec.yaml | 6 +- .../build/native_add_library/pubspec.yaml | 12 ++-- .../build/native_dynamic_linking/pubspec.yaml | 6 +- .../example/build/use_dart_api/pubspec.yaml | 6 +- .../link/package_with_assets/pubspec.yaml | 6 +- pkgs/native_assets_cli/pubspec.yaml | 3 +- pkgs/native_assets_cli/tool/dependencies.dart | 67 +++++++++++++++++++ pkgs/native_toolchain_c/CHANGELOG.md | 4 ++ pkgs/native_toolchain_c/pubspec.yaml | 10 +-- 34 files changed, 195 insertions(+), 111 deletions(-) create mode 100644 pkgs/native_assets_cli/tool/dependencies.dart diff --git a/pkgs/native_assets_builder/CHANGELOG.md b/pkgs/native_assets_builder/CHANGELOG.md index a33e52ab1..9a46381f1 100644 --- a/pkgs/native_assets_builder/CHANGELOG.md +++ b/pkgs/native_assets_builder/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.8.3-wip + +- Nothing yet. + ## 0.8.2 - Fix some more cases of: `BuildConfig.dependencies` and diff --git a/pkgs/native_assets_builder/pubspec.yaml b/pkgs/native_assets_builder/pubspec.yaml index 959f9d1a9..387839ec9 100644 --- a/pkgs/native_assets_builder/pubspec.yaml +++ b/pkgs/native_assets_builder/pubspec.yaml @@ -1,9 +1,11 @@ name: native_assets_builder description: >- This package is the backend that invokes build hooks. -version: 0.8.2 +version: 0.8.3-wip repository: https://github.com/dart-lang/native/tree/main/pkgs/native_assets_builder +publish_to: none + environment: sdk: '>=3.3.0 <4.0.0' @@ -11,9 +13,9 @@ dependencies: collection: ^1.18.0 graphs: ^2.3.1 logging: ^1.2.0 - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../native_assets_cli/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../native_assets_cli/ package_config: ^2.1.0 yaml: ^3.1.2 yaml_edit: ^2.1.0 diff --git a/pkgs/native_assets_builder/test_data/add_asset_link/pubspec.yaml b/pkgs/native_assets_builder/test_data/add_asset_link/pubspec.yaml index 5c8c35f54..d73644401 100644 --- a/pkgs/native_assets_builder/test_data/add_asset_link/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/add_asset_link/pubspec.yaml @@ -10,12 +10,12 @@ environment: dependencies: logging: ^1.1.1 meta: ^1.12.0 - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../native_assets_cli/ - native_toolchain_c: ^0.5.3 - # native_toolchain_c: - # path: ../../../native_toolchain_c/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../native_assets_cli/ + # native_toolchain_c: ^0.5.3 + native_toolchain_c: + path: ../../../native_toolchain_c/ dev_dependencies: lints: ^3.0.0 diff --git a/pkgs/native_assets_builder/test_data/complex_link/pubspec.yaml b/pkgs/native_assets_builder/test_data/complex_link/pubspec.yaml index 6b574df66..7c3dc2cb9 100644 --- a/pkgs/native_assets_builder/test_data/complex_link/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/complex_link/pubspec.yaml @@ -12,9 +12,9 @@ dependencies: complex_link_helper: path: ../complex_link_helper/ logging: ^1.1.1 - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../native_assets_cli/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../native_assets_cli/ dev_dependencies: lints: ^3.0.0 diff --git a/pkgs/native_assets_builder/test_data/complex_link_helper/pubspec.yaml b/pkgs/native_assets_builder/test_data/complex_link_helper/pubspec.yaml index 3a4a657be..9d6a6c1f0 100644 --- a/pkgs/native_assets_builder/test_data/complex_link_helper/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/complex_link_helper/pubspec.yaml @@ -10,9 +10,9 @@ environment: dependencies: cli_config: ^0.2.0 logging: ^1.1.1 - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../native_assets_cli/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../native_assets_cli/ dev_dependencies: lints: ^3.0.0 diff --git a/pkgs/native_assets_builder/test_data/cyclic_package_1/pubspec.yaml b/pkgs/native_assets_builder/test_data/cyclic_package_1/pubspec.yaml index 4c824ea94..ec76b0a39 100644 --- a/pkgs/native_assets_builder/test_data/cyclic_package_1/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/cyclic_package_1/pubspec.yaml @@ -10,9 +10,9 @@ environment: dependencies: cyclic_package_2: path: ../cyclic_package_2 - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../native_assets_cli/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../native_assets_cli/ yaml: ^3.1.1 yaml_edit: ^2.1.0 diff --git a/pkgs/native_assets_builder/test_data/cyclic_package_2/pubspec.yaml b/pkgs/native_assets_builder/test_data/cyclic_package_2/pubspec.yaml index 00adadadc..7dd179f65 100644 --- a/pkgs/native_assets_builder/test_data/cyclic_package_2/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/cyclic_package_2/pubspec.yaml @@ -10,9 +10,9 @@ environment: dependencies: cyclic_package_1: path: ../cyclic_package_1 - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../native_assets_cli/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../native_assets_cli/ yaml: ^3.1.1 yaml_edit: ^2.1.0 diff --git a/pkgs/native_assets_builder/test_data/drop_dylib_link/pubspec.yaml b/pkgs/native_assets_builder/test_data/drop_dylib_link/pubspec.yaml index b17de1e8d..0bfa7ccb5 100644 --- a/pkgs/native_assets_builder/test_data/drop_dylib_link/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/drop_dylib_link/pubspec.yaml @@ -10,12 +10,12 @@ environment: dependencies: logging: ^1.1.1 meta: ^1.12.0 - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../native_assets_cli/ - native_toolchain_c: ^0.5.3 - # native_toolchain_c: - # path: ../../../native_toolchain_c/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../native_assets_cli/ + # native_toolchain_c: ^0.5.3 + native_toolchain_c: + path: ../../../native_toolchain_c/ dev_dependencies: lints: ^3.0.0 diff --git a/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version/pubspec.yaml b/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version/pubspec.yaml index d68f06aa8..6724d21d3 100644 --- a/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version/pubspec.yaml @@ -8,9 +8,9 @@ environment: sdk: '>=3.3.0 <4.0.0' dependencies: - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../native_assets_cli/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../native_assets_cli/ dev_dependencies: ffigen: ^8.0.2 diff --git a/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version_link/pubspec.yaml b/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version_link/pubspec.yaml index 5e6f4df50..90794c99e 100644 --- a/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version_link/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version_link/pubspec.yaml @@ -10,9 +10,9 @@ environment: dependencies: fail_on_os_sdk_version_linker: path: ../fail_on_os_sdk_version_linker/ - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../native_assets_cli/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../native_assets_cli/ dev_dependencies: ffigen: ^8.0.2 diff --git a/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version_linker/pubspec.yaml b/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version_linker/pubspec.yaml index 3e4f200ed..ca1cc14fd 100644 --- a/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version_linker/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version_linker/pubspec.yaml @@ -8,9 +8,9 @@ environment: sdk: '>=3.3.0 <4.0.0' dependencies: - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../native_assets_cli/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../native_assets_cli/ dev_dependencies: ffigen: ^8.0.2 diff --git a/pkgs/native_assets_builder/test_data/native_add/pubspec.yaml b/pkgs/native_assets_builder/test_data/native_add/pubspec.yaml index 6f852827e..a57c6eed9 100644 --- a/pkgs/native_assets_builder/test_data/native_add/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/native_add/pubspec.yaml @@ -9,12 +9,12 @@ environment: dependencies: logging: ^1.1.1 - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../native_assets_cli/ - native_toolchain_c: ^0.5.3 - # native_toolchain_c: - # path: ../../../native_toolchain_c/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../native_assets_cli/ + # native_toolchain_c: ^0.5.3 + native_toolchain_c: + path: ../../../native_toolchain_c/ dev_dependencies: ffigen: ^8.0.2 diff --git a/pkgs/native_assets_builder/test_data/native_add_add_source/pubspec.yaml b/pkgs/native_assets_builder/test_data/native_add_add_source/pubspec.yaml index 1bcb032fa..fdd489b14 100644 --- a/pkgs/native_assets_builder/test_data/native_add_add_source/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/native_add_add_source/pubspec.yaml @@ -9,12 +9,12 @@ environment: dependencies: logging: ^1.1.1 - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../native_assets_cli/ - native_toolchain_c: ^0.5.3 - # native_toolchain_c: - # path: ../../../native_toolchain_c/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../native_assets_cli/ + # native_toolchain_c: ^0.5.3 + native_toolchain_c: + path: ../../../native_toolchain_c/ dev_dependencies: ffigen: ^8.0.2 diff --git a/pkgs/native_assets_builder/test_data/native_subtract/pubspec.yaml b/pkgs/native_assets_builder/test_data/native_subtract/pubspec.yaml index 74bf01c6f..6ce9a56df 100644 --- a/pkgs/native_assets_builder/test_data/native_subtract/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/native_subtract/pubspec.yaml @@ -9,12 +9,12 @@ environment: dependencies: logging: ^1.1.1 - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../native_assets_cli/ - native_toolchain_c: ^0.5.3 - # native_toolchain_c: - # path: ../../../native_toolchain_c/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../native_assets_cli/ + # native_toolchain_c: ^0.5.3 + native_toolchain_c: + path: ../../../native_toolchain_c/ dev_dependencies: ffigen: ^8.0.2 diff --git a/pkgs/native_assets_builder/test_data/no_asset_for_link/pubspec.yaml b/pkgs/native_assets_builder/test_data/no_asset_for_link/pubspec.yaml index a5198938d..0aade4602 100644 --- a/pkgs/native_assets_builder/test_data/no_asset_for_link/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/no_asset_for_link/pubspec.yaml @@ -10,9 +10,9 @@ environment: dependencies: logging: ^1.1.1 meta: ^1.12.0 - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../native_assets_cli/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../native_assets_cli/ dev_dependencies: lints: ^3.0.0 diff --git a/pkgs/native_assets_builder/test_data/package_reading_metadata/pubspec.yaml b/pkgs/native_assets_builder/test_data/package_reading_metadata/pubspec.yaml index 52c83072e..4e74cfa16 100644 --- a/pkgs/native_assets_builder/test_data/package_reading_metadata/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/package_reading_metadata/pubspec.yaml @@ -8,9 +8,9 @@ environment: sdk: '>=3.3.0 <4.0.0' dependencies: - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../native_assets_cli/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../native_assets_cli/ package_with_metadata: path: ../package_with_metadata/ yaml: ^3.1.1 diff --git a/pkgs/native_assets_builder/test_data/package_with_metadata/pubspec.yaml b/pkgs/native_assets_builder/test_data/package_with_metadata/pubspec.yaml index f2c31b662..3719d79d6 100644 --- a/pkgs/native_assets_builder/test_data/package_with_metadata/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/package_with_metadata/pubspec.yaml @@ -8,9 +8,9 @@ environment: sdk: '>=3.3.0 <4.0.0' dependencies: - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../native_assets_cli/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../native_assets_cli/ yaml: ^3.1.1 yaml_edit: ^2.1.0 diff --git a/pkgs/native_assets_builder/test_data/simple_data_asset/pubspec.yaml b/pkgs/native_assets_builder/test_data/simple_data_asset/pubspec.yaml index 3f6f47cb5..fb939b97e 100644 --- a/pkgs/native_assets_builder/test_data/simple_data_asset/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/simple_data_asset/pubspec.yaml @@ -9,9 +9,9 @@ environment: dependencies: logging: ^1.1.1 - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../native_assets_cli/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../native_assets_cli/ dev_dependencies: lints: ^3.0.0 diff --git a/pkgs/native_assets_builder/test_data/simple_link/pubspec.yaml b/pkgs/native_assets_builder/test_data/simple_link/pubspec.yaml index 2a0ed79e2..ee548f137 100644 --- a/pkgs/native_assets_builder/test_data/simple_link/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/simple_link/pubspec.yaml @@ -10,9 +10,9 @@ environment: dependencies: cli_config: ^0.2.0 logging: ^1.1.1 - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../native_assets_cli/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../native_assets_cli/ dev_dependencies: lints: ^3.0.0 diff --git a/pkgs/native_assets_builder/test_data/treeshaking_native_libs/pubspec.yaml b/pkgs/native_assets_builder/test_data/treeshaking_native_libs/pubspec.yaml index 61e2e5625..183b87a0f 100644 --- a/pkgs/native_assets_builder/test_data/treeshaking_native_libs/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/treeshaking_native_libs/pubspec.yaml @@ -9,12 +9,12 @@ environment: dependencies: logging: ^1.1.1 - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../native_assets_cli/ - native_toolchain_c: ^0.5.3 - # native_toolchain_c: - # path: ../../../native_toolchain_c/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../native_assets_cli/ + # native_toolchain_c: ^0.5.3 + native_toolchain_c: + path: ../../../native_toolchain_c/ dev_dependencies: ffigen: ^8.0.2 diff --git a/pkgs/native_assets_builder/test_data/wrong_build_output/pubspec.yaml b/pkgs/native_assets_builder/test_data/wrong_build_output/pubspec.yaml index c3ef93730..804fc82b7 100644 --- a/pkgs/native_assets_builder/test_data/wrong_build_output/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/wrong_build_output/pubspec.yaml @@ -8,9 +8,9 @@ environment: sdk: '>=3.3.0 <4.0.0' dependencies: - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../native_assets_cli/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../native_assets_cli/ yaml: ^3.1.1 yaml_edit: ^2.1.0 diff --git a/pkgs/native_assets_builder/test_data/wrong_build_output_2/pubspec.yaml b/pkgs/native_assets_builder/test_data/wrong_build_output_2/pubspec.yaml index 66e93710e..f3ec03d23 100644 --- a/pkgs/native_assets_builder/test_data/wrong_build_output_2/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/wrong_build_output_2/pubspec.yaml @@ -8,9 +8,9 @@ environment: sdk: '>=3.3.0 <4.0.0' dependencies: - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../native_assets_cli/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../native_assets_cli/ yaml: ^3.1.1 yaml_edit: ^2.1.0 diff --git a/pkgs/native_assets_builder/test_data/wrong_build_output_3/pubspec.yaml b/pkgs/native_assets_builder/test_data/wrong_build_output_3/pubspec.yaml index 26b439610..155307ff7 100644 --- a/pkgs/native_assets_builder/test_data/wrong_build_output_3/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/wrong_build_output_3/pubspec.yaml @@ -8,9 +8,9 @@ environment: sdk: '>=3.3.0 <4.0.0' dependencies: - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../native_assets_cli/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../native_assets_cli/ yaml: ^3.1.1 yaml_edit: ^2.1.0 diff --git a/pkgs/native_assets_builder/test_data/wrong_namespace_asset/pubspec.yaml b/pkgs/native_assets_builder/test_data/wrong_namespace_asset/pubspec.yaml index f051a75f3..b1556457b 100644 --- a/pkgs/native_assets_builder/test_data/wrong_namespace_asset/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/wrong_namespace_asset/pubspec.yaml @@ -8,9 +8,9 @@ environment: sdk: '>=3.3.0 <4.0.0' dependencies: - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../native_assets_cli/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../native_assets_cli/ yaml: ^3.1.1 yaml_edit: ^2.1.0 diff --git a/pkgs/native_assets_cli/CHANGELOG.md b/pkgs/native_assets_cli/CHANGELOG.md index 6826c0cf5..263d66ca4 100644 --- a/pkgs/native_assets_cli/CHANGELOG.md +++ b/pkgs/native_assets_cli/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.7.4-wip + +- Nothing yet. + ## 0.7.3 - Fix some more cases of: `BuildConfig.dependencies` and diff --git a/pkgs/native_assets_cli/example/build/local_asset/pubspec.yaml b/pkgs/native_assets_cli/example/build/local_asset/pubspec.yaml index e5eecfc48..12892faf0 100644 --- a/pkgs/native_assets_cli/example/build/local_asset/pubspec.yaml +++ b/pkgs/native_assets_cli/example/build/local_asset/pubspec.yaml @@ -10,9 +10,9 @@ environment: dependencies: logging: ^1.1.1 - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../../native_assets_cli/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../../native_assets_cli/ dev_dependencies: ffigen: ^8.0.2 diff --git a/pkgs/native_assets_cli/example/build/native_add_library/pubspec.yaml b/pkgs/native_assets_cli/example/build/native_add_library/pubspec.yaml index 7834a5b73..b998d0a86 100644 --- a/pkgs/native_assets_cli/example/build/native_add_library/pubspec.yaml +++ b/pkgs/native_assets_cli/example/build/native_add_library/pubspec.yaml @@ -10,12 +10,12 @@ environment: dependencies: logging: ^1.1.1 - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../../native_assets_cli/ - native_toolchain_c: ^0.5.3 - # native_toolchain_c: - # path: ../../../../native_toolchain_c/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../../native_assets_cli/ + # native_toolchain_c: ^0.5.3 + native_toolchain_c: + path: ../../../../native_toolchain_c/ dev_dependencies: ffigen: ^8.0.2 diff --git a/pkgs/native_assets_cli/example/build/native_dynamic_linking/pubspec.yaml b/pkgs/native_assets_cli/example/build/native_dynamic_linking/pubspec.yaml index aece33400..2e599c209 100644 --- a/pkgs/native_assets_cli/example/build/native_dynamic_linking/pubspec.yaml +++ b/pkgs/native_assets_cli/example/build/native_dynamic_linking/pubspec.yaml @@ -10,9 +10,9 @@ environment: dependencies: logging: ^1.1.1 - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../../native_assets_cli/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../../native_assets_cli/ # native_toolchain_c: ^0.5.2 native_toolchain_c: path: ../../../../native_toolchain_c/ diff --git a/pkgs/native_assets_cli/example/build/use_dart_api/pubspec.yaml b/pkgs/native_assets_cli/example/build/use_dart_api/pubspec.yaml index 5ac5f24d3..f3b0d5cd3 100644 --- a/pkgs/native_assets_cli/example/build/use_dart_api/pubspec.yaml +++ b/pkgs/native_assets_cli/example/build/use_dart_api/pubspec.yaml @@ -9,9 +9,9 @@ environment: dependencies: logging: ^1.1.1 - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../../native_assets_cli/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../../native_assets_cli/ # native_toolchain_c: ^0.5.2 native_toolchain_c: path: ../../../../native_toolchain_c/ diff --git a/pkgs/native_assets_cli/example/link/package_with_assets/pubspec.yaml b/pkgs/native_assets_cli/example/link/package_with_assets/pubspec.yaml index b23bf5ea6..e41d75ac0 100644 --- a/pkgs/native_assets_cli/example/link/package_with_assets/pubspec.yaml +++ b/pkgs/native_assets_cli/example/link/package_with_assets/pubspec.yaml @@ -11,9 +11,9 @@ environment: dependencies: logging: ^1.1.1 meta: ^1.12.0 - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../../../../native_assets_cli/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../../../../native_assets_cli/ dev_dependencies: lints: ^3.0.0 diff --git a/pkgs/native_assets_cli/pubspec.yaml b/pkgs/native_assets_cli/pubspec.yaml index 79c8e138e..08de91f63 100644 --- a/pkgs/native_assets_cli/pubspec.yaml +++ b/pkgs/native_assets_cli/pubspec.yaml @@ -4,7 +4,7 @@ description: >- native assets CLI. # Note: Bump BuildConfig.version and BuildOutput.version on breaking changes! -version: 0.7.3 +version: 0.7.4-wip repository: https://github.com/dart-lang/native/tree/main/pkgs/native_assets_cli topics: @@ -29,4 +29,5 @@ dependencies: dev_dependencies: dart_flutter_team_lints: ^2.1.1 file_testing: ^3.0.0 + glob: any yaml_edit: ^2.1.0 diff --git a/pkgs/native_assets_cli/tool/dependencies.dart b/pkgs/native_assets_cli/tool/dependencies.dart new file mode 100644 index 000000000..6547915b2 --- /dev/null +++ b/pkgs/native_assets_cli/tool/dependencies.dart @@ -0,0 +1,67 @@ +import 'dart:io'; + +import 'package:glob/glob.dart'; +import 'package:glob/list_local_fs.dart'; + +/// Ordered by dependencies. +const packages = [ + 'native_assets_cli', + 'native_toolchain_c', + 'native_assets_builder', +]; + +const pathDependencies = 'path-dependencies'; + +// Print all command-line arguments that are Dart files. +void main(List arguments) async { + if (arguments.length == 1 && arguments.single == pathDependencies) { + await switchAllToPathDependencies(); + } else { + print('The only command available is "$pathDependencies".'); + } +} + +/// Switches the pubspecs to path dependencies. +/// +/// Does not add `publish_to: none` back in. +/// +/// Does not bump the version number and add `-wip`. +Future switchAllToPathDependencies() async { + await Future.wait(allPubspecs.map(switchToPathDependencies2)); +} + +Future switchToPathDependencies2(File pubspecFile) async { + final newPubspec = switchToPathDependencies(await pubspecFile.readAsString()); + await pubspecFile.writeAsString(newPubspec); +} + +String switchToPathDependencies(String pubspec) { + for (final packageName in packages) { + pubspec = switchToPathDependency(pubspec, packageName); + } + return pubspec; +} + +String switchToPathDependency(String pubspec, String packageName) { + final regex = RegExp(''' $packageName: \\^([0-9.]+) + # $packageName: + # path: ([./]*)$packageName/'''); + final match = regex.firstMatch(pubspec); + if (match == null) { + return pubspec; + } + + final replacement = ''' # $packageName: ^${match.group(1)} + $packageName: + path: ${match.group(2)}$packageName/'''; + return pubspec.replaceFirst(match.group(0)!, replacement); +} + +final pkgsUri = Platform.script.resolve('../../'); + +List allPubspecs = [ + for (final package in packages) + ...Glob('${pkgsUri.resolve('$package/').toFilePath()}**pubspec.yaml') + .listSync() + .whereType() +]; diff --git a/pkgs/native_toolchain_c/CHANGELOG.md b/pkgs/native_toolchain_c/CHANGELOG.md index 0e3201cdd..440213f96 100644 --- a/pkgs/native_toolchain_c/CHANGELOG.md +++ b/pkgs/native_toolchain_c/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.5.4-wip + +- Nothing yet. + ## 0.5.3 - Fix internal bug in `LinkerOptions`. diff --git a/pkgs/native_toolchain_c/pubspec.yaml b/pkgs/native_toolchain_c/pubspec.yaml index 9daf0a92b..3e7ef09b0 100644 --- a/pkgs/native_toolchain_c/pubspec.yaml +++ b/pkgs/native_toolchain_c/pubspec.yaml @@ -1,9 +1,11 @@ name: native_toolchain_c description: >- A library to invoke the native C compiler installed on the host machine. -version: 0.5.3 +version: 0.5.4-wip repository: https://github.com/dart-lang/native/tree/main/pkgs/native_toolchain_c +publish_to: none + topics: - compiler - ffi @@ -18,9 +20,9 @@ dependencies: glob: ^2.1.1 logging: ^1.1.1 meta: ^1.9.1 - native_assets_cli: ^0.7.3 - # native_assets_cli: - # path: ../native_assets_cli/ + # native_assets_cli: ^0.7.3 + native_assets_cli: + path: ../native_assets_cli/ pub_semver: ^2.1.3 dev_dependencies: From 9f605d1b2f3d7a6703b6a4eb8dabaabd3bdb6180 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Tue, 3 Sep 2024 13:45:10 +0200 Subject: [PATCH 2/3] copyright header --- pkgs/native_assets_cli/tool/dependencies.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/native_assets_cli/tool/dependencies.dart b/pkgs/native_assets_cli/tool/dependencies.dart index 6547915b2..b75f37c9b 100644 --- a/pkgs/native_assets_cli/tool/dependencies.dart +++ b/pkgs/native_assets_cli/tool/dependencies.dart @@ -1,3 +1,7 @@ +// Copyright (c) 2024, 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. + import 'dart:io'; import 'package:glob/glob.dart'; From cf166fec7645d1f043e8c0a8b91b7d6754c7d002 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Tue, 3 Sep 2024 14:02:20 +0200 Subject: [PATCH 3/3] print limitations --- pkgs/native_assets_cli/tool/dependencies.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/native_assets_cli/tool/dependencies.dart b/pkgs/native_assets_cli/tool/dependencies.dart index b75f37c9b..8276cbddb 100644 --- a/pkgs/native_assets_cli/tool/dependencies.dart +++ b/pkgs/native_assets_cli/tool/dependencies.dart @@ -32,6 +32,8 @@ void main(List arguments) async { /// Does not bump the version number and add `-wip`. Future switchAllToPathDependencies() async { await Future.wait(allPubspecs.map(switchToPathDependencies2)); + print('Did not add `publish_to: none` back in.'); + print('Did not bump the version number and add `-wip`.'); } Future switchToPathDependencies2(File pubspecFile) async {