[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
|
projectPath.resolve("$it/src/main").allKotlinFiles
|
||||||
}
|
}
|
||||||
|
|
||||||
build("build") {
|
build("compileKotlinJs", "compileTestKotlinJs") {
|
||||||
checkIrCompilationMessage()
|
checkIrCompilationMessage()
|
||||||
assertOutputContains(USING_JS_INCREMENTAL_COMPILATION_MESSAGE)
|
assertOutputContains(USING_JS_INCREMENTAL_COMPILATION_MESSAGE)
|
||||||
if (irBackend) {
|
if (irBackend) {
|
||||||
@@ -278,7 +278,7 @@ class Kotlin2JsGradlePluginIT : AbstractKotlin2JsGradlePluginIT(false) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
build("build") {
|
build("compileKotlinJs", "compileTestKotlinJs") {
|
||||||
assertCompiledKotlinSources(emptyList(), output)
|
assertCompiledKotlinSources(emptyList(), output)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,7 +286,7 @@ class Kotlin2JsGradlePluginIT : AbstractKotlin2JsGradlePluginIT(false) {
|
|||||||
modifiedFile.modify {
|
modifiedFile.modify {
|
||||||
it.replace("val x = 0", "val x = \"a\"")
|
it.replace("val x = 0", "val x = \"a\"")
|
||||||
}
|
}
|
||||||
build("build") {
|
build("compileKotlinJs", "compileTestKotlinJs") {
|
||||||
checkIrCompilationMessage()
|
checkIrCompilationMessage()
|
||||||
assertOutputContains(USING_JS_INCREMENTAL_COMPILATION_MESSAGE)
|
assertOutputContains(USING_JS_INCREMENTAL_COMPILATION_MESSAGE)
|
||||||
val affectedFiles = listOf("A.kt", "useAInLibMain.kt", "useAInAppMain.kt", "useAInAppTest.kt").mapNotNull {
|
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)
|
val options = defaultBuildOptions.copy(jsOptions = jsOptions)
|
||||||
project("kotlin2JsICProject", gradleVersion, buildOptions = options) {
|
project("kotlin2JsICProject", gradleVersion, buildOptions = options) {
|
||||||
build("build") {
|
build("compileKotlinJs", "compileTestKotlinJs") {
|
||||||
checkIrCompilationMessage()
|
checkIrCompilationMessage()
|
||||||
assertOutputDoesNotContain(USING_JS_INCREMENTAL_COMPILATION_MESSAGE)
|
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 {
|
dependencies {
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
|
||||||
implementation project(":lib")
|
implementation project(":lib")
|
||||||
}
|
}
|
||||||
|
|
||||||
def isIrBackend = project.findProperty("kotlin.js.useIrBackend")?.toBoolean() ?: false
|
kotlin {
|
||||||
if (isIrBackend) {
|
js {
|
||||||
compileKotlin2Js.kotlinOptions.freeCompilerArgs += ["-Xir-produce-klib-dir", "-Xir-only"]
|
browser {
|
||||||
compileTestKotlin2Js.kotlinOptions.freeCompilerArgs += ["-Xir-produce-js"]
|
|
||||||
}
|
}
|
||||||
|
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 {
|
dependencies {
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
|
||||||
}
|
}
|
||||||
|
|
||||||
def isIrBackend = project.findProperty("kotlin.js.useIrBackend")?.toBoolean() ?: false
|
kotlin {
|
||||||
if (isIrBackend) {
|
js {
|
||||||
compileKotlin2Js.kotlinOptions.freeCompilerArgs += ["-Xir-produce-klib-dir", "-Xir-only"]
|
browser {
|
||||||
compileTestKotlin2Js.kotlinOptions.freeCompilerArgs += ["-Xir-produce-js"]
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user