bp2build java_resources that only contain a filegroup
supports filegroup that specifies path property Bug: 280860624 Test: built libauto_value_plugin Change-Id: I9ed0b13e055beb92ba8090f6b5e88b9873c9ce61
This commit is contained in:
@@ -826,3 +826,43 @@ func TestJavaLibraryArchVariantSrcsWithExcludes(t *testing.T) {
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func TestJavaLibraryJavaResourcesSingleFilegroup(t *testing.T) {
|
||||
runJavaLibraryTestCaseWithRegistrationCtxFunc(t, Bp2buildTestCase{
|
||||
Filesystem: map[string]string{
|
||||
"res/a.res": "",
|
||||
"res/b.res": "",
|
||||
"res/dir1/b.res": "",
|
||||
},
|
||||
Description: "java_library",
|
||||
Blueprint: `java_library {
|
||||
name: "java-lib-1",
|
||||
srcs: ["a.java"],
|
||||
java_resources: [":filegroup1"],
|
||||
bazel_module: { bp2build_available: true },
|
||||
}
|
||||
|
||||
filegroup {
|
||||
name: "filegroup1",
|
||||
path: "foo",
|
||||
srcs: ["foo/a", "foo/b"],
|
||||
}
|
||||
|
||||
`,
|
||||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
|
||||
"srcs": `["a.java"]`,
|
||||
"resources": `[":filegroup1"]`,
|
||||
"resource_strip_prefix": `"foo"`,
|
||||
}),
|
||||
MakeNeverlinkDuplicateTarget("java_library", "java-lib-1"),
|
||||
MakeBazelTargetNoRestrictions("filegroup", "filegroup1", AttrNameToString{
|
||||
"srcs": `[
|
||||
"foo/a",
|
||||
"foo/b",
|
||||
]`}),
|
||||
},
|
||||
}, func(ctx android.RegistrationContext) {
|
||||
ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user