Build build_flags.json in soong
Define release_flags_json module type to install build_flags.json in 'etc'. release_flags_json reads the json files generated from the soong release-config command. Bug: 324996303 Test: build and see if the files are installed Change-Id: I8cdcb7c61dd75cc54e4912d2ed7d1687f424151c
This commit is contained in:
@@ -120,7 +120,7 @@ func main() {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
if err = config.WritePartitionBuildFlags(outputDir, product, targetRelease); err != nil {
|
||||
if err = config.WritePartitionBuildFlags(outputDir); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
|
@@ -284,13 +284,15 @@ func (config *ReleaseConfig) GenerateReleaseConfig(configs *ReleaseConfigs) erro
|
||||
return nil
|
||||
}
|
||||
|
||||
func (config *ReleaseConfig) WritePartitionBuildFlags(outDir, product, targetRelease string) error {
|
||||
func (config *ReleaseConfig) WritePartitionBuildFlags(outDir string) error {
|
||||
var err error
|
||||
for partition, flags := range config.PartitionBuildFlags {
|
||||
slices.SortFunc(flags.FlagArtifacts, func(a, b *rc_proto.FlagArtifact) int {
|
||||
return cmp.Compare(*a.FlagDeclaration.Name, *b.FlagDeclaration.Name)
|
||||
})
|
||||
if err = WriteMessage(filepath.Join(outDir, fmt.Sprintf("build_flags_%s-%s-%s.json", partition, config.Name, product)), flags); err != nil {
|
||||
// The json file name must not be modified as this is read from
|
||||
// build_flags_json module
|
||||
if err = WriteMessage(filepath.Join(outDir, fmt.Sprintf("build_flags_%s.json", partition)), flags); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user