Merge "Call hook in java_sdk_library after droidstubs generation"
This commit is contained in:
@@ -55,7 +55,7 @@ func (d *DefaultableModuleBase) SetDefaultableHook(hook DefaultableHook) {
|
||||
d.hook = hook
|
||||
}
|
||||
|
||||
func (d *DefaultableModuleBase) callHookIfAvailable(ctx DefaultableHookContext) {
|
||||
func (d *DefaultableModuleBase) CallHookIfAvailable(ctx DefaultableHookContext) {
|
||||
if d.hook != nil {
|
||||
d.hook(ctx)
|
||||
}
|
||||
@@ -82,7 +82,7 @@ type Defaultable interface {
|
||||
SetDefaultableHook(hook DefaultableHook)
|
||||
|
||||
// Call the hook if specified.
|
||||
callHookIfAvailable(context DefaultableHookContext)
|
||||
CallHookIfAvailable(context DefaultableHookContext)
|
||||
}
|
||||
|
||||
type DefaultableModule interface {
|
||||
@@ -630,6 +630,6 @@ func defaultsMutator(ctx TopDownMutatorContext) {
|
||||
defaultable.applyDefaults(ctx, defaultsList)
|
||||
}
|
||||
|
||||
defaultable.callHookIfAvailable(ctx)
|
||||
defaultable.CallHookIfAvailable(ctx)
|
||||
}
|
||||
}
|
||||
|
@@ -1749,7 +1749,7 @@ func (module *SdkLibrary) createStubsSourcesAndApi(mctx android.DefaultableHookC
|
||||
}
|
||||
}
|
||||
|
||||
mctx.CreateModule(DroidstubsFactory, &props)
|
||||
mctx.CreateModule(DroidstubsFactory, &props).(*Droidstubs).CallHookIfAvailable(mctx)
|
||||
}
|
||||
|
||||
func (module *SdkLibrary) compareAgainstLatestApi(apiScope *apiScope) bool {
|
||||
|
@@ -120,6 +120,7 @@ func TestJavaSdkLibrary(t *testing.T) {
|
||||
result.ModuleForTests(apiScopePublic.stubsSourceModuleName("foo"), "android_common")
|
||||
result.ModuleForTests(apiScopeSystem.stubsSourceModuleName("foo"), "android_common")
|
||||
result.ModuleForTests(apiScopeTest.stubsSourceModuleName("foo"), "android_common")
|
||||
result.ModuleForTests(apiScopePublic.stubsSourceModuleName("foo")+".api.contribution", "")
|
||||
result.ModuleForTests("foo"+sdkXmlFileSuffix, "android_common")
|
||||
result.ModuleForTests("foo.api.public.28", "")
|
||||
result.ModuleForTests("foo.api.system.28", "")
|
||||
|
Reference in New Issue
Block a user