[IDEA] Check assignable from task to KotlinTest class
This commit is contained in:
+22
-20
@@ -24,29 +24,31 @@ class KotlinNonJvmGutterConfigurator : AbstractProjectResolverExtension() {
|
|||||||
// ignore, class not available
|
// ignore, class not available
|
||||||
}
|
}
|
||||||
|
|
||||||
gradle.afterProject { project ->
|
if (kotlinTestClass != null) {
|
||||||
// Test task should have some parameters
|
gradle.afterProject { project ->
|
||||||
// Create dummy task to consume outputs by Test task
|
// Test task should have some parameters
|
||||||
project.tasks.create("nonJvmTestIdeSupportDummy")
|
// Create dummy task to consume outputs by Test task
|
||||||
|
project.tasks.create("nonJvmTestIdeSupportDummy")
|
||||||
// IDEA now process filter parameters only for Test tasks
|
|
||||||
project.tasks.create('nonJvmTestIdeSupport', Test) {
|
// IDEA now process filter parameters only for Test tasks
|
||||||
testClassesDirs = project.tasks["nonJvmTestIdeSupportDummy"].outputs.files
|
project.tasks.create('nonJvmTestIdeSupport', Test) {
|
||||||
classpath = project.tasks["nonJvmTestIdeSupportDummy"].outputs.files
|
testClassesDirs = project.tasks["nonJvmTestIdeSupportDummy"].outputs.files
|
||||||
}
|
classpath = project.tasks["nonJvmTestIdeSupportDummy"].outputs.files
|
||||||
|
}
|
||||||
project.afterEvaluate {
|
|
||||||
project.tasks.each { Task task ->
|
project.afterEvaluate {
|
||||||
if (kotlinTestClass != null) {
|
project.tasks.each { Task task ->
|
||||||
task.dependsOn('nonJvmTestIdeSupport')
|
if (kotlinTestClass.isAssignableFrom(task.class)) {
|
||||||
|
task.dependsOn('nonJvmTestIdeSupport')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
gradle.taskGraph.beforeTask { Task task ->
|
||||||
gradle.taskGraph.beforeTask { Task task ->
|
if (kotlinTestClass.isAssignableFrom(task.class)) {
|
||||||
if (kotlinTestClass != null) {
|
task.filter.includePatterns = task.project.tasks['nonJvmTestIdeSupport'].filter.includePatterns
|
||||||
task.filter.includePatterns = task.project.tasks['nonJvmTestIdeSupport'].filter.includePatterns
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user