Merge "Don't create version variants for SDK variants" am: 6116ffdcf5 am: 974d8be0ac

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

Change-Id: I0f31d72d4f0a1792121000c653c67da0183217be
This commit is contained in:
Treehugger Robot 2020-06-17 04:32:51 +00:00 committed by Automerger Merge Worker
commit ced8c64073
4 changed files with 11 additions and 1 deletions

View file

@ -3209,6 +3209,10 @@ func (c *Module) SetImageVariation(ctx android.BaseModuleContext, variant string
}
}
func (c *Module) IsSdkVariant() bool {
return c.Properties.IsSdkVariant
}
func getCurrentNdkPrebuiltVersion(ctx DepsContext) string {
if ctx.Config().PlatformSdkVersionInt() > config.NdkMaxPrebuiltVersionInt {
return strconv.Itoa(config.NdkMaxPrebuiltVersionInt)

View file

@ -1580,7 +1580,8 @@ func VersionVariantAvailable(module interface {
// (which is unnamed) and zero or more stubs variants.
func VersionMutator(mctx android.BottomUpMutatorContext) {
if library, ok := mctx.Module().(LinkableInterface); ok && VersionVariantAvailable(library) {
if library.CcLibrary() && library.BuildSharedVariant() && len(library.StubsVersions()) > 0 {
if library.CcLibrary() && library.BuildSharedVariant() && len(library.StubsVersions()) > 0 &&
!library.IsSdkVariant() {
versions := library.StubsVersions()
normalizeVersions(mctx, versions)
if mctx.Failed() {

View file

@ -56,6 +56,7 @@ type LinkableInterface interface {
SdkVersion() string
AlwaysSdk() bool
IsSdkVariant() bool
ToolchainLibrary() bool
NdkPrebuiltStl() bool

View file

@ -196,6 +196,10 @@ func (mod *Module) AlwaysSdk() bool {
return false
}
func (mod *Module) IsSdkVariant() bool {
return false
}
func (mod *Module) ToolchainLibrary() bool {
return false
}