Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b4cc0206 authored by Mathew Inwood's avatar Mathew Inwood Committed by Gerrit Code Review
Browse files

Merge "Merge multiple compat_config.xml's."

parents aa21599d 2471c086
Loading
Loading
Loading
Loading
+2 −21
Original line number Diff line number Diff line
@@ -41,30 +41,11 @@ func (p *platformCompatConfig) GenerateAndroidBuildActions(ctx android.ModuleCon
	p.configFile = android.PathForModuleOut(ctx, configFileName).OutputPath
	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().
		Text(`unzip`).
		Flag(`-l`).
		Input(path).
		Text(`| grep`).
		Flag(`-q`).
		Text(configPath).
		Text(`; if [ "$?" = "0" ] ; then`).
		Text(`unzip`).
		Flag(`-qp`).
		BuiltTool(ctx, "process-compat-config").
		Input(path).
		Text(configPath).
		Text(`>`).
		Output(p.configFile).
		Text(`; else echo `).
		Text(emptyConfig).
		Text(`>`).
		Output(p.configFile).
		Text(`; fi`)
		Output(p.configFile)

	p.installDirPath = android.PathForModuleInstall(ctx, "etc", "compatconfig")
	rule.Build(pctx, ctx, configFileName, "Extract compat/compat_config.xml and install it")