Support data properties in java_test and android_test am: d96ca35779 am: 14763b2640

am: a128a7a076

Change-Id: Ie2a22bfd1fe6132159c8e96688d0d8d296809bbc
This commit is contained in:
Colin Cross
2018-08-15 07:51:41 -07:00
committed by android-build-merger
3 changed files with 25 additions and 0 deletions

View File

@@ -1351,6 +1351,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 {
@@ -1359,10 +1363,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)
}
@@ -1373,6 +1379,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 {