Merge "Use sdkSpec to compare sdk_versions of APK/JNI"
This commit is contained in:
@@ -445,8 +445,11 @@ func (a *AndroidApp) checkJniLibsSdkVersion(ctx android.ModuleContext, minSdkVer
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
dep, _ := m.(*cc.Module)
|
dep, _ := m.(*cc.Module)
|
||||||
jniSdkVersion, err := android.ApiStrToNum(ctx, dep.SdkVersion())
|
// The domain of cc.sdk_version is "current" and <number>
|
||||||
if err != nil || int(minSdkVersion) < jniSdkVersion {
|
// We can rely on sdkSpec to convert it to <number> so that "current" is handled
|
||||||
|
// properly regardless of sdk finalization.
|
||||||
|
jniSdkVersion, err := sdkSpecFrom(dep.SdkVersion()).effectiveVersion(ctx)
|
||||||
|
if err != nil || minSdkVersion < jniSdkVersion {
|
||||||
ctx.OtherModuleErrorf(dep, "sdk_version(%v) is higher than min_sdk_version(%v) of the containing android_app(%v)",
|
ctx.OtherModuleErrorf(dep, "sdk_version(%v) is higher than min_sdk_version(%v) of the containing android_app(%v)",
|
||||||
dep.SdkVersion(), minSdkVersion, ctx.ModuleName())
|
dep.SdkVersion(), minSdkVersion, ctx.ModuleName())
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user