Merge "java_sdk_library: Allow no_dist to be explicitly set in .bp file"

This commit is contained in:
Paul Duffin 2020-11-20 12:47:43 +00:00 committed by Gerrit Code Review
commit de6df73b44

View file

@ -435,8 +435,8 @@ type sdkLibraryProperties struct {
// If set to true, the path of dist files is apistubs/core. Defaults to false.
Core_lib *bool
// don't create dist rules.
No_dist *bool `blueprint:"mutated"`
// If set to true then don't create dist rules.
No_dist *bool
// indicates whether system and test apis should be generated.
Generate_system_and_test_apis bool `blueprint:"mutated"`
@ -1509,12 +1509,16 @@ func (module *SdkLibrary) CreateInternalModules(mctx android.DefaultableHookCont
}
// If this builds against standard libraries (i.e. is not part of the core libraries)
// then assume it provides both system and test apis. Otherwise, assume it does not and
// also assume it does not contribute to the dist build.
// then assume it provides both system and test apis.
sdkDep := decodeSdkDep(mctx, sdkContext(&module.Library))
hasSystemAndTestApis := sdkDep.hasStandardLibs()
module.sdkLibraryProperties.Generate_system_and_test_apis = hasSystemAndTestApis
module.sdkLibraryProperties.No_dist = proptools.BoolPtr(!hasSystemAndTestApis)
// Unless explicitly specified assume that any module that does not provide system
// and test APIs should not contribute to the dist build.
if module.sdkLibraryProperties.No_dist == nil {
module.sdkLibraryProperties.No_dist = proptools.BoolPtr(!hasSystemAndTestApis)
}
missing_current_api := false