summaryrefslogtreecommitdiff
path: root/android/module.go
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2025-01-08 13:05:40 -0800
committer Cole Faust <colefaust@google.com> 2025-01-08 14:25:18 -0800
commitc5bfbddeec6d81be1fef37a8c2dffe00947a7df0 (patch)
tree351151893cd2c8c4b7fece629a568dab9224d19f /android/module.go
parente7893d750914543f02274136116c50be8a15a205 (diff)
Support disting in soong-only builds
Disting was normally handled by the packaging kati step, which was not run in soong-only builds. Disting needs to be done in a separate ninja file, so that if you toggle dist on/off you only need to regenerate a small ninja file instead of the main one. This change makes it so that the kati packaging step is also run in soong-only builds. (which makes them not technically soong-only, but the packaging step is very fast so it's fine) Phonies in soong were normally exported to the main make invocation and then make would emit the ninja rules for them. In soong-only builds soong would emit the ninja phone rules directly. This is problematic when supporting disting in soong, because some of the phony rules have the same name as dist targets, causing ninja to complain about duplicate rules. To resolve this, make soong export its phonies to the packaging step, which will dedup them with the dist phonies. Bug: 388312357 Test: m --soong-only dist Change-Id: If6de8c28274fe96dac674f449b9bc0b488540655
Diffstat (limited to 'android/module.go')
-rw-r--r--android/module.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/android/module.go b/android/module.go
index b8f2cae2e..2f505aa30 100644
--- a/android/module.go
+++ b/android/module.go
@@ -1679,14 +1679,13 @@ func (m *ModuleBase) generateModuleTarget(ctx *moduleContext) {
}
})
- var deps Paths
-
var namespacePrefix string
nameSpace := ctx.Namespace().Path
if nameSpace != "." {
namespacePrefix = strings.ReplaceAll(nameSpace, "/", ".") + "-"
}
+ var deps Paths
var info FinalModuleBuildTargetsInfo
if len(allInstalledFiles) > 0 {
@@ -1853,9 +1852,9 @@ type SourceFilesInfo struct {
var SourceFilesInfoKey = blueprint.NewProvider[SourceFilesInfo]()
+// FinalModuleBuildTargetsInfo is used by buildTargetSingleton to create checkbuild and
+// per-directory build targets. Only set on the final variant of each module
type FinalModuleBuildTargetsInfo struct {
- // Used by buildTargetSingleton to create checkbuild and per-directory build targets
- // Only set on the final variant of each module
InstallTarget WritablePath
CheckbuildTarget WritablePath
BlueprintDir string