summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
author Jaewoong Jung <jungjw@google.com> 2019-11-22 14:34:55 -0800
committer Jaewoong Jung <jungjw@google.com> 2019-12-05 11:17:09 -0800
commite5cd4e10a070b75d4dd04b4c21e12c3f6943a424 (patch)
treefebe9f2466275447bb91c4e3ca7202bd709de75b /java
parent126c57b52d93fc8c86ae438a9fb39ad704b38479 (diff)
Optionally overwrite package value in test config.
If package_name is set for an android_test module, package names in its AndroidTest.xml config need to be updated too. Test: test_config_fixer_test.py Fixes: 145011263 Change-Id: I52f17ef1d1902364b9bcfec4f6e246bd655dbf09
Diffstat (limited to 'java')
-rw-r--r--java/app.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/java/app.go b/java/app.go
index c63570366..b693ce951 100644
--- a/java/app.go
+++ b/java/app.go
@@ -632,6 +632,17 @@ func (a *AndroidTest) GenerateAndroidBuildActions(ctx android.ModuleContext) {
a.testConfig = tradefed.AutoGenInstrumentationTestConfig(ctx, a.testProperties.Test_config,
a.testProperties.Test_config_template, a.manifestPath, a.testProperties.Test_suites, a.testProperties.Auto_gen_config)
+ if a.overridableAppProperties.Package_name != nil {
+ fixedConfig := android.PathForModuleOut(ctx, "test_config_fixer", "AndroidTest.xml")
+ rule := android.NewRuleBuilder()
+ rule.Command().BuiltTool(ctx, "test_config_fixer").
+ FlagWithArg("--manifest ", a.manifestPath.String()).
+ FlagWithArg("--package-name ", *a.overridableAppProperties.Package_name).
+ Input(a.testConfig).
+ Output(fixedConfig)
+ rule.Build(pctx, ctx, "fix_test_config", "fix test config")
+ a.testConfig = fixedConfig
+ }
a.data = android.PathsForModuleSrc(ctx, a.testProperties.Data)
}