[Gradle, JS] Add test on integrated dukat task
This commit is contained in:
+55
@@ -69,6 +69,61 @@ class DukatIntegrationIT : BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testIntegratedDukatKotlinDslRootDependencies() {
|
||||
testIntegratedDukat(
|
||||
DslType.KOTLIN,
|
||||
DependenciesLocation.ROOT
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testIntegratedDukatKotlinDslExtDependencies() {
|
||||
testIntegratedDukat(
|
||||
DslType.KOTLIN,
|
||||
DependenciesLocation.EXTENSION
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testIntegratedDukatGroovyDslRootDependencies() {
|
||||
testIntegratedDukat(
|
||||
DslType.GROOVY,
|
||||
DependenciesLocation.ROOT
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testIntegratedDukatGroovyDslExtDependencies() {
|
||||
testIntegratedDukat(
|
||||
DslType.GROOVY,
|
||||
DependenciesLocation.EXTENSION
|
||||
)
|
||||
}
|
||||
|
||||
private fun testIntegratedDukat(
|
||||
dslType: DslType,
|
||||
dependenciesLocation: DependenciesLocation
|
||||
) {
|
||||
val projectName = "${dslType.value}-${dependenciesLocation.value}"
|
||||
val project = Project(
|
||||
projectName = projectName,
|
||||
directoryPrefix = "dukat-integration"
|
||||
)
|
||||
project.setupWorkingDir()
|
||||
project.gradleBuildScript().modify(::transformBuildScriptWithPluginsDsl)
|
||||
|
||||
val externalSrcs = "build/externals/$projectName/src"
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
|
||||
assertTrue {
|
||||
fileInWorkingDir(externalSrcs).listFiles()?.size == 1
|
||||
}
|
||||
assertFileExists("$externalSrcs/index.module_decamelize.kt")
|
||||
}
|
||||
}
|
||||
|
||||
private enum class DslType(
|
||||
val value: String
|
||||
) {
|
||||
|
||||
+2
-2
@@ -16,8 +16,8 @@ kotlin {
|
||||
main {
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-js")
|
||||
implementation(npm("left-pad", "1.3.0", false))
|
||||
implementation(npm("decamelize", "4.0.0"))
|
||||
implementation(npm("left-pad", "1.3.0"))
|
||||
implementation(npm("decamelize", "4.0.0", true))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -9,8 +9,8 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-js")
|
||||
implementation(npm("left-pad", "1.3.0", false))
|
||||
implementation(npm("decamelize", "4.0.0"))
|
||||
implementation(npm("left-pad", "1.3.0"))
|
||||
implementation(npm("decamelize", "4.0.0", true))
|
||||
}
|
||||
|
||||
kotlin {
|
||||
|
||||
+2
-2
@@ -16,8 +16,8 @@ kotlin {
|
||||
val main by getting {
|
||||
dependencies {
|
||||
implementation(kotlin("stdlib-js"))
|
||||
implementation(npm("left-pad", "1.3.0", false))
|
||||
implementation(npm("decamelize", "4.0.0"))
|
||||
implementation(npm("left-pad", "1.3.0"))
|
||||
implementation(npm("decamelize", "4.0.0", true))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -9,8 +9,8 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
implementation(kotlin("stdlib-js"))
|
||||
implementation(npm("left-pad", "1.3.0", false))
|
||||
implementation(npm("decamelize", "4.0.0"))
|
||||
implementation(npm("left-pad", "1.3.0"))
|
||||
implementation(npm("decamelize", "4.0.0", true))
|
||||
}
|
||||
|
||||
kotlin {
|
||||
|
||||
Reference in New Issue
Block a user