fix: comparison between min_sdk_version
Added test demonstrates the error case. The bug was that java modules' ShouldSupportSdkVersion() converts min_sdk_version into effective version before comparison, which discards "preview" version into "future" version. That caused a weird case like rejecting with error "should support "S"" even when it is set to "S". Bug: n/a Test: m nothing Change-Id: Ieb53f0097b2969a8535778b1286dbfa0d4895ad4
This commit is contained in:
@@ -1416,12 +1416,8 @@ func (j *Import) ShouldSupportSdkVersion(ctx android.BaseModuleContext,
|
||||
if sdkSpec.Kind == android.SdkCore {
|
||||
return nil
|
||||
}
|
||||
ver, err := sdkSpec.EffectiveVersion(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if ver.GreaterThan(sdkVersion) {
|
||||
return fmt.Errorf("newer SDK(%v)", ver)
|
||||
if sdkSpec.ApiLevel.GreaterThan(sdkVersion) {
|
||||
return fmt.Errorf("newer SDK(%v)", sdkSpec.ApiLevel)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user