diff options
author | Colin Cross <ccross@android.com> | 2018-08-10 16:06:24 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2018-08-14 15:44:39 -0700 |
commit | d96ca35779fd72803014f3789a966de70583778e (patch) | |
tree | 5670d113481a8042fda208dac553371ab40d2280 /java/java.go | |
parent | 303e21f695a7f162727aad8e6229a44dfaed9dfe (diff) |
Support data properties in java_test and android_test
Files in the data property will be passed to
LOCAL_COMPATIBILITY_SUPPORT_FILES in Make.
Test: m checkbuild
Change-Id: Ifc074317f957aba8f55daa30abc5b9737d1eceac
Diffstat (limited to 'java/java.go')
-rw-r--r-- | java/java.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/java/java.go b/java/java.go index 8fe4f3565..a015a9953 100644 --- a/java/java.go +++ b/java/java.go @@ -1357,6 +1357,10 @@ type testProperties struct { // the name of the test configuration (for example "AndroidTest.xml") that should be // installed with the module. Test_config *string `android:"arch_variant"` + + // list of files or filegroup modules that provide data that should be installed alongside + // the test + Data []string } type Test struct { @@ -1365,10 +1369,12 @@ type Test struct { testProperties testProperties testConfig android.Path + data android.Paths } func (j *Test) GenerateAndroidBuildActions(ctx android.ModuleContext) { j.testConfig = tradefed.AutoGenJavaTestConfig(ctx, j.testProperties.Test_config) + j.data = ctx.ExpandSources(j.testProperties.Data, nil) j.Library.GenerateAndroidBuildActions(ctx) } @@ -1379,6 +1385,7 @@ func (j *Test) DepsMutator(ctx android.BottomUpMutatorContext) { ctx.AddDependency(ctx.Module(), staticLibTag, "junit") } android.ExtractSourceDeps(ctx, j.testProperties.Test_config) + android.ExtractSourcesDeps(ctx, j.testProperties.Data) } func TestFactory() android.Module { |