[K/JS] Remove the ability to run Legacy JS backend from the Gradle Plugin

This commit is contained in:
Artem Kobzar
2023-03-28 12:47:04 +00:00
committed by Space Team
parent ae32eff543
commit c6e4858bc9
53 changed files with 239 additions and 43 deletions
+2 -1
View File
@@ -18,6 +18,7 @@ compileKotlin2Js {
"-Xallow-kotlin-package",
"-opt-in=kotlin.contracts.ExperimentalContracts",
"-opt-in=kotlin.RequiresOptIn",
"-Xforce-deprecated-legacy-compiler-usage"
]
kotlinOptions {
moduleKind = "umd"
@@ -29,10 +30,10 @@ compileKotlin2Js {
}
compileTestKotlin2Js {
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package"]
kotlinOptions {
metaInfo = false
moduleKind = "umd"
freeCompilerArgs = ["-Xallow-kotlin-package", "-Xforce-deprecated-legacy-compiler-usage"]
}
}
+4 -1
View File
@@ -28,7 +28,10 @@ buildDir = "$projectDir/build"
["compileKotlin2Js", "compileTestKotlin2Js"].forEach {
tasks.named(it).configure {
kotlinOptions.moduleKind = "commonjs"
kotlinOptions {
moduleKind = "commonjs"
freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
}
}
+5
View File
@@ -135,6 +135,7 @@ compileKotlin2Js {
"-opt-in=kotlin.ExperimentalMultiplatform",
"-opt-in=kotlin.contracts.ExperimentalContracts",
"-XXLanguage:+RangeUntilOperator",
"-Xforce-deprecated-legacy-compiler-usage"
]
}
}
@@ -364,3 +365,7 @@ task runMocha(type: NodeTask, dependsOn: [testClasses, installMocha, ':kotlin-te
}
test.dependsOn runMocha
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile) {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -492,6 +492,7 @@ class Kotlin2JsGradlePluginIT : AbstractKotlin2JsGradlePluginIT(false) {
|afterEvaluate {
| tasks.named('compileKotlinJs') {
| kotlinOptions.outputFile = "${'$'}{project.projectDir}/out/out.js"
| kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
| }
|}
|
@@ -25,4 +25,8 @@ kotlin {
}
}
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile> {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -32,4 +32,8 @@ kotlin {
}
}
}
}
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile) {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -40,4 +40,8 @@ publishing {
repositories {
maven { setUrl("file://${projectDir.absolutePath.replace('\\', '/')}/repo") }
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile> {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -53,4 +53,8 @@ publishing {
repositories {
maven { url "file://${projectDir.absolutePath.replace('\\', '/')}/repo" }
}
}
}
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile) {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -28,3 +28,7 @@ if (project.findProperty("mppProjectDependency") == "true") {
}
}
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile) {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -39,4 +39,8 @@ publishing {
repositories {
maven { setUrl("${rootProject.buildDir}/repo") }
}
}
}
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile) {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -57,4 +57,8 @@ kotlin {
}
}
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile> {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -87,3 +87,7 @@ kotlin {
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile> {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -93,4 +93,8 @@ publishing {
repositories {
maven("<localRepo>")
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile> {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -105,4 +105,8 @@ publishing {
repositories {
maven("<localRepo>")
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile> {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -54,4 +54,8 @@ publishing {
repositories {
maven("<localRepo>")
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile> {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -41,3 +41,7 @@ kotlin {
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile> {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -27,3 +27,7 @@ kotlin {
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile> {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -35,4 +35,8 @@ publishing {
repositories {
maven("<localRepo>")
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile> {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -37,4 +37,8 @@ publishing {
from(components["kotlin"])
}
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile> {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -26,6 +26,8 @@ tasks.named("compileKotlinJs", Kotlin2JsCompile) {
it.kotlinOptions.outputFile = "${buildDir}/kotlin2js/main/module.js"
if (jsUseIrBackend) {
it.kotlinOptions.freeCompilerArgs += ["-Xir-produce-klib-dir", "-Xir-only"]
} else {
it.kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
}
@@ -33,5 +35,7 @@ tasks.named("compileTestKotlinJs", Kotlin2JsCompile) {
it.kotlinOptions.outputFile = "${buildDir}/kotlin2js/test/module-tests.js"
if (jsUseIrBackend) {
it.kotlinOptions.freeCompilerArgs += ["-Xir-produce-js"]
} else {
it.kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
}
@@ -33,4 +33,7 @@ tasks.named("browserTest") {
tasks.withType<org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpack> {
dependsOn("foo")
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile> {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -16,4 +16,8 @@ kotlin {
nodejs {
}
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile> {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -67,4 +67,11 @@ rootProject.plugins.withType<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJ
workingDir = File("${buildDir}").resolve("distributions")
args("./${project.name}.js")
}
}
}
tasks.named<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile>("compileKotlinJs") {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
tasks.named<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile>("compileTestKotlinJs") {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -17,4 +17,11 @@ kotlin {
browser {
}
}
}
}
tasks.named<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile>("compileKotlinJsLegacy") {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
tasks.named<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile>("compileTestKotlinJsLegacy") {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -13,4 +13,11 @@ kotlin {
browser {
}
}
}
}
tasks.named<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile>("compileKotlinJs") {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
tasks.named<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile>("compileTestKotlinJs") {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -28,3 +28,6 @@ kotlin {
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile> {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -35,4 +35,7 @@ kotlin {
}
}
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile> {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -24,4 +24,8 @@ kotlin {
}
}
}
}
}
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile) {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -19,4 +19,11 @@ kotlin {
nodejs {
}
}
}
}
tasks.named("compileKotlinJs", org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile) {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
tasks.named("compileTestKotlinJs", org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile) {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -56,4 +56,8 @@ publishing {
repositories {
maven("$buildDir/repo")
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile> {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -64,4 +64,8 @@ kotlin {
}
}
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile> {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -19,4 +19,8 @@ kotlin {
}
binaries.executable()
}
}
}
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile) {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -17,4 +17,8 @@ kotlin {
}
}
}
}
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile) {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -25,4 +25,8 @@ kotlin {
}
}
}
}
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile) {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -61,4 +61,8 @@ build.doLast {
}
}
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile) {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
runRhino.dependsOn build
@@ -35,6 +35,10 @@ project("lib") {
browser()
}
}
tasks.withType<KotlinJsCompile>() {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
}
project("app") {
@@ -49,6 +53,9 @@ project("app") {
}
tasks.withType<KotlinJsCompile>() {
kotlinOptions.sourceMap = true
kotlinOptions {
sourceMap = true
freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
}
}
@@ -36,4 +36,6 @@ if (project.findProperty("kotlin.js.useIrBackend")?.toBoolean() == true) {
compileKotlin2Js.kotlinOptions.outputFile = "${buildDir}/kotlin2js/main/"
} else {
compileKotlin2Js.kotlinOptions.outputFile = "${buildDir}/kotlin2js/main/module.js"
compileKotlin2Js.kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
compileTestKotlin2Js.kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -43,3 +43,7 @@ publishing {
maven { setUrl("${rootProject.buildDir}/repo") }
}
}
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile) {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -39,4 +39,8 @@ publishing {
repositories {
maven { setUrl("${rootProject.buildDir}/repo") }
}
}
}
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile) {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -75,3 +75,7 @@ task printCompilerPluginOptions {
}
}
}
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile) {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -93,3 +93,7 @@ publishing {
}
}
}
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile) {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -33,3 +33,8 @@ nodeJsJar {
}
nodeJsJar.dependsOn(compileKotlinNodeJs)
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile) {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -42,6 +42,10 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinJsDce).configureEach {
destinationDirectory = project.layout.buildDirectory.dir("kotlin-js-min")
}
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile) {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
task runRhino(type: JavaExec) {
dependsOn(tasks.named('processDceBrowserKotlinJs'))
classpath = kotlin.targets.browser.compilations.main.runtimeDependencyFiles
@@ -23,4 +23,8 @@ kotlin {
js("server")
js("client")
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile> {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -92,3 +92,7 @@ task resolveRuntimeDependencies(type: DefaultTask) {
configurations[configName].resolve()
}
}
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile) {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -64,4 +64,8 @@ afterEvaluate {
tasks["assemble"].dependsOn(compileKotlinTask)
}
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile> {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -120,4 +120,8 @@ afterEvaluate {
assemble.dependsOn compileKotlinTask
}
}
}
}
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile) {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -36,4 +36,8 @@ kotlin.sourceSets {
kotlin.target {
nodejs()
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile> {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -15,4 +15,8 @@ kotlin {
binaries.executable()
nodejs()
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile> {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -24,3 +24,7 @@ kotlin {
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile> {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}
@@ -274,10 +274,6 @@ abstract class Kotlin2JsCompile @Inject constructor(
args.friendModules = friendDependencies.files.joinToString(File.pathSeparator) { it.absolutePath }
if (!isIrBackendEnabled()) {
args.forceDeprecatedLegacyCompilerUsage = true
}
logger.kotlinDebug("compiling with args ${ArgumentUtils.convertArgumentsToStringList(args)}")
val gradlePrintingMessageCollector = GradlePrintingMessageCollector(logger, args.allWarningsAsErrors)
@@ -2,4 +2,4 @@ kotlin.build.gradlePlugin.version=0.0.39
kotlin.options.suppressFreeCompilerArgsModificationWarning=true
cacheRedirectorEnabled=true
# Should be in sync with ":kotlin-daemon-config" project convention script configuration
kotlin.daemon.jvmargs=-Xmx3g -Dkotlin.js.compiler.legacy.force_enabled=true
kotlin.daemon.jvmargs=-Xmx3g
@@ -5,12 +5,7 @@ gradle.afterProject {
plugins.withType<KotlinBasePlugin> {
tasks.withType<CompileUsingKotlinDaemon>().configureEach {
// Should be in sync with 'gradle-settings-conventions/gradle.properties'
kotlinDaemonJvmArguments.set(
listOf(
"-Xmx3g",
"-Dkotlin.js.compiler.legacy.force_enabled=true"
)
)
kotlinDaemonJvmArguments.set(listOf("-Xmx3g"))
}
}
}