diff --git a/java/sdk_library.go b/java/sdk_library.go index a2598224e..99ef7881a 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -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