Merge "Merge multiple compat_config.xml's."
am: b4cc0206bb
Change-Id: Ib4da2a767b58ba9e9ac5519a04a21d8e8b94e6e3
This commit is contained in:
@@ -41,30 +41,11 @@ func (p *platformCompatConfig) GenerateAndroidBuildActions(ctx android.ModuleCon
|
|||||||
p.configFile = android.PathForModuleOut(ctx, configFileName).OutputPath
|
p.configFile = android.PathForModuleOut(ctx, configFileName).OutputPath
|
||||||
path := android.PathForModuleSrc(ctx, String(p.properties.Src))
|
path := android.PathForModuleSrc(ctx, String(p.properties.Src))
|
||||||
|
|
||||||
// Use the empty config if the compat config file idoesn't exist (can happen if @ChangeId
|
|
||||||
// annotation is not used).
|
|
||||||
emptyConfig := `'<?xml version="1.0" encoding="UTF-8" standalone="no"?><config/>'`
|
|
||||||
configPath := `compat/compat_config.xml`
|
|
||||||
|
|
||||||
rule.Command().
|
rule.Command().
|
||||||
Text(`unzip`).
|
BuiltTool(ctx, "process-compat-config").
|
||||||
Flag(`-l`).
|
|
||||||
Input(path).
|
Input(path).
|
||||||
Text(`| grep`).
|
|
||||||
Flag(`-q`).
|
|
||||||
Text(configPath).
|
|
||||||
Text(`; if [ "$?" = "0" ] ; then`).
|
|
||||||
Text(`unzip`).
|
|
||||||
Flag(`-qp`).
|
|
||||||
Input(path).
|
|
||||||
Text(configPath).
|
|
||||||
Text(`>`).
|
Text(`>`).
|
||||||
Output(p.configFile).
|
Output(p.configFile)
|
||||||
Text(`; else echo `).
|
|
||||||
Text(emptyConfig).
|
|
||||||
Text(`>`).
|
|
||||||
Output(p.configFile).
|
|
||||||
Text(`; fi`)
|
|
||||||
|
|
||||||
p.installDirPath = android.PathForModuleInstall(ctx, "etc", "compatconfig")
|
p.installDirPath = android.PathForModuleInstall(ctx, "etc", "compatconfig")
|
||||||
rule.Build(pctx, ctx, configFileName, "Extract compat/compat_config.xml and install it")
|
rule.Build(pctx, ctx, configFileName, "Extract compat/compat_config.xml and install it")
|
||||||
|
Reference in New Issue
Block a user