[JS] Get rid of outputFile in compiler args (KT-61116)

^KT-56753 fixed
This commit is contained in:
Ilya Goncharov
2023-11-08 14:30:58 +01:00
committed by Space Team
parent 9fcf6c5f89
commit 2340d59f40
27 changed files with 23 additions and 645 deletions
@@ -1,4 +1,4 @@
@file:Suppress("unused", "DuplicatedCode")
@file:Suppress("unused", "DuplicatedCode", "DEPRECATION")
// DO NOT EDIT MANUALLY!
// Generated by generators/tests/org/jetbrains/kotlin/generators/arguments/GenerateCompilerArgumentsCopy.kt
@@ -1,4 +1,4 @@
@file:Suppress("unused", "DuplicatedCode")
@file:Suppress("unused", "DuplicatedCode", "DEPRECATION")
// DO NOT EDIT MANUALLY!
// Generated by generators/tests/org/jetbrains/kotlin/generators/arguments/GenerateCompilerArgumentsCopy.kt
@@ -1,4 +1,4 @@
@file:Suppress("unused", "DuplicatedCode")
@file:Suppress("unused", "DuplicatedCode", "DEPRECATION")
// DO NOT EDIT MANUALLY!
// Generated by generators/tests/org/jetbrains/kotlin/generators/arguments/GenerateCompilerArgumentsCopy.kt
@@ -15,7 +15,6 @@ fun copyK2JSCompilerArguments(from: K2JSCompilerArguments, to: K2JSCompilerArgum
to.errorTolerancePolicy = from.errorTolerancePolicy
to.extensionFunctionsInExternals = from.extensionFunctionsInExternals
to.fakeOverrideValidator = from.fakeOverrideValidator
to.forceDeprecatedLegacyCompilerUsage = from.forceDeprecatedLegacyCompilerUsage
to.friendModules = from.friendModules
to.friendModulesDisabled = from.friendModulesDisabled
to.generateDts = from.generateDts
@@ -46,15 +45,11 @@ fun copyK2JSCompilerArguments(from: K2JSCompilerArguments, to: K2JSCompilerArgum
to.libraries = from.libraries
to.main = from.main
to.metaInfo = from.metaInfo
to.metadataOnly = from.metadataOnly
to.moduleKind = from.moduleKind
to.moduleName = from.moduleName
to.noStdlib = from.noStdlib
to.optimizeGeneratedJs = from.optimizeGeneratedJs
to.outputDir = from.outputDir
to.outputFile = from.outputFile
to.outputPostfix = from.outputPostfix
to.outputPrefix = from.outputPrefix
to.partialLinkageLogLevel = from.partialLinkageLogLevel
to.partialLinkageMode = from.partialLinkageMode
to.platformArgumentsProviderJsExpression = from.platformArgumentsProviderJsExpression
@@ -1,4 +1,4 @@
@file:Suppress("unused", "DuplicatedCode")
@file:Suppress("unused", "DuplicatedCode", "DEPRECATION")
// DO NOT EDIT MANUALLY!
// Generated by generators/tests/org/jetbrains/kotlin/generators/arguments/GenerateCompilerArgumentsCopy.kt
@@ -1,4 +1,4 @@
@file:Suppress("unused", "DuplicatedCode")
@file:Suppress("unused", "DuplicatedCode", "DEPRECATION")
// DO NOT EDIT MANUALLY!
// Generated by generators/tests/org/jetbrains/kotlin/generators/arguments/GenerateCompilerArgumentsCopy.kt
@@ -1,4 +1,4 @@
@file:Suppress("unused", "DuplicatedCode")
@file:Suppress("unused", "DuplicatedCode", "DEPRECATION")
// DO NOT EDIT MANUALLY!
// Generated by generators/tests/org/jetbrains/kotlin/generators/arguments/GenerateCompilerArgumentsCopy.kt
@@ -1,4 +1,4 @@
@file:Suppress("unused", "DuplicatedCode")
@file:Suppress("unused", "DuplicatedCode", "DEPRECATION")
// DO NOT EDIT MANUALLY!
// Generated by generators/tests/org/jetbrains/kotlin/generators/arguments/GenerateCompilerArgumentsCopy.kt
@@ -16,16 +16,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
@JvmStatic private val serialVersionUID = 0L
}
@GradleOption(
value = DefaultValue.STRING_NULL_DEFAULT,
gradleInputType = GradleInputTypes.INTERNAL, // handled by task 'outputFileProperty'
shouldGenerateDeprecatedKotlinOptions = true,
)
@GradleDeprecatedOption(
message = "Only for legacy backend. For IR backend please use task.destinationDirectory and moduleName",
level = DeprecationLevel.WARNING,
removeAfter = "1.9.0"
)
@Deprecated("It is senseless to use with IR compiler. Only for compatibility.")
@Argument(value = "-output", valueDescription = "<filepath>", description = "Destination *.js file for the compilation result.")
var outputFile: String? = null
set(value) {
@@ -52,18 +43,6 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
field = if (value.isNullOrEmpty()) null else value
}
@GradleOption(
value = DefaultValue.BOOLEAN_TRUE_DEFAULT,
gradleInputType = GradleInputTypes.INPUT,
shouldGenerateDeprecatedKotlinOptions = true,
)
@Argument(value = "-no-stdlib", description = "Don't automatically include the default Kotlin/JS stdlib in compilation dependencies.")
var noStdlib = false
set(value) {
checkFrozen()
field = value
}
@Argument(
value = "-libraries",
valueDescription = "<path>",
@@ -147,11 +126,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
field = if (value.isNullOrEmpty()) null else value
}
@GradleOption(
value = DefaultValue.BOOLEAN_TRUE_DEFAULT,
gradleInputType = GradleInputTypes.INPUT,
shouldGenerateDeprecatedKotlinOptions = true,
)
@Deprecated("It is senseless to use with IR compiler. Only for compatibility.")
@Argument(value = "-meta-info", description = "Generate .meta.js and .kjsm files with metadata. Use this to create a library.")
var metaInfo = false
set(value) {
@@ -214,28 +189,6 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
field = if (value.isNullOrEmpty()) null else value
}
@Argument(
value = "-output-prefix",
valueDescription = "<path>",
description = "Add the content of the specified file to the beginning of the output file."
)
var outputPrefix: String? = null
set(value) {
checkFrozen()
field = if (value.isNullOrEmpty()) null else value
}
@Argument(
value = "-output-postfix",
valueDescription = "<path>",
description = "Add the content of the specified file to the end of the output file."
)
var outputPostfix: String? = null
set(value) {
checkFrozen()
field = if (value.isNullOrEmpty()) null else value
}
// Advanced options
@Argument(
@@ -559,13 +512,6 @@ In combination with '-meta-info', this generates both IR and pre-IR versions of
field = value
}
@Argument(value = "-Xmetadata-only", description = "Generate .meta.js and .kjsm files only.")
var metadataOnly = false
set(value) {
checkFrozen()
field = value
}
@Argument(value = "-Xenable-js-scripting", description = "Enable experimental support for .kts files using K/JS (with '-Xir' only).")
var enableJsScripting = false
set(value) {
@@ -660,16 +606,6 @@ In combination with '-meta-info', this generates both IR and pre-IR versions of
field = value
}
@Argument(
value = "-Xforce-deprecated-legacy-compiler-usage",
description = "This flag is used only for our inner infrastructure. It will soon be removed, so it's no longer safe to use."
)
var forceDeprecatedLegacyCompilerUsage = false
set(value) {
checkFrozen()
field = value
}
@Argument(
value = "-Xoptimize-generated-js",
description = "Perform additional optimizations on the generated JS code."
@@ -739,8 +675,5 @@ In combination with '-meta-info', this generates both IR and pre-IR versions of
override fun copyOf(): Freezable = copyK2JSCompilerArguments(this, K2JSCompilerArguments())
}
fun K2JSCompilerArguments.isPreIrBackendDisabled(): Boolean =
irOnly || irProduceJs || irProduceKlibFile || irBuildCache || useK2
fun K2JSCompilerArguments.isIrBackendEnabled(): Boolean =
irProduceKlibDir || irProduceJs || irProduceKlibFile || wasm || irBuildCache || useK2