[Gradle, JS] Add intregration test on browser pipeline with transitive dependencies
This commit is contained in:
+29
@@ -500,4 +500,33 @@ abstract class AbstractKotlin2JsGradlePluginIT(private val irBackend: Boolean) :
|
|||||||
assertSuccessful()
|
assertSuccessful()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun testBrowserDistribution() = with(Project("kotlin-js-browser-project", GradleVersionRequired.AtLeast("4.10.2"))) {
|
||||||
|
setupWorkingDir()
|
||||||
|
gradleBuildScript().modify(::transformBuildScriptWithPluginsDsl)
|
||||||
|
gradleSettingsScript().modify(::transformBuildScriptWithPluginsDsl)
|
||||||
|
|
||||||
|
build("build") {
|
||||||
|
assertSuccessful()
|
||||||
|
|
||||||
|
assertTasksExecuted(
|
||||||
|
":app:processDceKotlinJs",
|
||||||
|
":app:browserProductionWebpack"
|
||||||
|
)
|
||||||
|
|
||||||
|
assertFileExists("build/js/packages/kotlin-js-browser-base")
|
||||||
|
assertFileExists("build/js/packages/kotlin-js-browser-lib")
|
||||||
|
assertFileExists("build/js/packages/kotlin-js-browser-app")
|
||||||
|
assertFileExists("build/js/packages/kotlin-js-browser-app/kotlin-dce")
|
||||||
|
|
||||||
|
assertFileExists("build/js/packages/kotlin-js-browser-app/kotlin-dce/kotlin.js")
|
||||||
|
assertFileExists("build/js/packages/kotlin-js-browser-app/kotlin-dce/kotlin-js-browser-app.js")
|
||||||
|
assertFileExists("build/js/packages/kotlin-js-browser-app/kotlin-dce/kotlin-js-browser-lib.js")
|
||||||
|
assertFileExists("build/js/packages/kotlin-js-browser-app/kotlin-dce/kotlin-js-browser-base.js")
|
||||||
|
|
||||||
|
assertFileExists("app/build/distributions/app.js")
|
||||||
|
assertFileExists("app/build/distributions/app.js.map")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
plugins {
|
||||||
|
kotlin("js")
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation(kotlin("stdlib-js"))
|
||||||
|
implementation(project(":lib"))
|
||||||
|
}
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
target {
|
||||||
|
browser {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.example
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
println("Sheldon: ${sheldon()}")
|
||||||
|
}
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
plugins {
|
||||||
|
kotlin("js")
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation(kotlin("stdlib-js"))
|
||||||
|
}
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
target {
|
||||||
|
browser {
|
||||||
|
useCommonJs()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.example
|
||||||
|
|
||||||
|
fun best(): Int {
|
||||||
|
return 42
|
||||||
|
}
|
||||||
|
|
||||||
|
fun simpleBest(): Int {
|
||||||
|
return 73
|
||||||
|
}
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
plugins {
|
||||||
|
kotlin("js").version("<pluginMarkerVersion>")
|
||||||
|
}
|
||||||
|
|
||||||
|
group = "com.example"
|
||||||
|
version = "1.0"
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
jcenter()
|
||||||
|
}
|
||||||
|
}
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
plugins {
|
||||||
|
kotlin("js")
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation(kotlin("stdlib-js"))
|
||||||
|
implementation(project(":base"))
|
||||||
|
}
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
target {
|
||||||
|
browser {
|
||||||
|
useCommonJs()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.example
|
||||||
|
|
||||||
|
fun answer(): Int {
|
||||||
|
return best()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun sheldon(): Int {
|
||||||
|
return simpleBest()
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
gradlePluginPortal()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rootProject.name = "kotlin-js-browser"
|
||||||
|
|
||||||
|
include("base")
|
||||||
|
include("lib")
|
||||||
|
include("app")
|
||||||
Reference in New Issue
Block a user