Remove Metalava_enabled property
Metalava_enabled property is no longer used and APIs format will be changed. So sdk_library will not support docalva. Test: m -j Bug: 117127012 Change-Id: Id146d96413b2979ca903e854e00d4c7a0aa8d6e7
This commit is contained in:
@@ -134,11 +134,6 @@ type sdkLibraryProperties struct {
|
|||||||
// Defaults to "android.annotation".
|
// Defaults to "android.annotation".
|
||||||
Srcs_lib_whitelist_pkgs []string
|
Srcs_lib_whitelist_pkgs []string
|
||||||
|
|
||||||
// if set to true, create stubs through Metalava instead of Doclava. Javadoc/Doclava is
|
|
||||||
// currently still used for documentation generation, and will be replaced by Dokka soon.
|
|
||||||
// Defaults to true.
|
|
||||||
Metalava_enabled *bool
|
|
||||||
|
|
||||||
// TODO: determines whether to create HTML doc or not
|
// TODO: determines whether to create HTML doc or not
|
||||||
//Html_doc *bool
|
//Html_doc *bool
|
||||||
}
|
}
|
||||||
@@ -447,9 +442,6 @@ func (module *sdkLibrary) createDocs(mctx android.TopDownMutatorContext, apiScop
|
|||||||
Local_include_dirs []string
|
Local_include_dirs []string
|
||||||
}
|
}
|
||||||
}{}
|
}{}
|
||||||
droiddocProps := struct {
|
|
||||||
Custom_template *string
|
|
||||||
}{}
|
|
||||||
|
|
||||||
props.Name = proptools.StringPtr(module.docsName(apiScope))
|
props.Name = proptools.StringPtr(module.docsName(apiScope))
|
||||||
props.Srcs = append(props.Srcs, module.properties.Srcs...)
|
props.Srcs = append(props.Srcs, module.properties.Srcs...)
|
||||||
@@ -462,25 +454,12 @@ func (module *sdkLibrary) createDocs(mctx android.TopDownMutatorContext, apiScop
|
|||||||
props.Aidl.Include_dirs = module.deviceProperties.Aidl.Include_dirs
|
props.Aidl.Include_dirs = module.deviceProperties.Aidl.Include_dirs
|
||||||
props.Aidl.Local_include_dirs = module.deviceProperties.Aidl.Local_include_dirs
|
props.Aidl.Local_include_dirs = module.deviceProperties.Aidl.Local_include_dirs
|
||||||
|
|
||||||
if module.properties.Metalava_enabled == nil {
|
droiddocArgs := " --stub-packages " + strings.Join(module.properties.Api_packages, ":") +
|
||||||
module.properties.Metalava_enabled = proptools.BoolPtr(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
droiddocArgs := ""
|
|
||||||
if Bool(module.properties.Metalava_enabled) == true {
|
|
||||||
droiddocArgs = " --stub-packages " + strings.Join(module.properties.Api_packages, ":") +
|
|
||||||
" " + android.JoinWithPrefix(module.properties.Hidden_api_packages, " --hide-package ") +
|
" " + android.JoinWithPrefix(module.properties.Hidden_api_packages, " --hide-package ") +
|
||||||
" " + android.JoinWithPrefix(module.properties.Droiddoc_options, " ") +
|
" " + android.JoinWithPrefix(module.properties.Droiddoc_options, " ") +
|
||||||
" --hide MissingPermission --hide BroadcastBehavior " +
|
" --hide MissingPermission --hide BroadcastBehavior " +
|
||||||
"--hide HiddenSuperclass --hide DeprecationMismatch --hide UnavailableSymbol " +
|
"--hide HiddenSuperclass --hide DeprecationMismatch --hide UnavailableSymbol " +
|
||||||
"--hide SdkConstant --hide HiddenTypeParameter --hide Todo --hide Typo"
|
"--hide SdkConstant --hide HiddenTypeParameter --hide Todo --hide Typo"
|
||||||
} else {
|
|
||||||
droiddocProps.Custom_template = proptools.StringPtr("droiddoc-templates-sdk")
|
|
||||||
droiddocArgs = " -stubpackages " + strings.Join(module.properties.Api_packages, ":") +
|
|
||||||
" " + android.JoinWithPrefix(module.properties.Hidden_api_packages, " -hidePackage ") +
|
|
||||||
" " + android.JoinWithPrefix(module.properties.Droiddoc_options, " ") +
|
|
||||||
" -hide 110 -hide 111 -hide 113 -hide 121 -hide 125 -hide 126 -hide 127 -hide 128 -nodocs"
|
|
||||||
}
|
|
||||||
|
|
||||||
switch apiScope {
|
switch apiScope {
|
||||||
case apiScopeSystem:
|
case apiScopeSystem:
|
||||||
@@ -519,45 +498,11 @@ func (module *sdkLibrary) createDocs(mctx android.TopDownMutatorContext, apiScop
|
|||||||
module.latestApiFilegroupName(apiScope))
|
module.latestApiFilegroupName(apiScope))
|
||||||
props.Check_api.Last_released.Removed_api_file = proptools.StringPtr(
|
props.Check_api.Last_released.Removed_api_file = proptools.StringPtr(
|
||||||
module.latestRemovedApiFilegroupName(apiScope))
|
module.latestRemovedApiFilegroupName(apiScope))
|
||||||
if Bool(module.properties.Metalava_enabled) == false {
|
|
||||||
// any change is reported as error
|
|
||||||
props.Check_api.Current.Args = proptools.StringPtr("-error 2 -error 3 -error 4 -error 5 " +
|
|
||||||
"-error 6 -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 " +
|
|
||||||
"-error 14 -error 15 -error 16 -error 17 -error 18 -error 19 -error 20 " +
|
|
||||||
"-error 21 -error 23 -error 24 -error 25 -error 26 -error 27")
|
|
||||||
|
|
||||||
// backward incompatible changes are reported as error
|
|
||||||
props.Check_api.Last_released.Args = proptools.StringPtr("-hide 2 -hide 3 -hide 4 -hide 5 " +
|
|
||||||
"-hide 6 -hide 24 -hide 25 -hide 26 -hide 27 " +
|
|
||||||
"-error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 " +
|
|
||||||
"-error 15 -error 16 -error 17 -error 18")
|
|
||||||
|
|
||||||
// Include the part of the framework source. This is required for the case when
|
|
||||||
// API class is extending from the framework class. In that case, doclava needs
|
|
||||||
// to know whether the base class is hidden or not. Since that information is
|
|
||||||
// encoded as @hide string in the comment, we need source files for the classes,
|
|
||||||
// not the compiled ones.
|
|
||||||
props.Srcs_lib = proptools.StringPtr("framework")
|
|
||||||
props.Srcs_lib_whitelist_dirs = []string{"core/java"}
|
|
||||||
|
|
||||||
// Add android.annotation package to give access to the framework-defined
|
|
||||||
// annotations such as SystemApi, NonNull, etc.
|
|
||||||
if module.properties.Srcs_lib_whitelist_pkgs != nil {
|
|
||||||
props.Srcs_lib_whitelist_pkgs = module.properties.Srcs_lib_whitelist_pkgs
|
|
||||||
} else {
|
|
||||||
props.Srcs_lib_whitelist_pkgs = []string{"android.annotation"}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
props.Srcs_lib = module.properties.Srcs_lib
|
props.Srcs_lib = module.properties.Srcs_lib
|
||||||
props.Srcs_lib_whitelist_dirs = module.properties.Srcs_lib_whitelist_dirs
|
props.Srcs_lib_whitelist_dirs = module.properties.Srcs_lib_whitelist_dirs
|
||||||
props.Srcs_lib_whitelist_pkgs = module.properties.Srcs_lib_whitelist_pkgs
|
props.Srcs_lib_whitelist_pkgs = module.properties.Srcs_lib_whitelist_pkgs
|
||||||
}
|
|
||||||
|
|
||||||
if Bool(module.properties.Metalava_enabled) == true {
|
|
||||||
mctx.CreateModule(android.ModuleFactoryAdaptor(DroidstubsFactory), &props)
|
mctx.CreateModule(android.ModuleFactoryAdaptor(DroidstubsFactory), &props)
|
||||||
} else {
|
|
||||||
mctx.CreateModule(android.ModuleFactoryAdaptor(DroiddocFactory), &props, &droiddocProps)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Creates the runtime library. This is not directly linkable from other modules.
|
// Creates the runtime library. This is not directly linkable from other modules.
|
||||||
|
Reference in New Issue
Block a user