Always write makefile for ${TARGET_RELEASE}
When writing all makefiles, we also need to write the makefile for
${TARGET_RELEASE}. We can skip writing it a second time if it is not
an alias.
Bug: 328495189
Test: manual, TH
Change-Id: Ia5d1955f419312c76eb9c8a33b1c8a6bcc5efe0b
diff --git a/cmd/release_config/release_config/main.go b/cmd/release_config/release_config/main.go
index 101dbe3..5432806 100644
--- a/cmd/release_config/release_config/main.go
+++ b/cmd/release_config/release_config/main.go
@@ -83,20 +83,24 @@
// We were told to guard operation and either we have no build flag, or it is False.
// Write an empty file so that release_config.mk will use the old process.
os.WriteFile(makefilePath, []byte{}, 0644)
- } else if allMake {
+ return
+ }
+ // Write the makefile where release_config.mk is going to look for it.
+ err = configs.WriteMakefile(makefilePath, targetRelease)
+ if err != nil {
+ panic(err)
+ }
+ if allMake {
// Write one makefile per release config, using the canonical release name.
for k, _ := range configs.ReleaseConfigs {
- makefilePath = filepath.Join(outputDir, fmt.Sprintf("release_config-%s-%s.mk", product, k))
- err = configs.WriteMakefile(makefilePath, k)
- if err != nil {
- panic(err)
+ if k != targetRelease {
+ makefilePath = filepath.Join(outputDir, fmt.Sprintf("release_config-%s-%s.mk", product, k))
+ err = configs.WriteMakefile(makefilePath, k)
+ if err != nil {
+ panic(err)
+ }
}
}
- } else {
- err = configs.WriteMakefile(makefilePath, targetRelease)
- if err != nil {
- panic(err)
- }
}
if json {
err = configs.WriteArtifact(outputDir, product, "json")