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
This commit is contained in:
11
java/app.go
11
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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user