diff --git a/pkgs/native_assets_builder/test_data/user_defines/pubspec.yaml b/pkgs/native_assets_builder/test_data/user_defines/pubspec.yaml index 84a335b46..2188d1b8d 100644 --- a/pkgs/native_assets_builder/test_data/user_defines/pubspec.yaml +++ b/pkgs/native_assets_builder/test_data/user_defines/pubspec.yaml @@ -16,11 +16,14 @@ dev_dependencies: lints: ^5.1.1 test: ^1.25.15 +# Note: If pub workspaces are in use, the user-defines must be in the workspace +# pub file. These defines are only in effect if `resolution: workspace` above is +# removed. (The tests copy this project and remove `resolution: workspace`.) hooks: user_defines: - user_defines: + user_defines: # package name user_define_key: user_define_value user_define_key2: foo: bar - some_other_package: + some_other_package: # package name user_define_key3: user_define_value3 diff --git a/pubspec.yaml b/pubspec.yaml index 241456017..6fd743951 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -58,3 +58,13 @@ workspace: - pkgs/native_assets_cli/example/link/app_with_asset_treeshaking - pkgs/native_assets_cli/example/link/package_with_assets - pkgs/native_toolchain_c + +# Hook user-defines are specified in the pub workspace. +hooks: + user_defines: + user_defines: # package name + user_define_key: user_define_value + user_define_key2: + foo: bar + some_other_package: # package name + user_define_key3: user_define_value3