Sanitize compiler version for version requirement checks
Strip everything after (and including) the first '-' character. The previous approach of skipping the checks if "SNAPSHOT" is in the version, is subsumed by the new one because "1.2-SNAPSHOT" now becomes "1.2" with regards to the version requirement checks, which allows the compiler to use the 1.2-only API
This commit is contained in:
@@ -345,7 +345,7 @@ class DeprecationResolver(
|
||||
ProtoBuf.VersionRequirement.VersionKind.API_VERSION ->
|
||||
languageVersionSettings.apiVersion.version
|
||||
ProtoBuf.VersionRequirement.VersionKind.COMPILER_VERSION ->
|
||||
KotlinCompilerVersion.getVersion()?.takeIf { "SNAPSHOT" !in it }?.let(::createVersion)
|
||||
KotlinCompilerVersion.getVersion()?.substringBefore('-')?.let(::createVersion)
|
||||
else -> null
|
||||
}
|
||||
if (currentVersion != null && currentVersion < requiredVersion) {
|
||||
|
||||
Reference in New Issue
Block a user