Merge "Convert requested SDK version if preview API level" into main am: 12a1f9182d
am: 11bc03a14f
am: 0af5b13bad
am: 58b8b022ff
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2663339 Change-Id: I5bfaa9291de423ab341c2871d70531394e744c9b Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
10
cc/cc.go
10
cc/cc.go
@@ -2950,20 +2950,20 @@ func checkLinkType(ctx android.BaseModuleContext, from LinkableInterface, to Lin
|
||||
ctx.ModuleErrorf("links %q built against newer API version %q",
|
||||
ctx.OtherModuleName(to.Module()), "current")
|
||||
} else {
|
||||
fromApi, err := strconv.Atoi(from.SdkVersion())
|
||||
fromApi, err := android.ApiLevelFromUserWithConfig(ctx.Config(), from.SdkVersion())
|
||||
if err != nil {
|
||||
ctx.PropertyErrorf("sdk_version",
|
||||
"Invalid sdk_version value (must be int or current): %q",
|
||||
"Invalid sdk_version value (must be int, preview or current): %q",
|
||||
from.SdkVersion())
|
||||
}
|
||||
toApi, err := strconv.Atoi(to.SdkVersion())
|
||||
toApi, err := android.ApiLevelFromUserWithConfig(ctx.Config(), to.SdkVersion())
|
||||
if err != nil {
|
||||
ctx.PropertyErrorf("sdk_version",
|
||||
"Invalid sdk_version value (must be int or current): %q",
|
||||
"Invalid sdk_version value (must be int, preview or current): %q",
|
||||
to.SdkVersion())
|
||||
}
|
||||
|
||||
if toApi > fromApi {
|
||||
if toApi.GreaterThan(fromApi) {
|
||||
ctx.ModuleErrorf("links %q built against newer API version %q",
|
||||
ctx.OtherModuleName(to.Module()), to.SdkVersion())
|
||||
}
|
||||
|
Reference in New Issue
Block a user