Merge "Add the name of the sdk library to dynamically generated java modules" into main
This commit is contained in:
@@ -48,6 +48,7 @@ func RegisterStubsBuildComponents(ctx android.RegistrationContext) {
|
|||||||
// Droidstubs
|
// Droidstubs
|
||||||
type Droidstubs struct {
|
type Droidstubs struct {
|
||||||
Javadoc
|
Javadoc
|
||||||
|
embeddableInModuleAndImport
|
||||||
|
|
||||||
properties DroidstubsProperties
|
properties DroidstubsProperties
|
||||||
apiFile android.Path
|
apiFile android.Path
|
||||||
@@ -184,6 +185,7 @@ func DroidstubsFactory() android.Module {
|
|||||||
|
|
||||||
module.AddProperties(&module.properties,
|
module.AddProperties(&module.properties,
|
||||||
&module.Javadoc.properties)
|
&module.Javadoc.properties)
|
||||||
|
module.initModuleAndImport(module)
|
||||||
|
|
||||||
InitDroiddocModule(module, android.HostAndDeviceSupported)
|
InitDroiddocModule(module, android.HostAndDeviceSupported)
|
||||||
|
|
||||||
@@ -930,6 +932,8 @@ type PrebuiltStubsSourcesProperties struct {
|
|||||||
type PrebuiltStubsSources struct {
|
type PrebuiltStubsSources struct {
|
||||||
android.ModuleBase
|
android.ModuleBase
|
||||||
android.DefaultableModuleBase
|
android.DefaultableModuleBase
|
||||||
|
embeddableInModuleAndImport
|
||||||
|
|
||||||
prebuilt android.Prebuilt
|
prebuilt android.Prebuilt
|
||||||
|
|
||||||
properties PrebuiltStubsSourcesProperties
|
properties PrebuiltStubsSourcesProperties
|
||||||
@@ -1008,6 +1012,7 @@ func PrebuiltStubsSourcesFactory() android.Module {
|
|||||||
module := &PrebuiltStubsSources{}
|
module := &PrebuiltStubsSources{}
|
||||||
|
|
||||||
module.AddProperties(&module.properties)
|
module.AddProperties(&module.properties)
|
||||||
|
module.initModuleAndImport(module)
|
||||||
|
|
||||||
android.InitPrebuiltModule(module, &module.properties.Srcs)
|
android.InitPrebuiltModule(module, &module.properties.Srcs)
|
||||||
InitDroiddocModule(module, android.HostAndDeviceSupported)
|
InitDroiddocModule(module, android.HostAndDeviceSupported)
|
||||||
|
@@ -1613,6 +1613,7 @@ func BinaryHostFactory() android.Module {
|
|||||||
type JavaApiContribution struct {
|
type JavaApiContribution struct {
|
||||||
android.ModuleBase
|
android.ModuleBase
|
||||||
android.DefaultableModuleBase
|
android.DefaultableModuleBase
|
||||||
|
embeddableInModuleAndImport
|
||||||
|
|
||||||
properties struct {
|
properties struct {
|
||||||
// name of the API surface
|
// name of the API surface
|
||||||
@@ -1628,6 +1629,7 @@ func ApiContributionFactory() android.Module {
|
|||||||
android.InitAndroidModule(module)
|
android.InitAndroidModule(module)
|
||||||
android.InitDefaultableModule(module)
|
android.InitDefaultableModule(module)
|
||||||
module.AddProperties(&module.properties)
|
module.AddProperties(&module.properties)
|
||||||
|
module.initModuleAndImport(module)
|
||||||
return module
|
return module
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1656,6 +1658,7 @@ type ApiLibrary struct {
|
|||||||
|
|
||||||
hiddenAPI
|
hiddenAPI
|
||||||
dexer
|
dexer
|
||||||
|
embeddableInModuleAndImport
|
||||||
|
|
||||||
properties JavaApiLibraryProperties
|
properties JavaApiLibraryProperties
|
||||||
|
|
||||||
@@ -1714,6 +1717,7 @@ func ApiLibraryFactory() android.Module {
|
|||||||
module := &ApiLibrary{}
|
module := &ApiLibrary{}
|
||||||
android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibCommon)
|
android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibCommon)
|
||||||
module.AddProperties(&module.properties)
|
module.AddProperties(&module.properties)
|
||||||
|
module.initModuleAndImport(module)
|
||||||
android.InitDefaultableModule(module)
|
android.InitDefaultableModule(module)
|
||||||
return module
|
return module
|
||||||
}
|
}
|
||||||
@@ -3513,6 +3517,7 @@ func ApiContributionImportFactory() android.Module {
|
|||||||
android.InitDefaultableModule(module)
|
android.InitDefaultableModule(module)
|
||||||
android.InitPrebuiltModule(module, &[]string{""})
|
android.InitPrebuiltModule(module, &[]string{""})
|
||||||
module.AddProperties(&module.properties)
|
module.AddProperties(&module.properties)
|
||||||
|
module.AddProperties(&module.sdkLibraryComponentProperties)
|
||||||
return module
|
return module
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1829,7 +1829,7 @@ func (module *SdkLibrary) createStubsSourcesAndApi(mctx android.DefaultableHookC
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mctx.CreateModule(DroidstubsFactory, &props).(*Droidstubs).CallHookIfAvailable(mctx)
|
mctx.CreateModule(DroidstubsFactory, &props, module.sdkComponentPropertiesForChildLibrary()).(*Droidstubs).CallHookIfAvailable(mctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (module *SdkLibrary) createApiLibrary(mctx android.DefaultableHookContext, apiScope *apiScope, alternativeFullApiSurfaceStub string) {
|
func (module *SdkLibrary) createApiLibrary(mctx android.DefaultableHookContext, apiScope *apiScope, alternativeFullApiSurfaceStub string) {
|
||||||
@@ -1892,7 +1892,7 @@ func (module *SdkLibrary) createApiLibrary(mctx android.DefaultableHookContext,
|
|||||||
props.System_modules = module.deviceProperties.System_modules
|
props.System_modules = module.deviceProperties.System_modules
|
||||||
props.Enable_validation = proptools.BoolPtr(true)
|
props.Enable_validation = proptools.BoolPtr(true)
|
||||||
|
|
||||||
mctx.CreateModule(ApiLibraryFactory, &props)
|
mctx.CreateModule(ApiLibraryFactory, &props, module.sdkComponentPropertiesForChildLibrary())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (module *SdkLibrary) createTopLevelStubsLibrary(
|
func (module *SdkLibrary) createTopLevelStubsLibrary(
|
||||||
@@ -2590,7 +2590,7 @@ func (module *SdkLibraryImport) createPrebuiltStubsSources(mctx android.Defaulta
|
|||||||
// The stubs source is preferred if the java_sdk_library_import is preferred.
|
// The stubs source is preferred if the java_sdk_library_import is preferred.
|
||||||
props.CopyUserSuppliedPropertiesFromPrebuilt(&module.prebuilt)
|
props.CopyUserSuppliedPropertiesFromPrebuilt(&module.prebuilt)
|
||||||
|
|
||||||
mctx.CreateModule(PrebuiltStubsSourcesFactory, &props)
|
mctx.CreateModule(PrebuiltStubsSourcesFactory, &props, module.sdkComponentPropertiesForChildLibrary())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (module *SdkLibraryImport) createPrebuiltApiContribution(mctx android.DefaultableHookContext, apiScope *apiScope, scopeProperties *sdkLibraryScopeProperties) {
|
func (module *SdkLibraryImport) createPrebuiltApiContribution(mctx android.DefaultableHookContext, apiScope *apiScope, scopeProperties *sdkLibraryScopeProperties) {
|
||||||
@@ -2609,7 +2609,7 @@ func (module *SdkLibraryImport) createPrebuiltApiContribution(mctx android.Defau
|
|||||||
props.Api_file = api_file
|
props.Api_file = api_file
|
||||||
props.Visibility = []string{"//visibility:override", "//visibility:public"}
|
props.Visibility = []string{"//visibility:override", "//visibility:public"}
|
||||||
|
|
||||||
mctx.CreateModule(ApiContributionImportFactory, &props)
|
mctx.CreateModule(ApiContributionImportFactory, &props, module.sdkComponentPropertiesForChildLibrary())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the dependencies on the child module in the component deps mutator so that it
|
// Add the dependencies on the child module in the component deps mutator so that it
|
||||||
|
Reference in New Issue
Block a user