Merge "support PRODUCT_SOURCE_ROOT_DIRS product variable" am: 998fdd7e37
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2448343 Change-Id: I3d4cd8798252c486c0025ef1f589606abd8c26f8 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1179,6 +1179,10 @@ func (c *config) ExportedNamespaces() []string {
|
|||||||
return append([]string(nil), c.productVariables.NamespacesToExport...)
|
return append([]string(nil), c.productVariables.NamespacesToExport...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *config) SourceRootDirs() []string {
|
||||||
|
return c.productVariables.SourceRootDirs
|
||||||
|
}
|
||||||
|
|
||||||
func (c *config) IncludeTags() []string {
|
func (c *config) IncludeTags() []string {
|
||||||
return c.productVariables.IncludeTags
|
return c.productVariables.IncludeTags
|
||||||
}
|
}
|
||||||
|
@@ -225,6 +225,10 @@ func (r *NameResolver) NewModule(ctx blueprint.NamespaceContext, moduleGroup blu
|
|||||||
return ns, nil
|
return ns, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *NameResolver) NewSkippedModule(ctx blueprint.NamespaceContext, name string, skipInfo blueprint.SkippedModuleInfo) {
|
||||||
|
r.rootNamespace.moduleContainer.NewSkippedModule(ctx, name, skipInfo)
|
||||||
|
}
|
||||||
|
|
||||||
func (r *NameResolver) AllModules() []blueprint.ModuleGroup {
|
func (r *NameResolver) AllModules() []blueprint.ModuleGroup {
|
||||||
childLists := [][]blueprint.ModuleGroup{}
|
childLists := [][]blueprint.ModuleGroup{}
|
||||||
totalCount := 0
|
totalCount := 0
|
||||||
@@ -300,7 +304,7 @@ func (r *NameResolver) FindNamespaceImports(namespace *Namespace) (err error) {
|
|||||||
for _, name := range namespace.importedNamespaceNames {
|
for _, name := range namespace.importedNamespaceNames {
|
||||||
imp, ok := r.namespaceAt(name)
|
imp, ok := r.namespaceAt(name)
|
||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("namespace %v does not exist", name)
|
return fmt.Errorf("namespace %v does not exist; Some necessary modules may have been skipped by Soong. Check if PRODUCT_SOURCE_ROOT_DIRS is pruning necessary Android.bp files.", name)
|
||||||
}
|
}
|
||||||
namespace.visibleNamespaces = append(namespace.visibleNamespaces, imp)
|
namespace.visibleNamespaces = append(namespace.visibleNamespaces, imp)
|
||||||
}
|
}
|
||||||
|
@@ -162,6 +162,7 @@ func NewContext(config Config) *Context {
|
|||||||
ctx := &Context{blueprint.NewContext(), config}
|
ctx := &Context{blueprint.NewContext(), config}
|
||||||
ctx.SetSrcDir(absSrcDir)
|
ctx.SetSrcDir(absSrcDir)
|
||||||
ctx.AddIncludeTags(config.IncludeTags()...)
|
ctx.AddIncludeTags(config.IncludeTags()...)
|
||||||
|
ctx.AddSourceRootDirs(config.SourceRootDirs()...)
|
||||||
return ctx
|
return ctx
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -461,7 +461,8 @@ type productVariables struct {
|
|||||||
|
|
||||||
IgnorePrefer32OnDevice bool `json:",omitempty"`
|
IgnorePrefer32OnDevice bool `json:",omitempty"`
|
||||||
|
|
||||||
IncludeTags []string `json:",omitempty"`
|
IncludeTags []string `json:",omitempty"`
|
||||||
|
SourceRootDirs []string `json:",omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func boolPtr(v bool) *bool {
|
func boolPtr(v bool) *bool {
|
||||||
|
@@ -105,6 +105,7 @@ func newContext(configuration android.Config) *android.Context {
|
|||||||
ctx.SetNameInterface(newNameResolver(configuration))
|
ctx.SetNameInterface(newNameResolver(configuration))
|
||||||
ctx.SetAllowMissingDependencies(configuration.AllowMissingDependencies())
|
ctx.SetAllowMissingDependencies(configuration.AllowMissingDependencies())
|
||||||
ctx.AddIncludeTags(configuration.IncludeTags()...)
|
ctx.AddIncludeTags(configuration.IncludeTags()...)
|
||||||
|
ctx.AddSourceRootDirs(configuration.SourceRootDirs()...)
|
||||||
return ctx
|
return ctx
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -117,7 +117,8 @@ type configImpl struct {
|
|||||||
|
|
||||||
bazelForceEnabledModules string
|
bazelForceEnabledModules string
|
||||||
|
|
||||||
includeTags []string
|
includeTags []string
|
||||||
|
sourceRootDirs []string
|
||||||
|
|
||||||
// Data source to write ninja weight list
|
// Data source to write ninja weight list
|
||||||
ninjaWeightListSource NinjaWeightListSource
|
ninjaWeightListSource NinjaWeightListSource
|
||||||
@@ -1229,6 +1230,14 @@ func (c *configImpl) Parallel() int {
|
|||||||
return c.parallel
|
return c.parallel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *configImpl) GetSourceRootDirs() []string {
|
||||||
|
return c.sourceRootDirs
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *configImpl) SetSourceRootDirs(i []string) {
|
||||||
|
c.sourceRootDirs = i
|
||||||
|
}
|
||||||
|
|
||||||
func (c *configImpl) GetIncludeTags() []string {
|
func (c *configImpl) GetIncludeTags() []string {
|
||||||
return c.includeTags
|
return c.includeTags
|
||||||
}
|
}
|
||||||
|
@@ -148,6 +148,7 @@ var BannerVars = []string{
|
|||||||
"PLATFORM_VERSION_CODENAME",
|
"PLATFORM_VERSION_CODENAME",
|
||||||
"PLATFORM_VERSION",
|
"PLATFORM_VERSION",
|
||||||
"PRODUCT_INCLUDE_TAGS",
|
"PRODUCT_INCLUDE_TAGS",
|
||||||
|
"PRODUCT_SOURCE_ROOT_DIRS",
|
||||||
"TARGET_PRODUCT",
|
"TARGET_PRODUCT",
|
||||||
"TARGET_BUILD_VARIANT",
|
"TARGET_BUILD_VARIANT",
|
||||||
"TARGET_BUILD_APPS",
|
"TARGET_BUILD_APPS",
|
||||||
@@ -299,4 +300,5 @@ func runMakeProductConfig(ctx Context, config Config) {
|
|||||||
config.SetBuildBrokenUsesNetwork(makeVars["BUILD_BROKEN_USES_NETWORK"] == "true")
|
config.SetBuildBrokenUsesNetwork(makeVars["BUILD_BROKEN_USES_NETWORK"] == "true")
|
||||||
config.SetBuildBrokenNinjaUsesEnvVars(strings.Fields(makeVars["BUILD_BROKEN_NINJA_USES_ENV_VARS"]))
|
config.SetBuildBrokenNinjaUsesEnvVars(strings.Fields(makeVars["BUILD_BROKEN_NINJA_USES_ENV_VARS"]))
|
||||||
config.SetIncludeTags(strings.Fields(makeVars["PRODUCT_INCLUDE_TAGS"]))
|
config.SetIncludeTags(strings.Fields(makeVars["PRODUCT_INCLUDE_TAGS"]))
|
||||||
|
config.SetSourceRootDirs(strings.Fields(makeVars["PRODUCT_SOURCE_ROOT_DIRS"]))
|
||||||
}
|
}
|
||||||
|
@@ -410,6 +410,7 @@ func bootstrapBlueprint(ctx Context, config Config) {
|
|||||||
|
|
||||||
blueprintCtx := blueprint.NewContext()
|
blueprintCtx := blueprint.NewContext()
|
||||||
blueprintCtx.AddIncludeTags(config.GetIncludeTags()...)
|
blueprintCtx.AddIncludeTags(config.GetIncludeTags()...)
|
||||||
|
blueprintCtx.AddSourceRootDirs(config.GetSourceRootDirs()...)
|
||||||
blueprintCtx.SetIgnoreUnknownModuleTypes(true)
|
blueprintCtx.SetIgnoreUnknownModuleTypes(true)
|
||||||
blueprintConfig := BlueprintConfig{
|
blueprintConfig := BlueprintConfig{
|
||||||
soongOutDir: config.SoongOutDir(),
|
soongOutDir: config.SoongOutDir(),
|
||||||
|
Reference in New Issue
Block a user