Merge "java_test macro needs srcs and deps to create .jar for tradefed_test_suite" into main am: 8348ce92f5 am: 1c29688852 am: f362600dc8 am: c824c50247 am: f2fefb5ab1

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2660942

Change-Id: I2624de43756bdc4340dd2f586dcaf7a293a98f31
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Zi Wang
2023-07-22 00:29:07 +00:00
committed by Automerger Merge Worker
3 changed files with 13 additions and 3 deletions

View File

@@ -3165,6 +3165,7 @@ func javaBinaryHostBp2Build(ctx android.TopDownMutatorContext, m *Binary) {
type javaTestHostAttributes struct {
*javaCommonAttributes
Srcs bazel.LabelListAttribute
Deps bazel.LabelListAttribute
Runtime_deps bazel.LabelListAttribute
}
@@ -3201,8 +3202,10 @@ func javaTestHostBp2Build(ctx android.TopDownMutatorContext, m *TestHost) {
hasKotlin: bp2BuildInfo.hasKotlin,
}
libName := createLibraryTarget(ctx, libInfo)
attrs.Runtime_deps.Add(&bazel.LabelAttribute{Value: &bazel.Label{Label: ":" + libName}})
attrs.Srcs = commonAttrs.Srcs
attrs.Deps = deps
attrs.Runtime_deps.Add(&bazel.LabelAttribute{Value: &bazel.Label{Label: ":" + libName}})
// Create the BazelTargetModule.
ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: m.Name()}, attrs)
}