Merge "Pass declarations as separate arguments" into main

This commit is contained in:
Treehugger Robot 2023-07-19 23:01:38 +00:00 committed by Gerrit Code Review
commit 55d25a435f
3 changed files with 7 additions and 4 deletions

View file

@ -125,12 +125,12 @@ func (module *DeclarationsModule) GenerateAndroidBuildActions(ctx android.Module
intermediatePath := android.PathForModuleOut(ctx, "intermediate.pb")
ctx.Build(pctx, android.BuildParams{
Rule: aconfigRule,
Inputs: inputFiles,
Output: intermediatePath,
Description: "aconfig_declarations",
Args: map[string]string{
"release_version": ctx.Config().ReleaseVersion(),
"package": module.properties.Package,
"declarations": android.JoinPathsWithPrefix(inputFiles, "--declarations "),
"values": joinAndPrefix(" --values ", module.properties.Values),
},
})

View file

@ -26,7 +26,10 @@ func TestAconfigDeclarations(t *testing.T) {
aconfig_declarations {
name: "module_name",
package: "com.example.package",
srcs: ["foo.aconfig"],
srcs: [
"foo.aconfig",
"bar.aconfig",
],
}
`
result := runTest(t, android.FixtureExpectsNoErrors, bp)

View file

@ -27,7 +27,7 @@ var (
blueprint.RuleParams{
Command: `${aconfig} create-cache` +
` --package ${package}` +
` --declarations ${in}` +
` ${declarations}` +
` ${values}` +
` --cache ${out}.tmp` +
` && ( if cmp -s ${out}.tmp ; then rm ${out}.tmp ; else mv ${out}.tmp ${out} ; fi )`,
@ -36,7 +36,7 @@ var (
"${aconfig}",
},
Restat: true,
}, "release_version", "package", "values")
}, "release_version", "package", "declarations", "values")
// For java_aconfig_library: Generate java file
srcJarRule = pctx.AndroidStaticRule("aconfig_srcjar",