未验证 提交 4cda916d 编写于 作者: G George Wright 提交者: GitHub

Expose the dart kernel snapshot target and copied assets as a public dependency (#16266)

This allows for targets to depend on the assets generated by the test_fixtures target.
上级 7e1d1440
......@@ -162,7 +162,8 @@ template("dart_snapshot") {
dart_kernel = dart_snapshot_kernel_path
}
snapshot_deps = [ ":$dart_snapshot_kernel_target_name" ]
snapshot_deps = []
snapshot_public_deps = [ ":$dart_snapshot_kernel_target_name" ]
if (is_aot_test) {
dart_snapshot_aot_target_name = "dart_snapshot_aot_$target_name"
......@@ -177,8 +178,8 @@ template("dart_snapshot") {
group(target_name) {
testonly = true
deps = snapshot_deps
public_deps = snapshot_public_deps
}
}
......@@ -218,6 +219,12 @@ template("copy_fixtures") {
# unused invoker scope error. In such cases specify the fixtures using an empty
# array.
#
# The targets which generate the outputs from these test fixtures (e.g. the
# Dart kernel snapshot) are exposed as public dependencies of the test fixture
# target. This is so that users can depend on the test fixture target directly
# and be able to access the generated outputs without needing to know about the
# internal dependency structure generated by this template.
#
# Arguments:
#
# fixtures (optional): The list of test fixtures. An empty list may be
......@@ -237,6 +244,7 @@ template("test_fixtures") {
}
}
test_deps = [ ":$fixtures_location_target_name" ]
test_public_deps = []
# If the fixtures are specified, copy them to the assets directory.
if (defined(invoker.fixtures)) {
......@@ -244,7 +252,7 @@ template("test_fixtures") {
copy_fixtures(copy_fixtures_target_name) {
fixtures = invoker.fixtures
}
test_deps += [ ":$copy_fixtures_target_name" ]
test_public_deps += [ ":$copy_fixtures_target_name" ]
}
# If a Dart file is specified, snapshot it and place it in the generated
......@@ -254,11 +262,12 @@ template("test_fixtures") {
dart_snapshot(dart_snapshot_target_name) {
dart_main = invoker.dart_main
}
test_deps += [ ":$dart_snapshot_target_name" ]
test_public_deps += [ ":$dart_snapshot_target_name" ]
}
group(target_name) {
testonly = true
deps = test_deps
public_deps = test_public_deps
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册