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
diff --git a/cc/cc_test.go b/cc/cc_test.go
index 10c1aba..9b4cc0f 100644
--- a/cc/cc_test.go
+++ b/cc/cc_test.go
@@ -16,7 +16,6 @@
import (
"android/soong/android"
- "android/soong/genrule"
"fmt"
"io/ioutil"
@@ -62,7 +61,7 @@
ctx.RegisterModuleType("llndk_headers", android.ModuleFactoryAdaptor(llndkHeadersFactory))
ctx.RegisterModuleType("vendor_public_library", android.ModuleFactoryAdaptor(vendorPublicLibraryFactory))
ctx.RegisterModuleType("cc_object", android.ModuleFactoryAdaptor(objectFactory))
- ctx.RegisterModuleType("filegroup", android.ModuleFactoryAdaptor(genrule.FileGroupFactory))
+ ctx.RegisterModuleType("filegroup", android.ModuleFactoryAdaptor(android.FileGroupFactory))
ctx.PreDepsMutators(func(ctx android.RegisterMutatorsContext) {
ctx.BottomUp("image", vendorMutator).Parallel()
ctx.BottomUp("link", linkageMutator).Parallel()
diff --git a/cc/test_data_test.go b/cc/test_data_test.go
index 4a7b0f7..56c3e38 100644
--- a/cc/test_data_test.go
+++ b/cc/test_data_test.go
@@ -22,7 +22,6 @@
"testing"
"android/soong/android"
- "android/soong/genrule"
)
type dataFile struct {
@@ -129,7 +128,7 @@
"dir/bar/baz": nil,
})
ctx.RegisterModuleType("filegroup",
- android.ModuleFactoryAdaptor(genrule.FileGroupFactory))
+ android.ModuleFactoryAdaptor(android.FileGroupFactory))
ctx.RegisterModuleType("test",
android.ModuleFactoryAdaptor(newTest))
ctx.Register()