[Gradle, JS] Migrate simple K/JS IC test to the new plugin (#KT-52946)
This commit is contained in:
committed by
Space
parent
1e76404163
commit
d2450268f6
+4
-4
@@ -268,7 +268,7 @@ class Kotlin2JsGradlePluginIT : AbstractKotlin2JsGradlePluginIT(false) {
|
||||
projectPath.resolve("$it/src/main").allKotlinFiles
|
||||
}
|
||||
|
||||
build("build") {
|
||||
build("compileKotlinJs", "compileTestKotlinJs") {
|
||||
checkIrCompilationMessage()
|
||||
assertOutputContains(USING_JS_INCREMENTAL_COMPILATION_MESSAGE)
|
||||
if (irBackend) {
|
||||
@@ -278,7 +278,7 @@ class Kotlin2JsGradlePluginIT : AbstractKotlin2JsGradlePluginIT(false) {
|
||||
}
|
||||
}
|
||||
|
||||
build("build") {
|
||||
build("compileKotlinJs", "compileTestKotlinJs") {
|
||||
assertCompiledKotlinSources(emptyList(), output)
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ class Kotlin2JsGradlePluginIT : AbstractKotlin2JsGradlePluginIT(false) {
|
||||
modifiedFile.modify {
|
||||
it.replace("val x = 0", "val x = \"a\"")
|
||||
}
|
||||
build("build") {
|
||||
build("compileKotlinJs", "compileTestKotlinJs") {
|
||||
checkIrCompilationMessage()
|
||||
assertOutputContains(USING_JS_INCREMENTAL_COMPILATION_MESSAGE)
|
||||
val affectedFiles = listOf("A.kt", "useAInLibMain.kt", "useAInAppMain.kt", "useAInAppTest.kt").mapNotNull {
|
||||
@@ -742,7 +742,7 @@ abstract class AbstractKotlin2JsGradlePluginIT(protected val irBackend: Boolean)
|
||||
}
|
||||
val options = defaultBuildOptions.copy(jsOptions = jsOptions)
|
||||
project("kotlin2JsICProject", gradleVersion, buildOptions = options) {
|
||||
build("build") {
|
||||
build("compileKotlinJs", "compileTestKotlinJs") {
|
||||
checkIrCompilationMessage()
|
||||
assertOutputDoesNotContain(USING_JS_INCREMENTAL_COMPILATION_MESSAGE)
|
||||
}
|
||||
|
||||
+16
-6
@@ -1,12 +1,22 @@
|
||||
apply plugin: 'org.jetbrains.kotlin.platform.js'
|
||||
plugins {
|
||||
id("org.jetbrains.kotlin.js")
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
|
||||
implementation project(":lib")
|
||||
}
|
||||
|
||||
def isIrBackend = project.findProperty("kotlin.js.useIrBackend")?.toBoolean() ?: false
|
||||
if (isIrBackend) {
|
||||
compileKotlin2Js.kotlinOptions.freeCompilerArgs += ["-Xir-produce-klib-dir", "-Xir-only"]
|
||||
compileTestKotlin2Js.kotlinOptions.freeCompilerArgs += ["-Xir-produce-js"]
|
||||
}
|
||||
kotlin {
|
||||
js {
|
||||
browser {
|
||||
|
||||
}
|
||||
binaries.executable()
|
||||
}
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
+15
-6
@@ -1,11 +1,20 @@
|
||||
apply plugin: 'org.jetbrains.kotlin.platform.js'
|
||||
plugins {
|
||||
id("org.jetbrains.kotlin.js")
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
|
||||
}
|
||||
|
||||
def isIrBackend = project.findProperty("kotlin.js.useIrBackend")?.toBoolean() ?: false
|
||||
if (isIrBackend) {
|
||||
compileKotlin2Js.kotlinOptions.freeCompilerArgs += ["-Xir-produce-klib-dir", "-Xir-only"]
|
||||
compileTestKotlin2Js.kotlinOptions.freeCompilerArgs += ["-Xir-produce-js"]
|
||||
}
|
||||
kotlin {
|
||||
js {
|
||||
browser {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user