[Gradle, JS] Add test with library mixed with executable and browser/nodejs

^KT-41566 fixed
This commit is contained in:
Ilya Goncharov
2020-08-31 18:05:01 +03:00
parent d238483054
commit 076045ce54
5 changed files with 56 additions and 0 deletions
@@ -45,4 +45,21 @@ class KotlinJsIrLibraryGradlePluginIT : BaseGradleIT() {
assertFileExists("build/productionLibrary/main.js")
}
}
@Test
fun testJsBinaryLibraryAndExecutableForBrowserAndNodejs() {
val project = Project("js-library-with-executable-browser-nodejs")
project.setupWorkingDir()
project.gradleBuildScript().modify(::transformBuildScriptWithPluginsDsl)
project.build("build") {
assertSuccessful()
assertFileExists("build/productionLibrary/js-library.js")
assertFileExists("build/productionLibrary/package.json")
assertFileExists("build/productionLibrary/main.js")
assertFileExists("build/distributions/js-library.js")
}
}
}
@@ -0,0 +1,20 @@
plugins {
kotlin("js") version "<pluginMarkerVersion>"
}
group = "com.example"
version = "1.0"
repositories {
mavenLocal()
jcenter()
}
kotlin {
js {
binaries.library()
binaries.executable()
nodejs()
browser()
}
}
@@ -0,0 +1,8 @@
pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
}
}
rootProject.name = "js-library"
@@ -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("Hello, Yarn")
}