bp2build java_resources that only contain a filegroup
supports filegroup that specifies path property
Bug: 280860624
Test: built libauto_value_plugin
Change-Id: I9ed0b13e055beb92ba8090f6b5e88b9873c9ce61
diff --git a/android/allowlists/allowlists.go b/android/allowlists/allowlists.go
index 751a4cb..6405e9f 100644
--- a/android/allowlists/allowlists.go
+++ b/android/allowlists/allowlists.go
@@ -761,6 +761,11 @@
// aidl
"aidl",
"libaidl-common",
+
+ // java_resources containing only a single filegroup
+ "libauto_value_plugin",
+ "auto_value_plugin_resources",
+ "auto_value_extension",
}
Bp2buildModuleTypeAlwaysConvertList = []string{
@@ -835,7 +840,6 @@
"libprotobuf-internal-python-srcs", // TODO(b/210751803), we don't handle path property for filegroups
"libprotobuf-java-full", // TODO(b/210751803), we don't handle path property for filegroups
"libprotobuf-java-util-full", // TODO(b/210751803), we don't handle path property for filegroups
- "auto_value_plugin_resources", // TODO(b/210751803), we don't handle path property for filegroups
// go deps:
"analyze_bcpf", // depends on bpmodify a blueprint_go_binary.
diff --git a/android/filegroup.go b/android/filegroup.go
index f30ee51..c042ff1 100644
--- a/android/filegroup.go
+++ b/android/filegroup.go
@@ -177,6 +177,17 @@
}
}
+type FileGroupPath interface {
+ GetPath(ctx TopDownMutatorContext) string
+}
+
+func (fg *fileGroup) GetPath(ctx TopDownMutatorContext) string {
+ if fg.properties.Path != nil {
+ return *fg.properties.Path
+ }
+ return ""
+}
+
type fileGroupProperties struct {
// srcs lists files that will be included in this filegroup
Srcs []string `android:"path"`
@@ -207,6 +218,7 @@
BazelModuleBase
DefaultableModuleBase
FileGroupAsLibrary
+ FileGroupPath
properties fileGroupProperties
srcs Paths
}
@@ -214,6 +226,7 @@
var _ MixedBuildBuildable = (*fileGroup)(nil)
var _ SourceFileProducer = (*fileGroup)(nil)
var _ FileGroupAsLibrary = (*fileGroup)(nil)
+var _ FileGroupPath = (*fileGroup)(nil)
// filegroup contains a list of files that are referenced by other modules
// properties (such as "srcs") using the syntax ":<name>". filegroup are