Remove not-needed test task validation.

Now all test 'install' dependencies are added via centralized 'dependsOnKotlinGradlePluginInstall()' method.
This commit is contained in:
Yahor Berdnikau
2021-03-10 20:55:46 +01:00
committed by TeamCityServer
parent 3f953bcdfc
commit 590bab82e2
@@ -151,29 +151,6 @@ tasks.named<Task>("check") {
}
}
gradle.taskGraph.whenReady {
// Validate that all dependencies "install" tasks are added to "test" dependencies
// Test dependencies are specified as paths to avoid forcing dependency resolution
// and also to avoid specifying evaluationDependsOn for each testCompile dependency.
val notAddedTestTasks = hashSetOf<String>()
val test = tasks.getByName("test")
val testDependencies = test.dependsOn
for (dependency in configurations.getByName("testCompile").allDependencies) {
if (dependency !is ProjectDependency) continue
val task = dependency.dependencyProject.tasks.findByName("install")
if (task != null && !testDependencies.contains(task.path)) {
notAddedTestTasks.add("\"${task.path}\"")
}
}
if (!notAddedTestTasks.isEmpty()) {
throw GradleException("Add the following tasks to ${test.path} dependencies:\n ${notAddedTestTasks.joinToString(",\n ")}")
}
}
tasks.withType<KotlinCompile> {
kotlinOptions.jdkHome = rootProject.extra["JDK_18"] as String
kotlinOptions.jvmTarget = "1.8"
@@ -237,7 +214,3 @@ tasks.withType<Test> {
})
}
}
java {
withSourcesJar()
}