[Gradle, JS] Add test with library mixed with executable and browser/nodejs
^KT-41566 fixed
This commit is contained in:
+17
@@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
+20
@@ -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()
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "js-library"
|
||||
+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("Hello, Yarn")
|
||||
}
|
||||
Reference in New Issue
Block a user