Switch java_sdk_library_import to use SetDefaultableHook() am: 6e7ecbf972
Change-Id: I0cfbf2c9a2a918dc8fafd8547274e4e03e1e5bd3
This commit is contained in:
commit
8e2521d47c
1 changed files with 4 additions and 4 deletions
|
@ -1085,7 +1085,7 @@ func sdkLibraryImportFactory() android.Module {
|
||||||
android.InitSdkAwareModule(module)
|
android.InitSdkAwareModule(module)
|
||||||
InitJavaModule(module, android.HostAndDeviceSupported)
|
InitJavaModule(module, android.HostAndDeviceSupported)
|
||||||
|
|
||||||
android.AddLoadHook(module, func(mctx android.LoadHookContext) { module.createInternalModules(mctx) })
|
module.SetDefaultableHook(func(mctx android.DefaultableHookContext) { module.createInternalModules(mctx) })
|
||||||
return module
|
return module
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1097,7 +1097,7 @@ func (module *sdkLibraryImport) Name() string {
|
||||||
return module.prebuilt.Name(module.ModuleBase.Name())
|
return module.prebuilt.Name(module.ModuleBase.Name())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (module *sdkLibraryImport) createInternalModules(mctx android.LoadHookContext) {
|
func (module *sdkLibraryImport) createInternalModules(mctx android.DefaultableHookContext) {
|
||||||
|
|
||||||
// If the build is configured to use prebuilts then force this to be preferred.
|
// If the build is configured to use prebuilts then force this to be preferred.
|
||||||
if mctx.Config().UnbundledBuildUsePrebuiltSdks() {
|
if mctx.Config().UnbundledBuildUsePrebuiltSdks() {
|
||||||
|
@ -1120,7 +1120,7 @@ func (module *sdkLibraryImport) createInternalModules(mctx android.LoadHookConte
|
||||||
*javaSdkLibraries = append(*javaSdkLibraries, module.BaseModuleName())
|
*javaSdkLibraries = append(*javaSdkLibraries, module.BaseModuleName())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (module *sdkLibraryImport) createJavaImportForStubs(mctx android.LoadHookContext, apiScope *apiScope, scopeProperties *sdkLibraryScopeProperties) {
|
func (module *sdkLibraryImport) createJavaImportForStubs(mctx android.DefaultableHookContext, apiScope *apiScope, scopeProperties *sdkLibraryScopeProperties) {
|
||||||
// Creates a java import for the jar with ".stubs" suffix
|
// Creates a java import for the jar with ".stubs" suffix
|
||||||
props := struct {
|
props := struct {
|
||||||
Name *string
|
Name *string
|
||||||
|
@ -1156,7 +1156,7 @@ func (module *sdkLibraryImport) createJavaImportForStubs(mctx android.LoadHookCo
|
||||||
mctx.CreateModule(ImportFactory, &props)
|
mctx.CreateModule(ImportFactory, &props)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (module *sdkLibraryImport) createPrebuiltStubsSources(mctx android.LoadHookContext, apiScope *apiScope, scopeProperties *sdkLibraryScopeProperties) {
|
func (module *sdkLibraryImport) createPrebuiltStubsSources(mctx android.DefaultableHookContext, apiScope *apiScope, scopeProperties *sdkLibraryScopeProperties) {
|
||||||
props := struct {
|
props := struct {
|
||||||
Name *string
|
Name *string
|
||||||
Srcs []string
|
Srcs []string
|
||||||
|
|
Loading…
Reference in a new issue