aboutsummaryrefslogtreecommitdiffstats
path: root/genrule
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2017-02-06 21:17:11 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-02-06 21:17:12 +0000
commit77de5a4b9d0cf657155f5274d3cf0f62dfffe7f7 (patch)
tree07c7e46d92a21f3644e98c0c9b3c2c4ddca2a2e8 /genrule
parent721197de2ca9a1a30b61ef4d531484c3d0b2dcd1 (diff)
parentfaeb7aa1351df6f1d7eae990d0e3d4c68f5c4abf (diff)
downloadbuild_soong-77de5a4b9d0cf657155f5274d3cf0f62dfffe7f7.tar.gz
build_soong-77de5a4b9d0cf657155f5274d3cf0f62dfffe7f7.tar.bz2
build_soong-77de5a4b9d0cf657155f5274d3cf0f62dfffe7f7.zip
Merge "Support data properties for test binaries"
Diffstat (limited to 'genrule')
-rw-r--r--genrule/filegroup.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/genrule/filegroup.go b/genrule/filegroup.go
index 9b53c9f7..c1d08a82 100644
--- a/genrule/filegroup.go
+++ b/genrule/filegroup.go
@@ -29,6 +29,12 @@ type fileGroupProperties struct {
Srcs []string
Exclude_srcs []string
+
+ // 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
+ // installation directory.
+ Path string
}
type fileGroup struct {
@@ -53,7 +59,7 @@ func (fg *fileGroup) DepsMutator(ctx android.BottomUpMutatorContext) {
}
func (fg *fileGroup) GenerateAndroidBuildActions(ctx android.ModuleContext) {
- fg.srcs = ctx.ExpandSources(fg.properties.Srcs, fg.properties.Exclude_srcs)
+ fg.srcs = ctx.ExpandSourcesSubDir(fg.properties.Srcs, fg.properties.Exclude_srcs, fg.properties.Path)
}
func (fg *fileGroup) Srcs() android.Paths {