summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeongik Cha <jeongik@google.com> 2023-08-22 04:41:43 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2023-08-22 04:41:43 +0000
commit962bcdb18e18b3b1a3c87b79d3c97a36eae9ad65 (patch)
tree123a3a1daade951f74c82515dc88af68a54e52db
parent516a1882064d1cf50d506b9b5a4a4acf045ed312 (diff)
parentccf37005ecb23fcd1709aaf2f3a0381b3ca3ca26 (diff)
Merge "Reland "Make glob output include product name"" into main
-rw-r--r--ui/build/soong.go19
1 files changed, 16 insertions, 3 deletions
diff --git a/ui/build/soong.go b/ui/build/soong.go
index a4cf7fbf0..b8543d929 100644
--- a/ui/build/soong.go
+++ b/ui/build/soong.go
@@ -161,6 +161,14 @@ type PrimaryBuilderFactory struct {
debugPort string
}
+func getGlobPathName(config Config) string {
+ globPathName, ok := config.TargetProductOrErr()
+ if ok != nil {
+ globPathName = soongBuildTag
+ }
+ return globPathName
+}
+
func (pb PrimaryBuilderFactory) primaryBuilderInvocation() bootstrap.PrimaryBuilderInvocation {
commonArgs := make([]string, 0, 0)
@@ -195,9 +203,14 @@ func (pb PrimaryBuilderFactory) primaryBuilderInvocation() bootstrap.PrimaryBuil
var allArgs []string
allArgs = append(allArgs, pb.specificArgs...)
+ globPathName := pb.name
+ // Glob path for soong build would be separated per product target
+ if pb.name == soongBuildTag {
+ globPathName = getGlobPathName(pb.config)
+ }
allArgs = append(allArgs,
- "--globListDir", pb.name,
- "--globFile", pb.config.NamedGlobFile(pb.name))
+ "--globListDir", globPathName,
+ "--globFile", pb.config.NamedGlobFile(globPathName))
allArgs = append(allArgs, commonArgs...)
allArgs = append(allArgs, environmentArgs(pb.config, pb.name)...)
@@ -247,7 +260,7 @@ func bootstrapEpochCleanup(ctx Context, config Config) {
func bootstrapGlobFileList(config Config) []string {
return []string{
- config.NamedGlobFile(soongBuildTag),
+ config.NamedGlobFile(getGlobPathName(config)),
config.NamedGlobFile(bp2buildFilesTag),
config.NamedGlobFile(jsonModuleGraphTag),
config.NamedGlobFile(queryviewTag),