Remove deprecated ConfigureUtil usages in KotlinAggregatingExecution
^KT-46019 In Progress
This commit is contained in:
+3
-7
@@ -5,8 +5,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.gradle.execution
|
package org.jetbrains.kotlin.gradle.execution
|
||||||
|
|
||||||
import groovy.lang.Closure
|
import org.gradle.api.Action
|
||||||
import org.gradle.util.ConfigureUtil
|
|
||||||
import org.jetbrains.kotlin.gradle.plugin.KotlinExecution
|
import org.jetbrains.kotlin.gradle.plugin.KotlinExecution
|
||||||
import org.jetbrains.kotlin.gradle.plugin.KotlinExecution.ExecutionSource
|
import org.jetbrains.kotlin.gradle.plugin.KotlinExecution.ExecutionSource
|
||||||
|
|
||||||
@@ -35,10 +34,7 @@ interface KotlinAggregatingExecution<
|
|||||||
*/
|
*/
|
||||||
fun getConfiguredExecutions(): Iterable<AggregatedExecutionType>
|
fun getConfiguredExecutions(): Iterable<AggregatedExecutionType>
|
||||||
|
|
||||||
fun configureAllExecutions(configureClosure: Closure<*>) = configureAllExecutions {
|
fun configureAllExecutions(configure: Action<AggregatedExecutionType>) = configureAllExecutions {
|
||||||
ConfigureUtil.configureSelf(
|
configure.execute(this)
|
||||||
configureClosure,
|
|
||||||
this
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-1
@@ -19,6 +19,7 @@ import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest
|
|||||||
import org.jetbrains.kotlin.gradle.testing.KotlinReportAggregatingTestRun
|
import org.jetbrains.kotlin.gradle.testing.KotlinReportAggregatingTestRun
|
||||||
import org.jetbrains.kotlin.gradle.testing.KotlinTaskTestRun
|
import org.jetbrains.kotlin.gradle.testing.KotlinTaskTestRun
|
||||||
import org.jetbrains.kotlin.gradle.testing.requireCompilationOfTarget
|
import org.jetbrains.kotlin.gradle.testing.requireCompilationOfTarget
|
||||||
|
import javax.inject.Inject
|
||||||
import kotlin.properties.Delegates
|
import kotlin.properties.Delegates
|
||||||
|
|
||||||
class JsCompilationExecutionSource(override val compilation: KotlinJsCompilation) :
|
class JsCompilationExecutionSource(override val compilation: KotlinJsCompilation) :
|
||||||
@@ -51,7 +52,7 @@ class JsAggregatingExecutionSource(private val aggregatingTestRun: KotlinJsRepor
|
|||||||
get() = aggregatingTestRun.getConfiguredExecutions().map { it.executionSource }
|
get() = aggregatingTestRun.getConfiguredExecutions().map { it.executionSource }
|
||||||
}
|
}
|
||||||
|
|
||||||
open class KotlinJsReportAggregatingTestRun(
|
abstract class KotlinJsReportAggregatingTestRun @Inject constructor(
|
||||||
testRunName: String,
|
testRunName: String,
|
||||||
override val target: KotlinJsSubTargetContainerDsl
|
override val target: KotlinJsSubTargetContainerDsl
|
||||||
) : KotlinReportAggregatingTestRun<JsCompilationExecutionSource, JsAggregatingExecutionSource, KotlinJsPlatformTestRun>(testRunName),
|
) : KotlinReportAggregatingTestRun<JsCompilationExecutionSource, JsAggregatingExecutionSource, KotlinJsPlatformTestRun>(testRunName),
|
||||||
|
|||||||
+5
-1
@@ -30,7 +30,11 @@ open class KotlinJsTargetConfigurator :
|
|||||||
name: String,
|
name: String,
|
||||||
target: KotlinJsTarget
|
target: KotlinJsTarget
|
||||||
): KotlinJsReportAggregatingTestRun {
|
): KotlinJsReportAggregatingTestRun {
|
||||||
val result = KotlinJsReportAggregatingTestRun(name, target)
|
val result = target.project.objects.newInstance(
|
||||||
|
KotlinJsReportAggregatingTestRun::class.java,
|
||||||
|
name,
|
||||||
|
target
|
||||||
|
)
|
||||||
|
|
||||||
val testTask = target.project.kotlinTestRegistry.getOrCreateAggregatedTestTask(
|
val testTask = target.project.kotlinTestRegistry.getOrCreateAggregatedTestTask(
|
||||||
name = result.testTaskName,
|
name = result.testTaskName,
|
||||||
|
|||||||
+5
-1
@@ -35,7 +35,11 @@ open class KotlinJsIrTargetConfigurator() :
|
|||||||
name: String,
|
name: String,
|
||||||
target: KotlinJsIrTarget
|
target: KotlinJsIrTarget
|
||||||
): KotlinJsReportAggregatingTestRun {
|
): KotlinJsReportAggregatingTestRun {
|
||||||
val result = KotlinJsReportAggregatingTestRun(name, target)
|
val result = target.project.objects.newInstance(
|
||||||
|
KotlinJsReportAggregatingTestRun::class.java,
|
||||||
|
name,
|
||||||
|
target
|
||||||
|
)
|
||||||
|
|
||||||
val testTask = target.project.kotlinTestRegistry.getOrCreateAggregatedTestTask(
|
val testTask = target.project.kotlinTestRegistry.getOrCreateAggregatedTestTask(
|
||||||
name = result.testTaskName,
|
name = result.testTaskName,
|
||||||
|
|||||||
-1
@@ -9,7 +9,6 @@ import groovy.lang.Closure
|
|||||||
import org.gradle.api.tasks.TaskProvider
|
import org.gradle.api.tasks.TaskProvider
|
||||||
import org.gradle.api.tasks.testing.AbstractTestTask
|
import org.gradle.api.tasks.testing.AbstractTestTask
|
||||||
import org.gradle.api.tasks.testing.TestFilter
|
import org.gradle.api.tasks.testing.TestFilter
|
||||||
import org.gradle.util.ConfigureUtil
|
|
||||||
import org.jetbrains.kotlin.gradle.execution.KotlinAggregateExecutionSource
|
import org.jetbrains.kotlin.gradle.execution.KotlinAggregateExecutionSource
|
||||||
import org.jetbrains.kotlin.gradle.execution.KotlinAggregatingExecution
|
import org.jetbrains.kotlin.gradle.execution.KotlinAggregatingExecution
|
||||||
import org.jetbrains.kotlin.gradle.plugin.*
|
import org.jetbrains.kotlin.gradle.plugin.*
|
||||||
|
|||||||
Reference in New Issue
Block a user