Drop support for gradle 4.0
#KT-29275 Fixed
This commit is contained in:
+10
-13
@@ -73,20 +73,17 @@ object KotlinUsages {
|
||||
chooseCandidateByName(KOTLIN_RUNTIME)
|
||||
}
|
||||
|
||||
// The consumer value is available and can be used for disambiguation in Gradle 4.1+
|
||||
if (isGradleVersionAtLeast(4, 1)) {
|
||||
val javaRuntimeUsages = setOf(JAVA_RUNTIME_JARS, JAVA_RUNTIME)
|
||||
val javaRuntimeUsages = setOf(JAVA_RUNTIME_JARS, JAVA_RUNTIME)
|
||||
|
||||
if (JAVA_API in candidateNames &&
|
||||
javaRuntimeUsages.any { it in candidateNames } &&
|
||||
values.none { it in candidateNames }
|
||||
) {
|
||||
when (consumerValue?.name) {
|
||||
KOTLIN_API, JAVA_API ->
|
||||
chooseCandidateByName(JAVA_API)
|
||||
null, KOTLIN_RUNTIME, in javaRuntimeUsages ->
|
||||
chooseCandidateByName(javaRuntimeUsages.first { it in candidateNames })
|
||||
}
|
||||
if (JAVA_API in candidateNames &&
|
||||
javaRuntimeUsages.any { it in candidateNames } &&
|
||||
values.none { it in candidateNames }
|
||||
) {
|
||||
when (consumerValue?.name) {
|
||||
KOTLIN_API, JAVA_API ->
|
||||
chooseCandidateByName(JAVA_API)
|
||||
null, KOTLIN_RUNTIME, in javaRuntimeUsages ->
|
||||
chooseCandidateByName(javaRuntimeUsages.first { it in candidateNames })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-6
@@ -31,9 +31,6 @@ class ScriptingGradleSubplugin : Plugin<Project> {
|
||||
fun isEnabled(project: Project) = project.plugins.findPlugin(ScriptingGradleSubplugin::class.java) != null
|
||||
|
||||
fun configureForSourceSet(project: Project, sourceSetName: String) {
|
||||
|
||||
if (!org.jetbrains.kotlin.gradle.utils.isGradleVersionAtLeast(4, 0)) return
|
||||
|
||||
val discoveryConfiguration = project.configurations.maybeCreate(getDiscoveryClasspathConfigurationName(sourceSetName)).apply {
|
||||
isVisible = false
|
||||
isCanBeConsumed = false
|
||||
@@ -45,9 +42,6 @@ class ScriptingGradleSubplugin : Plugin<Project> {
|
||||
}
|
||||
|
||||
override fun apply(project: Project) {
|
||||
|
||||
if (!org.jetbrains.kotlin.gradle.utils.isGradleVersionAtLeast(4, 0)) return
|
||||
|
||||
project.afterEvaluate {
|
||||
|
||||
val javaPluginConvention = project.convention.findPlugin(JavaPluginConvention::class.java)
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ internal fun TaskInputs.dirCompatible(dirPath: Any) {
|
||||
inputsDirMethod(this, dirPath)
|
||||
}
|
||||
|
||||
internal fun checkGradleCompatibility(minSupportedVersion: GradleVersion = GradleVersion.version("4.0")) {
|
||||
internal fun checkGradleCompatibility(minSupportedVersion: GradleVersion = GradleVersion.version("4.1")) {
|
||||
val currentVersion = GradleVersion.current()
|
||||
if (currentVersion < minSupportedVersion) {
|
||||
throw GradleException(
|
||||
|
||||
Reference in New Issue
Block a user