[Gradle, JS] Add test with nested composite build
This commit is contained in:
committed by
Space Team
parent
e1b6f8198a
commit
b585d7c392
+33
-2
@@ -144,10 +144,10 @@ class Kotlin2JsIrGradlePluginIT : AbstractKotlin2JsGradlePluginIT(true) {
|
||||
?: error("Not found package $moduleName in $rootModulePath")
|
||||
|
||||
build("build") {
|
||||
val libDecamelizeVersion = moduleVersion("build/js/node_modules/lib2", "decamelize")
|
||||
val libDecamelizeVersion = moduleVersion("build/js/node_modules/lib-lib-2", "decamelize")
|
||||
assertEquals("1.1.1", libDecamelizeVersion)
|
||||
|
||||
val libAsyncVersion = moduleVersion("build/js/node_modules/lib2", "async")
|
||||
val libAsyncVersion = moduleVersion("build/js/node_modules/lib-lib-2", "async")
|
||||
assertEquals("2.6.2", libAsyncVersion)
|
||||
|
||||
val appNodeFetchVersion = moduleVersion("build/js/node_modules/js-composite-build", "node-fetch")
|
||||
@@ -156,6 +156,37 @@ class Kotlin2JsIrGradlePluginIT : AbstractKotlin2JsGradlePluginIT(true) {
|
||||
}
|
||||
}
|
||||
|
||||
@DisplayName("js composite build works with yarn.lock persistence")
|
||||
@GradleTest
|
||||
@GradleTestVersions(minVersion = G_7_6)
|
||||
fun testJsCompositeBuildWithUpgradeYarnLock(gradleVersion: GradleVersion) {
|
||||
project("js-composite-build", gradleVersion) {
|
||||
buildGradleKts.modify(::transformBuildScriptWithPluginsDsl)
|
||||
|
||||
subProject("lib").apply {
|
||||
buildGradleKts.modify(::transformBuildScriptWithPluginsDsl)
|
||||
}
|
||||
|
||||
subProject("base").apply {
|
||||
buildGradleKts.modify(::transformBuildScriptWithPluginsDsl)
|
||||
}
|
||||
|
||||
build("kotlinUpgradeYarnLock") {
|
||||
assertTasksExecuted(":base:publicPackageJson")
|
||||
assertTasksExecuted(":lib:lib-2:publicPackageJson")
|
||||
assertTasksExecuted(":kotlinNpmInstall")
|
||||
assertTasksExecuted(":kotlinUpgradeYarnLock")
|
||||
}
|
||||
|
||||
build(":nodeTest") {
|
||||
assertTasksUpToDate(":base:publicPackageJson")
|
||||
assertTasksUpToDate(":lib:lib-2:publicPackageJson")
|
||||
assertTasksUpToDate(":kotlinNpmInstall")
|
||||
assertTasksExecuted(":kotlinStoreYarnLock")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@GradleTest
|
||||
fun testJsIrIncrementalInParallel(gradleVersion: GradleVersion) {
|
||||
project("kotlin-js-browser-project", gradleVersion) {
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ rootProject.tasks
|
||||
|
||||
dependencies {
|
||||
implementation(kotlin("stdlib-js"))
|
||||
implementation("com.example:lib2")
|
||||
implementation("com.example:lib-2")
|
||||
implementation(npm("node-fetch", "3.2.8"))
|
||||
testImplementation(kotlin("test-js"))
|
||||
}
|
||||
+1
-32
@@ -1,39 +1,8 @@
|
||||
group = "com.example"
|
||||
|
||||
plugins {
|
||||
kotlin("js") version "<pluginMarkerVersion>"
|
||||
kotlin("js") version "<pluginMarkerVersion>" apply false
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
kotlin.js {
|
||||
nodejs()
|
||||
browser()
|
||||
}
|
||||
|
||||
tasks.named("browserTest") {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
rootProject.tasks
|
||||
.withType(org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask::class.java)
|
||||
.named("kotlinNpmInstall")
|
||||
.configure {
|
||||
args.addAll(
|
||||
listOf(
|
||||
"--network-concurrency",
|
||||
"1",
|
||||
"--mutex",
|
||||
"network"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(kotlin("stdlib-js"))
|
||||
implementation("com.example:base2")
|
||||
implementation(npm("async", "2.6.2"))
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
plugins {
|
||||
kotlin("js")
|
||||
}
|
||||
|
||||
group = "com.example"
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
kotlin.js {
|
||||
nodejs()
|
||||
browser()
|
||||
}
|
||||
|
||||
tasks.named("browserTest") {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
rootProject.tasks
|
||||
.withType(org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask::class.java)
|
||||
.named("kotlinNpmInstall")
|
||||
.configure {
|
||||
args.addAll(
|
||||
listOf(
|
||||
"--network-concurrency",
|
||||
"1",
|
||||
"--mutex",
|
||||
"network"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(kotlin("stdlib-js"))
|
||||
implementation("com.example:base2")
|
||||
implementation(npm("async", "2.6.2"))
|
||||
}
|
||||
+1
-2
@@ -13,5 +13,4 @@ pluginManagement {
|
||||
}
|
||||
|
||||
includeBuild("../base")
|
||||
|
||||
rootProject.name = "lib2"
|
||||
include("lib-2")
|
||||
Reference in New Issue
Block a user