diff options
author | 2024-02-20 12:43:21 +0100 | |
---|---|---|
committer | 2024-02-20 12:51:25 +0100 | |
commit | 2a1adcc63a18670f06ba8080a19ad0db539d4135 (patch) | |
tree | 4fcf5e87217f6682fa37ffa2f4ac96aa3367159e /aconfig/all_aconfig_declarations.go | |
parent | 4bec95e2f6fcb6b3e64eb5634a979720ff5a2a54 (diff) |
Include all_aconfig_declarations in sdk dist
Include all_aconfig_declarations in the sdk dist directory, in both
binary protobuf (for machine consumption) and text protobuf (for human
consumption) format.
Bug: 324281288
Test: m sdk dist && test -e out/dist/flags.pb && test -e out/dist/flags.textproto
Change-Id: Icfb4841c3fe6478ddc233ef6d092ca700a8acb20
Diffstat (limited to 'aconfig/all_aconfig_declarations.go')
-rw-r--r-- | aconfig/all_aconfig_declarations.go | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/aconfig/all_aconfig_declarations.go b/aconfig/all_aconfig_declarations.go index b6c90234a..3d9663c1d 100644 --- a/aconfig/all_aconfig_declarations.go +++ b/aconfig/all_aconfig_declarations.go @@ -31,7 +31,8 @@ func AllAconfigDeclarationsFactory() android.Singleton { } type allAconfigDeclarationsSingleton struct { - intermediatePath android.OutputPath + intermediateBinaryProtoPath android.OutputPath + intermediateTextProtoPath android.OutputPath } func (this *allAconfigDeclarationsSingleton) GenerateBuildActions(ctx android.SingletonContext) { @@ -59,20 +60,35 @@ func (this *allAconfigDeclarationsSingleton) GenerateBuildActions(ctx android.Si panic(fmt.Errorf("Only one aconfig_declarations allowed for each package.")) } - // Generate build action for aconfig - this.intermediatePath = android.PathForIntermediates(ctx, "all_aconfig_declarations.pb") + // Generate build action for aconfig (binary proto output) + this.intermediateBinaryProtoPath = android.PathForIntermediates(ctx, "all_aconfig_declarations.pb") ctx.Build(pctx, android.BuildParams{ Rule: AllDeclarationsRule, Inputs: cacheFiles, - Output: this.intermediatePath, + Output: this.intermediateBinaryProtoPath, Description: "all_aconfig_declarations", Args: map[string]string{ "cache_files": android.JoinPathsWithPrefix(cacheFiles, "--cache "), }, }) - ctx.Phony("all_aconfig_declarations", this.intermediatePath) + ctx.Phony("all_aconfig_declarations", this.intermediateBinaryProtoPath) + + // Generate build action for aconfig (text proto output) + this.intermediateTextProtoPath = android.PathForIntermediates(ctx, "all_aconfig_declarations.textproto") + ctx.Build(pctx, android.BuildParams{ + Rule: AllDeclarationsRuleTextProto, + Inputs: cacheFiles, + Output: this.intermediateTextProtoPath, + Description: "all_aconfig_declarations_textproto", + Args: map[string]string{ + "cache_files": android.JoinPathsWithPrefix(cacheFiles, "--cache "), + }, + }) + ctx.Phony("all_aconfig_declarations_textproto", this.intermediateTextProtoPath) } func (this *allAconfigDeclarationsSingleton) MakeVars(ctx android.MakeVarsContext) { - ctx.DistForGoal("droid", this.intermediatePath) + ctx.DistForGoal("droid", this.intermediateBinaryProtoPath) + ctx.DistForGoalWithFilename("sdk", this.intermediateBinaryProtoPath, "flags.pb") + ctx.DistForGoalWithFilename("sdk", this.intermediateTextProtoPath, "flags.textproto") } |