Merge "Don't create version variants for SDK variants"

This commit is contained in:
Treehugger Robot 2020-06-17 04:19:04 +00:00 committed by Gerrit Code Review
commit 6116ffdcf5
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
}