[Gradle, JS] Add browser to test js composite build
#KT-37954 fixed
This commit is contained in:
+5
@@ -11,6 +11,11 @@ repositories {
|
||||
kotlin.js {
|
||||
binaries.executable()
|
||||
nodejs()
|
||||
browser()
|
||||
}
|
||||
|
||||
tasks.named("browserTest") {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
rootProject.tasks
|
||||
|
||||
+8
-1
@@ -10,7 +10,14 @@ repositories {
|
||||
mavenLocal()
|
||||
}
|
||||
|
||||
kotlin.target.nodejs()
|
||||
kotlin.js {
|
||||
nodejs()
|
||||
browser()
|
||||
}
|
||||
|
||||
tasks.named("browserTest") {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
rootProject.tasks
|
||||
.withType(org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask::class.java)
|
||||
|
||||
+7
-8
@@ -59,7 +59,12 @@ constructor(
|
||||
it.description = "Run js on all configured platforms"
|
||||
}
|
||||
|
||||
private var testsConfigured: Boolean = false
|
||||
private val configureTestSideEffect: Unit by lazy {
|
||||
compilations.matching { it.name == KotlinCompilation.TEST_COMPILATION_NAME }
|
||||
.all { compilation ->
|
||||
compilation.binaries.executableIrInternal(compilation)
|
||||
}
|
||||
}
|
||||
|
||||
private val browserLazyDelegate = lazy {
|
||||
project.objects.newInstance(KotlinBrowserJsIr::class.java, this).also {
|
||||
@@ -105,13 +110,7 @@ constructor(
|
||||
}
|
||||
|
||||
private fun KotlinJsIrSubTarget.configureSubTarget() {
|
||||
compilations.matching { it.name == KotlinCompilation.TEST_COMPILATION_NAME }
|
||||
.all { compilation ->
|
||||
if (!testsConfigured) {
|
||||
testsConfigured = true
|
||||
compilation.binaries.executableIrInternal(compilation)
|
||||
}
|
||||
}
|
||||
configureTestSideEffect
|
||||
configure()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user