Merge "java_sdk_library: support system_modules properly"
This commit is contained in:
commit
14544da609
1 changed files with 20 additions and 9 deletions
|
@ -358,7 +358,7 @@ func (module *SdkLibrary) xmlFileName() string {
|
||||||
// SDK version that the stubs library is built against. Note that this is always
|
// SDK version that the stubs library is built against. Note that this is always
|
||||||
// *current. Older stubs library built with a numberd SDK version is created from
|
// *current. Older stubs library built with a numberd SDK version is created from
|
||||||
// the prebuilt jar.
|
// the prebuilt jar.
|
||||||
func (module *SdkLibrary) sdkVersion(apiScope apiScope) string {
|
func (module *SdkLibrary) sdkVersionForScope(apiScope apiScope) string {
|
||||||
switch apiScope {
|
switch apiScope {
|
||||||
case apiScopePublic:
|
case apiScopePublic:
|
||||||
return "current"
|
return "current"
|
||||||
|
@ -371,6 +371,18 @@ func (module *SdkLibrary) sdkVersion(apiScope apiScope) string {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get the sdk version for use when compiling the stubs library.
|
||||||
|
func (module *SdkLibrary) sdkVersionForStubsLibrary(mctx android.BaseModuleContext, apiScope apiScope) string {
|
||||||
|
sdkDep := decodeSdkDep(mctx, sdkContext(&module.Library))
|
||||||
|
if sdkDep.hasStandardLibs() {
|
||||||
|
// If building against a standard sdk then use the sdk version appropriate for the scope.
|
||||||
|
return module.sdkVersionForScope(apiScope)
|
||||||
|
} else {
|
||||||
|
// Otherwise, use no system module.
|
||||||
|
return "none"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// $(INTERNAL_PLATFORM_<apiTagName>_API_FILE) points to the generated
|
// $(INTERNAL_PLATFORM_<apiTagName>_API_FILE) points to the generated
|
||||||
// api file for the current source
|
// api file for the current source
|
||||||
// TODO: remove this when apicheck is done in soong
|
// TODO: remove this when apicheck is done in soong
|
||||||
|
@ -419,13 +431,13 @@ func (module *SdkLibrary) createStubsLibrary(mctx android.LoadHookContext, apiSc
|
||||||
Name *string
|
Name *string
|
||||||
Srcs []string
|
Srcs []string
|
||||||
Sdk_version *string
|
Sdk_version *string
|
||||||
|
System_modules *string
|
||||||
Libs []string
|
Libs []string
|
||||||
Soc_specific *bool
|
Soc_specific *bool
|
||||||
Device_specific *bool
|
Device_specific *bool
|
||||||
Product_specific *bool
|
Product_specific *bool
|
||||||
System_ext_specific *bool
|
System_ext_specific *bool
|
||||||
Compile_dex *bool
|
Compile_dex *bool
|
||||||
System_modules *string
|
|
||||||
Java_version *string
|
Java_version *string
|
||||||
Product_variables struct {
|
Product_variables struct {
|
||||||
Unbundled_build struct {
|
Unbundled_build struct {
|
||||||
|
@ -441,23 +453,18 @@ func (module *SdkLibrary) createStubsLibrary(mctx android.LoadHookContext, apiSc
|
||||||
}
|
}
|
||||||
}{}
|
}{}
|
||||||
|
|
||||||
sdkVersion := module.sdkVersion(apiScope)
|
|
||||||
sdkDep := decodeSdkDep(mctx, sdkContext(&module.Library))
|
|
||||||
if !sdkDep.hasStandardLibs() {
|
|
||||||
sdkVersion = "none"
|
|
||||||
}
|
|
||||||
|
|
||||||
props.Name = proptools.StringPtr(module.stubsName(apiScope))
|
props.Name = proptools.StringPtr(module.stubsName(apiScope))
|
||||||
// sources are generated from the droiddoc
|
// sources are generated from the droiddoc
|
||||||
props.Srcs = []string{":" + module.docsName(apiScope)}
|
props.Srcs = []string{":" + module.docsName(apiScope)}
|
||||||
|
sdkVersion := module.sdkVersionForStubsLibrary(mctx, apiScope)
|
||||||
props.Sdk_version = proptools.StringPtr(sdkVersion)
|
props.Sdk_version = proptools.StringPtr(sdkVersion)
|
||||||
|
props.System_modules = module.Library.Module.deviceProperties.System_modules
|
||||||
props.Libs = module.sdkLibraryProperties.Stub_only_libs
|
props.Libs = module.sdkLibraryProperties.Stub_only_libs
|
||||||
// Unbundled apps will use the prebult one from /prebuilts/sdk
|
// Unbundled apps will use the prebult one from /prebuilts/sdk
|
||||||
if mctx.Config().UnbundledBuildUsePrebuiltSdks() {
|
if mctx.Config().UnbundledBuildUsePrebuiltSdks() {
|
||||||
props.Product_variables.Unbundled_build.Enabled = proptools.BoolPtr(false)
|
props.Product_variables.Unbundled_build.Enabled = proptools.BoolPtr(false)
|
||||||
}
|
}
|
||||||
props.Product_variables.Pdk.Enabled = proptools.BoolPtr(false)
|
props.Product_variables.Pdk.Enabled = proptools.BoolPtr(false)
|
||||||
props.System_modules = module.Library.Module.deviceProperties.System_modules
|
|
||||||
props.Openjdk9.Srcs = module.Library.Module.properties.Openjdk9.Srcs
|
props.Openjdk9.Srcs = module.Library.Module.properties.Openjdk9.Srcs
|
||||||
props.Openjdk9.Javacflags = module.Library.Module.properties.Openjdk9.Javacflags
|
props.Openjdk9.Javacflags = module.Library.Module.properties.Openjdk9.Javacflags
|
||||||
props.Java_version = module.Library.Module.properties.Java_version
|
props.Java_version = module.Library.Module.properties.Java_version
|
||||||
|
@ -486,6 +493,7 @@ func (module *SdkLibrary) createStubsSources(mctx android.LoadHookContext, apiSc
|
||||||
Srcs []string
|
Srcs []string
|
||||||
Installable *bool
|
Installable *bool
|
||||||
Sdk_version *string
|
Sdk_version *string
|
||||||
|
System_modules *string
|
||||||
Libs []string
|
Libs []string
|
||||||
Arg_files []string
|
Arg_files []string
|
||||||
Args *string
|
Args *string
|
||||||
|
@ -507,6 +515,8 @@ func (module *SdkLibrary) createStubsSources(mctx android.LoadHookContext, apiSc
|
||||||
}{}
|
}{}
|
||||||
|
|
||||||
sdkDep := decodeSdkDep(mctx, sdkContext(&module.Library))
|
sdkDep := decodeSdkDep(mctx, sdkContext(&module.Library))
|
||||||
|
// Use the platform API if standard libraries were requested, otherwise use
|
||||||
|
// no default libraries.
|
||||||
sdkVersion := ""
|
sdkVersion := ""
|
||||||
if !sdkDep.hasStandardLibs() {
|
if !sdkDep.hasStandardLibs() {
|
||||||
sdkVersion = "none"
|
sdkVersion = "none"
|
||||||
|
@ -515,6 +525,7 @@ func (module *SdkLibrary) createStubsSources(mctx android.LoadHookContext, apiSc
|
||||||
props.Name = proptools.StringPtr(module.docsName(apiScope))
|
props.Name = proptools.StringPtr(module.docsName(apiScope))
|
||||||
props.Srcs = append(props.Srcs, module.Library.Module.properties.Srcs...)
|
props.Srcs = append(props.Srcs, module.Library.Module.properties.Srcs...)
|
||||||
props.Sdk_version = proptools.StringPtr(sdkVersion)
|
props.Sdk_version = proptools.StringPtr(sdkVersion)
|
||||||
|
props.System_modules = module.Library.Module.deviceProperties.System_modules
|
||||||
props.Installable = proptools.BoolPtr(false)
|
props.Installable = proptools.BoolPtr(false)
|
||||||
// A droiddoc module has only one Libs property and doesn't distinguish between
|
// A droiddoc module has only one Libs property and doesn't distinguish between
|
||||||
// shared libs and static libs. So we need to add both of these libs to Libs property.
|
// shared libs and static libs. So we need to add both of these libs to Libs property.
|
||||||
|
|
Loading…
Reference in a new issue