Fix few issues with filegroups
Bug: http://b/64121881 Bug: http://b/78188880 - Allow filegroup's properties to be extended by a LoadHook - Support a filegroup (':module') in a prebuilt's 'Srcs' property to export files from a different path as the prebuilt's sources. This change also includes a refactoring that moves genrule/filegroup.go to android/filegroup.go so that FileGroupFactory is visible in prebuilt_test.go. Test: Test https://android-review.googlesource.com/c/platform/development/+/469159 in clang-tools branch on Linux, Darwin. Test regular build in aosp/master. Change-Id: I3ff6215ab2e62955f039fd1086c31f1bd50ebcf6
This commit is contained in:
@@ -109,6 +109,19 @@ var prebuiltsTests = []struct {
|
||||
}`,
|
||||
prebuilt: false,
|
||||
},
|
||||
{
|
||||
name: "prebuilt file from filegroup preferred",
|
||||
modules: `
|
||||
filegroup {
|
||||
name: "fg",
|
||||
}
|
||||
prebuilt {
|
||||
name: "bar",
|
||||
prefer: true,
|
||||
srcs: [":fg"],
|
||||
}`,
|
||||
prebuilt: true,
|
||||
},
|
||||
}
|
||||
|
||||
func TestPrebuilts(t *testing.T) {
|
||||
@@ -125,6 +138,7 @@ func TestPrebuilts(t *testing.T) {
|
||||
ctx := NewTestContext()
|
||||
ctx.PreArchMutators(RegisterPrebuiltsPreArchMutators)
|
||||
ctx.PostDepsMutators(RegisterPrebuiltsPostDepsMutators)
|
||||
ctx.RegisterModuleType("filegroup", ModuleFactoryAdaptor(FileGroupFactory))
|
||||
ctx.RegisterModuleType("prebuilt", ModuleFactoryAdaptor(newPrebuiltModule))
|
||||
ctx.RegisterModuleType("source", ModuleFactoryAdaptor(newSourceModule))
|
||||
ctx.Register()
|
||||
|
Reference in New Issue
Block a user