diff options
author | Nan Zhang <nanzhang@google.com> | 2017-02-04 17:47:46 -0800 |
---|---|---|
committer | Nan Zhang <nanzhang@google.com> | 2017-02-06 22:23:19 -0800 |
commit | 6d34b308ff8c87425163c3dbc864aa388f18d468 (patch) | |
tree | f235ede9d0d67e942fa57b1f377c762bcb5ba103 /android | |
parent | ae853ae0c018400070e73464e7a952acf556c68e (diff) | |
download | build_soong-6d34b308ff8c87425163c3dbc864aa388f18d468.tar.gz build_soong-6d34b308ff8c87425163c3dbc864aa388f18d468.tar.bz2 build_soong-6d34b308ff8c87425163c3dbc864aa388f18d468.zip |
Added phony module type for soong.
The "required" field within "phony" module in .bp file has to be
non-empty. And "phony" module doesn't contain any "src" files.
Bug: b/32981153
Test: make -j out/soong/build.ninja
Change-Id: Iaa2009467c44702572b97ca9cbd02c1d368c8d83
Diffstat (limited to 'android')
-rw-r--r-- | android/androidmk.go | 4 | ||||
-rw-r--r-- | android/module.go | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/android/androidmk.go b/android/androidmk.go index aeb0aa52..793947e0 100644 --- a/android/androidmk.go +++ b/android/androidmk.go @@ -43,7 +43,7 @@ type AndroidMkData struct { OutputFile OptionalPath Disabled bool - Custom func(w io.Writer, name, prefix string) error + Custom func(w io.Writer, name, prefix, moduleDir string) error Extra []func(w io.Writer, outputFile Path) error } @@ -185,7 +185,7 @@ func translateAndroidMkModule(ctx blueprint.SingletonContext, w io.Writer, mod b prefix = "2ND_" + prefix } - return data.Custom(w, name, prefix) + return data.Custom(w, name, prefix, filepath.Dir(ctx.BlueprintFile(mod))) } if data.Disabled { diff --git a/android/module.go b/android/module.go index b5de1adf..7b35d32f 100644 --- a/android/module.go +++ b/android/module.go @@ -89,6 +89,8 @@ type ModuleContext interface { Proprietary() bool InstallInData() bool + + RequiredModuleNames() []string } type Module interface { @@ -784,6 +786,10 @@ func (ctx *androidModuleContext) ExpandSourcesSubDir(srcFiles, excludes []string return expandedSrcFiles } +func (ctx *androidModuleContext) RequiredModuleNames() []string { + return ctx.module.base().commonProperties.Required +} + func (ctx *androidModuleContext) Glob(globPattern string, excludes []string) Paths { ret, err := ctx.GlobWithDeps(globPattern, excludes) if err != nil { |