summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jihoon Kang <jihoonkang@google.com> 2025-02-11 23:02:14 +0000
committer Jihoon Kang <jihoonkang@google.com> 2025-02-11 23:53:16 +0000
commitbafbd21a299cabaffddc12a53abfb4a72be29410 (patch)
treec3a769b4983613438939b47212358f05fa5c804f
parent4b92926bd8c3171d0e0c9a15bf7e15cb2c03c0f8 (diff)
Convert release config artifacts dist rules to Soong
From make to support disting the artifacts in Soong only build. Test: m droid dist --soong-only && aninja -t path droid out/dist/build_flags/all_release_configs.pb Bug: 395160805 Bug: 394365683 Change-Id: I61ab33b2fe70e8f1f3d1fd1ec4fcf5d31695fd04
-rw-r--r--aconfig/build_flags/build_flags_singleton.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/aconfig/build_flags/build_flags_singleton.go b/aconfig/build_flags/build_flags_singleton.go
index 3b407556f..e76db49d5 100644
--- a/aconfig/build_flags/build_flags_singleton.go
+++ b/aconfig/build_flags/build_flags_singleton.go
@@ -16,6 +16,7 @@ package build_flags
import (
"android/soong/android"
+ "fmt"
)
// A singleton module that collects all of the build flags declared in the
@@ -120,4 +121,26 @@ func (this *allBuildFlagDeclarationsSingleton) MakeVars(ctx android.MakeVarsCont
ctx.DistForGoalWithFilename(goal, this.configsBinaryProtoPath, "build_flags/all_release_config_contributions.pb")
ctx.DistForGoalWithFilename(goal, this.configsTextProtoPath, "build_flags/all_release_config_contributions.textproto")
}
+
+ if ctx.Config().HasDeviceProduct() {
+ flagsDir := android.PathForOutput(ctx, "release-config")
+ baseAllRelease := fmt.Sprintf("all_release_configs-%s", ctx.Config().DeviceProduct())
+
+ distAllReleaseConfigsArtifact := func(ext string) {
+ ctx.DistForGoalWithFilename(
+ "droid",
+ flagsDir.Join(ctx, fmt.Sprintf("%s.%s", baseAllRelease, ext)),
+ fmt.Sprintf("build_flags/all_release_configs.%s", ext),
+ )
+ }
+
+ distAllReleaseConfigsArtifact("pb")
+ distAllReleaseConfigsArtifact("textproto")
+ distAllReleaseConfigsArtifact("json")
+ ctx.DistForGoalWithFilename(
+ "droid",
+ flagsDir.Join(ctx, fmt.Sprintf("inheritance_graph-%s.dot", ctx.Config().DeviceProduct())),
+ fmt.Sprintf("build_flags/inheritance_graph-%s.dot", ctx.Config().DeviceProduct()),
+ )
+ }
}