Merge "java_sdk_library: Allow no_dist to be explicitly set in .bp file" am: de6df73b44 am: fb873a3048 am: ee09b2228f

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1506238

Change-Id: I46eb5b4124005409d514bc8fb7c7db05ebc0df18
This commit is contained in:
Paul Duffin
2020-11-20 14:04:30 +00:00
committed by Automerger Merge Worker

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