[Gradle, JS] Add test on dukat with both mode
This commit is contained in:
+35
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.gradle
|
||||
|
||||
import org.jetbrains.kotlin.gradle.util.modify
|
||||
import org.junit.Test
|
||||
import kotlin.test.assertTrue
|
||||
|
||||
class DukatIntegrationIT : BaseGradleIT() {
|
||||
@Test
|
||||
@@ -242,6 +243,40 @@ class DukatIntegrationIT : BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testBothOnlyOnceGenerateDependencies() {
|
||||
val project = Project(
|
||||
projectName = "both",
|
||||
directoryPrefix = "dukat-integration"
|
||||
)
|
||||
project.setupWorkingDir()
|
||||
project.gradleBuildScript().modify(::transformBuildScriptWithPluginsDsl)
|
||||
|
||||
val externalSrcs = "build/externals/both-jsLegacy/src"
|
||||
project.build("compileKotlinJsIr") {
|
||||
assertSuccessful()
|
||||
assertTasksExecuted(":legacyGenerateExternalsIntegrated")
|
||||
|
||||
assertSingleFileExists(externalSrcs, "index.module_decamelize.kt")
|
||||
val irExternals = "build/externals/both-jsIr/src"
|
||||
val directoryFile = fileInWorkingDir(irExternals)
|
||||
assertTrue(
|
||||
!directoryFile.exists(),
|
||||
"[$irExternals] should not contain files"
|
||||
)
|
||||
}
|
||||
|
||||
project.build(
|
||||
"compileKotlinJsLegacy",
|
||||
"--rerun-tasks"
|
||||
) {
|
||||
assertSuccessful()
|
||||
assertTasksExecuted(":legacyGenerateExternalsIntegrated")
|
||||
|
||||
assertSingleFileExists(externalSrcs, "index.module_decamelize.kt")
|
||||
}
|
||||
}
|
||||
|
||||
private fun projectName(
|
||||
dslType: DslType,
|
||||
dependenciesLocation: DependenciesLocation
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
plugins {
|
||||
kotlin("js") version "<pluginMarkerVersion>"
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(kotlin("stdlib-js"))
|
||||
implementation(npm("decamelize", "4.0.0", true))
|
||||
}
|
||||
|
||||
kotlin {
|
||||
js(BOTH) {
|
||||
nodejs()
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user