Soong support for namespaces

Bug: 65683273
Test: build/soong/scripts/diff_build_graphs.sh \
      --products=aosp_arm \
      'build/blueprint:work^ build/soong:work^' \
      'build/blueprint:work build/soong:work'
      # and see that the only changes were:
      # 1. adding some new files
      # 2. changing some line numbers
Test: m -j nothing # which runs unit tests

Change-Id: I6d3e52ef62c4cabe85b9a135a54de0e1a6aab29c
This commit is contained in:
Jeff Gaston
2017-11-09 17:21:27 -08:00
parent 5313911912
commit 63a250a336
10 changed files with 1102 additions and 6 deletions

View File

@@ -211,6 +211,8 @@ type commonProperties struct {
ArchSpecific bool `blueprint:"mutated"`
SkipInstall bool `blueprint:"mutated"`
NamespaceExportedToMake bool `blueprint:"mutated"`
}
type hostAndDeviceProperties struct {
@@ -476,8 +478,13 @@ func (a *ModuleBase) generateModuleTarget(ctx ModuleContext) {
var deps Paths
namespacePrefix := ctx.Namespace().(*Namespace).id
if namespacePrefix != "" {
namespacePrefix = namespacePrefix + "-"
}
if len(allInstalledFiles) > 0 {
name := PathForPhony(ctx, ctx.ModuleName()+"-install")
name := PathForPhony(ctx, namespacePrefix+ctx.ModuleName()+"-install")
ctx.Build(pctx, BuildParams{
Rule: blueprint.Phony,
Output: name,
@@ -489,7 +496,7 @@ func (a *ModuleBase) generateModuleTarget(ctx ModuleContext) {
}
if len(allCheckbuildFiles) > 0 {
name := PathForPhony(ctx, ctx.ModuleName()+"-checkbuild")
name := PathForPhony(ctx, namespacePrefix+ctx.ModuleName()+"-checkbuild")
ctx.Build(pctx, BuildParams{
Rule: blueprint.Phony,
Output: name,
@@ -505,9 +512,10 @@ func (a *ModuleBase) generateModuleTarget(ctx ModuleContext) {
suffix = "-soong"
}
name := PathForPhony(ctx, namespacePrefix+ctx.ModuleName()+suffix)
ctx.Build(pctx, BuildParams{
Rule: blueprint.Phony,
Output: PathForPhony(ctx, ctx.ModuleName()+suffix),
Outputs: []WritablePath{name},
Implicits: deps,
})