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

Commit 0dd06f6f authored by Mathew Inwood's avatar Mathew Inwood
Browse files

Update build rule for updated script.

The script now expects flags for filenames and no longer
just writes to stdout. Write full merged config too.

Test: m libcore-platform-compat-config
Change-Id: Ia524a8c271725665772c9543baecd4f494ee86f1
parent b4cc0206
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -32,20 +32,23 @@ type platformCompatConfig struct {
	properties     platformCompatConfigProperties
	installDirPath android.InstallPath
	configFile     android.OutputPath
	metadataFile   android.OutputPath
}

func (p *platformCompatConfig) GenerateAndroidBuildActions(ctx android.ModuleContext) {
	rule := android.NewRuleBuilder()

	configFileName := p.Name() + ".xml"
	metadataFileName := p.Name() + "_meta.xml"
	p.configFile = android.PathForModuleOut(ctx, configFileName).OutputPath
	p.metadataFile = android.PathForModuleOut(ctx, metadataFileName).OutputPath
	path := android.PathForModuleSrc(ctx, String(p.properties.Src))

	rule.Command().
		BuiltTool(ctx, "process-compat-config").
		Input(path).
		Text(`>`).
		Output(p.configFile)
		FlagWithInput("--jar ", path).
		FlagWithOutput("--device-config ", p.configFile).
		FlagWithOutput("--merged-config ", p.metadataFile)

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