summaryrefslogtreecommitdiff
path: root/android/filegroup.go
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2024-10-21 15:41:42 -0700
committer Cole Faust <colefaust@google.com> 2024-10-21 15:41:42 -0700
commit65cb40a975fb53187cfc5d9edea905b1f7630ab2 (patch)
tree4fdd79e9271e230761e86e6b9e754e5755c078bd /android/filegroup.go
parentbae26fe87f9d05a40accf870fee40d000ad4ed64 (diff)
Add new properties to aid in removing the 1-variant fallback
These new properties are essentially methods to specify "outgoing transitions" in blueprint files. There are lots of host tests that want to include apps built for device in their data, so they need a property that adds dependencies based on the device variants instead of copying the same host variants. After this cl is submitted, I'll do an LSC to update all the usages that are relying on the 1-variant fallback to use these properties instead. Bug: 372091092 Test: m nothing --no-skip-soong-tests Change-Id: I45b8fb024da120ad61606e3a21de86e4392be2a4
Diffstat (limited to 'android/filegroup.go')
-rw-r--r--android/filegroup.go18
1 files changed, 15 insertions, 3 deletions
diff --git a/android/filegroup.go b/android/filegroup.go
index ff0f74e99..0e08c4fa9 100644
--- a/android/filegroup.go
+++ b/android/filegroup.go
@@ -41,6 +41,14 @@ type fileGroupProperties struct {
Exclude_srcs proptools.Configurable[[]string] `android:"path"`
+ // Sources the will be included in the filegroup, but any module dependencies will be added
+ // using the device os and the device's first architecture's variant.
+ Device_first_srcs proptools.Configurable[[]string] `android:"path_device_first"`
+
+ // Sources the will be included in the filegroup, but any module dependencies will be added
+ // using the device os and the common architecture's variant.
+ Device_common_srcs proptools.Configurable[[]string] `android:"path_device_common"`
+
// The base path to the files. May be used by other modules to determine which portion
// of the path to use. For example, when a filegroup is used as data in a cc_test rule,
// the base path is stripped off the path and the remaining path is used as the
@@ -90,11 +98,13 @@ func (fg *fileGroup) JSONActions() []blueprint.JSONAction {
}
func (fg *fileGroup) GenerateAndroidBuildActions(ctx ModuleContext) {
- fg.srcs = PathsForModuleSrcExcludes(ctx, fg.properties.Srcs.GetOrDefault(ctx, nil), fg.properties.Exclude_srcs.GetOrDefault(ctx, nil))
+ srcs := PathsForModuleSrcExcludes(ctx, fg.properties.Srcs.GetOrDefault(ctx, nil), fg.properties.Exclude_srcs.GetOrDefault(ctx, nil))
+ srcs = append(srcs, PathsForModuleSrc(ctx, fg.properties.Device_first_srcs.GetOrDefault(ctx, nil))...)
+ srcs = append(srcs, PathsForModuleSrc(ctx, fg.properties.Device_common_srcs.GetOrDefault(ctx, nil))...)
if fg.properties.Path != nil {
- fg.srcs = PathsWithModuleSrcSubDir(ctx, fg.srcs, String(fg.properties.Path))
+ srcs = PathsWithModuleSrcSubDir(ctx, srcs, String(fg.properties.Path))
}
- SetProvider(ctx, blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: fg.srcs.Strings()})
+ SetProvider(ctx, blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: srcs.Strings()})
var aconfigDeclarations []string
var intermediateCacheOutputPaths Paths
@@ -108,6 +118,8 @@ func (fg *fileGroup) GenerateAndroidBuildActions(ctx ModuleContext) {
maps.Copy(modeInfos, dep.ModeInfos)
}
})
+
+ fg.srcs = srcs
SetProvider(ctx, CodegenInfoProvider, CodegenInfo{
AconfigDeclarations: aconfigDeclarations,
IntermediateCacheOutputPaths: intermediateCacheOutputPaths,