aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2016-01-11 12:55:55 -0800
committerColin Cross <ccross@android.com>2016-01-11 16:29:06 -0800
commit4f6e4e6235ed628b023601bf4565d70d2608ca5a (patch)
tree15872bb392aa28be96289615e3b73858c4272cc9 /common
parenta45ee701127c95f1d411e3343add7c1f2491323c (diff)
downloadbuild_soong-4f6e4e6235ed628b023601bf4565d70d2608ca5a.tar.gz
build_soong-4f6e4e6235ed628b023601bf4565d70d2608ca5a.tar.bz2
build_soong-4f6e4e6235ed628b023601bf4565d70d2608ca5a.zip
Export all modules
Export all modules to out/soong/Android.mk, even if they have a corresponding Android.mk file next to the Android.bp file. Change-Id: I14b67b1108f0c0ed8f9d9202c4af3a37f5cbf7d1
Diffstat (limited to 'common')
-rw-r--r--common/androidmk.go42
1 files changed, 4 insertions, 38 deletions
diff --git a/common/androidmk.go b/common/androidmk.go
index 9bd3a191..86efb042 100644
--- a/common/androidmk.go
+++ b/common/androidmk.go
@@ -51,53 +51,19 @@ func AndroidMkSingleton() blueprint.Singleton {
type androidMkSingleton struct{}
func (c *androidMkSingleton) GenerateBuildActions(ctx blueprint.SingletonContext) {
- dirModules := make(map[string][]blueprint.Module)
- hasBPDir := make(map[string]bool)
- bpDirs := []string{}
-
if !ctx.Config().(Config).EmbeddedInMake() {
return
}
ctx.SetNinjaBuildDir(pctx, filepath.Join(ctx.Config().(Config).buildDir, ".."))
- ctx.VisitAllModules(func(module blueprint.Module) {
- if _, ok := module.(AndroidModule); ok {
- bpDir := filepath.Dir(ctx.BlueprintFile(module))
-
- if !hasBPDir[bpDir] {
- hasBPDir[bpDir] = true
- bpDirs = append(bpDirs, bpDir)
- }
-
- dirModules[bpDir] = append(dirModules[bpDir], module)
- }
- })
+ var androidMkModulesList []AndroidModule
- // Gather list of eligible Android modules for translation
- androidMkModules := make(map[blueprint.Module]bool)
- sort.Strings(bpDirs)
- for _, bpDir := range bpDirs {
- mkFile := OptionalPathForSource(ctx, "androidmk", bpDir, "Android.mk")
- if !mkFile.Valid() {
- for _, mod := range dirModules[bpDir] {
- androidMkModules[mod] = true
- }
- }
- }
-
- // Validate that all modules have proper dependencies
- androidMkModulesList := make([]AndroidModule, 0, len(androidMkModules))
- for mod := range androidMkModules {
- ctx.VisitDepsDepthFirstIf(mod, isAndroidModule, func(module blueprint.Module) {
- if !androidMkModules[module] {
- ctx.Errorf("Module %q missing dependency for Android.mk: %q", ctx.ModuleName(mod), ctx.ModuleName(module))
- }
- })
- if amod, ok := mod.(AndroidModule); ok {
+ ctx.VisitAllModules(func(module blueprint.Module) {
+ if amod, ok := module.(AndroidModule); ok {
androidMkModulesList = append(androidMkModulesList, amod)
}
- }
+ })
sort.Sort(AndroidModulesByName{androidMkModulesList, ctx})