diff options
| -rw-r--r-- | etc/prebuilt_etc.go | 12 | ||||
| -rw-r--r-- | java/app_import.go | 18 |
2 files changed, 30 insertions, 0 deletions
diff --git a/etc/prebuilt_etc.go b/etc/prebuilt_etc.go index 2bcbde12d..bf54c0941 100644 --- a/etc/prebuilt_etc.go +++ b/etc/prebuilt_etc.go @@ -499,9 +499,21 @@ func (p *PrebuiltEtc) GenerateAndroidBuildActions(ctx android.ModuleContext) { ip.addInstallRules(ctx) } + p.updateModuleInfoJSON(ctx) + ctx.SetOutputFiles(p.outputFilePaths.Paths(), "") } +func (p *PrebuiltEtc) updateModuleInfoJSON(ctx android.ModuleContext) { + moduleInfoJSON := ctx.ModuleInfoJSON() + moduleInfoJSON.Class = []string{"ETC"} + if p.makeClass != "" { + moduleInfoJSON.Class = []string{p.makeClass} + } + moduleInfoJSON.SystemSharedLibs = []string{"none"} + moduleInfoJSON.Tags = []string{"optional"} +} + type installProperties struct { filename string sourceFilePath android.Path diff --git a/java/app_import.go b/java/app_import.go index 352e995e2..dc1aa740f 100644 --- a/java/app_import.go +++ b/java/app_import.go @@ -772,9 +772,27 @@ type AndroidTestImport struct { func (a *AndroidTestImport) GenerateAndroidBuildActions(ctx android.ModuleContext) { a.generateAndroidBuildActions(ctx) + a.updateModuleInfoJSON(ctx) + a.data = android.PathsForModuleSrc(ctx, a.testProperties.Data) } +func (a *AndroidTestImport) updateModuleInfoJSON(ctx android.ModuleContext) { + moduleInfoJSON := ctx.ModuleInfoJSON() + moduleInfoJSON.Class = []string{"APPS"} + moduleInfoJSON.CompatibilitySuites = []string{"null-suite"} + if len(a.testProperties.Test_suites) > 0 { + moduleInfoJSON.CompatibilitySuites = a.testProperties.Test_suites + } + moduleInfoJSON.SystemSharedLibs = []string{"none"} + moduleInfoJSON.Tags = []string{"tests"} + moduleInfoJSON.RegisterNameOverride = a.BaseModuleName() + testConfig := android.ExistentPathForSource(ctx, ctx.ModuleDir(), "AndroidTest.xml") + if testConfig.Valid() { + moduleInfoJSON.TestConfig = []string{testConfig.String()} + } +} + func (a *AndroidTestImport) InstallInTestcases() bool { return true } |