diff options
| -rw-r--r-- | android/defaults.go | 1 | ||||
| -rw-r--r-- | java/sdk_library.go | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/android/defaults.go b/android/defaults.go index aacfbacc6..be80cf10f 100644 --- a/android/defaults.go +++ b/android/defaults.go @@ -104,6 +104,7 @@ type DefaultableHookContext interface { EarlyModuleContext CreateModule(ModuleFactory, ...interface{}) Module + AddMissingDependencies(missingDeps []string) } type DefaultableHook func(ctx DefaultableHookContext) diff --git a/java/sdk_library.go b/java/sdk_library.go index b5b6232d6..6e860e703 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -1629,8 +1629,12 @@ func (module *SdkLibrary) CreateInternalModules(mctx android.DefaultableHookCont path := path.Join(mctx.ModuleDir(), apiDir, scope.apiFilePrefix+api) p := android.ExistentPathForSource(mctx, path) if !p.Valid() { - mctx.ModuleErrorf("Current api file %#v doesn't exist", path) - missingCurrentApi = true + if mctx.Config().AllowMissingDependencies() { + mctx.AddMissingDependencies([]string{path}) + } else { + mctx.ModuleErrorf("Current api file %#v doesn't exist", path) + missingCurrentApi = true + } } } } |