[Gradle, JS] Add test with dynamic webpack.config.d
This commit is contained in:
committed by
teamcityserver
parent
01c14a709a
commit
157046153f
+16
@@ -830,4 +830,20 @@ abstract class AbstractKotlin2JsGradlePluginIT(val irBackend: Boolean) : BaseGra
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testDynamicWebpackConfigD() {
|
||||
with(Project("js-dynamic-webpack-config-d")) {
|
||||
setupWorkingDir()
|
||||
gradleBuildScript().modify(::transformBuildScriptWithPluginsDsl)
|
||||
|
||||
build(
|
||||
"build"
|
||||
) {
|
||||
assertSuccessful()
|
||||
assertFileExists("build/js/packages/js-dynamic-webpack-config-d")
|
||||
assertFileContains("build/js/packages/js-dynamic-webpack-config-d/webpack.config.js", "// hello from patch.js")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
plugins {
|
||||
kotlin("js") version "<pluginMarkerVersion>"
|
||||
}
|
||||
|
||||
group = "com.example"
|
||||
version = "1.0"
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
kotlin {
|
||||
js {
|
||||
binaries.executable()
|
||||
browser()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("foo") {
|
||||
doLast {
|
||||
val dir = projectDir.resolve("webpack.config.d")
|
||||
dir.mkdirs()
|
||||
val file = dir.resolve("patch.js")
|
||||
file.createNewFile()
|
||||
file.writeText("// hello from patch.js")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.named("browserTest") {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpack> {
|
||||
dependsOn("foo")
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "js-dynamic-webpack-config-d"
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package com.example
|
||||
|
||||
fun main() {
|
||||
println("Hello, Webpack")
|
||||
}
|
||||
Reference in New Issue
Block a user