[Gradle, JS] outputName -> moduleName
This commit is contained in:
+11
-3
@@ -16,6 +16,10 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
|
||||
@JvmStatic private val serialVersionUID = 0L
|
||||
}
|
||||
|
||||
@GradleOption(
|
||||
value = DefaultValues.StringNullDefault::class,
|
||||
gradleInputType = GradleInputTypes.INTERNAL // handled by task 'outputFileProperty'
|
||||
)
|
||||
@GradleDeprecatedOption(
|
||||
message = "Only for legacy backend. For IR backend please use task.destinationDirectory and moduleName",
|
||||
level = DeprecationLevel.WARNING,
|
||||
@@ -27,8 +31,12 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
|
||||
@Argument(value = "-Xir-output-dir", valueDescription = "<directory>", description = "Destination for generated files")
|
||||
var outputDir: String? by NullableStringFreezableVar(null)
|
||||
|
||||
@Argument(value = "-Xir-output-name", description = "Base name of generated files")
|
||||
var outputName: String? by NullableStringFreezableVar(null)
|
||||
@GradleOption(
|
||||
value = DefaultValues.StringNullDefault::class,
|
||||
gradleInputType = GradleInputTypes.INPUT
|
||||
)
|
||||
@Argument(value = "-Xir-module-name", description = "Base name of generated files")
|
||||
var moduleName: String? by NullableStringFreezableVar(null)
|
||||
|
||||
@GradleOption(
|
||||
value = DefaultValues.BooleanTrueDefault::class,
|
||||
@@ -185,7 +193,7 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
|
||||
var irOnly: Boolean by FreezableVar(false)
|
||||
|
||||
@Argument(
|
||||
value = "-Xir-module-name",
|
||||
value = "-Xir-klib-module-name",
|
||||
valueDescription = "<name>",
|
||||
description = "Specify a compilation module name for IR backend"
|
||||
)
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
package org.jetbrains.kotlin.cli.js
|
||||
|
||||
import com.intellij.openapi.Disposable
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import com.intellij.openapi.util.text.StringUtil
|
||||
import org.jetbrains.kotlin.backend.common.CompilationException
|
||||
import org.jetbrains.kotlin.backend.common.phaser.PhaseConfig
|
||||
@@ -48,14 +47,12 @@ import org.jetbrains.kotlin.ir.declarations.impl.IrFactoryImpl
|
||||
import org.jetbrains.kotlin.ir.declarations.impl.IrFactoryImplForJsIC
|
||||
import org.jetbrains.kotlin.js.analyzer.JsAnalysisResult
|
||||
import org.jetbrains.kotlin.js.config.*
|
||||
import org.jetbrains.kotlin.library.KLIB_FILE_EXTENSION
|
||||
import org.jetbrains.kotlin.metadata.deserialization.BinaryVersion
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.serialization.js.ModuleKind
|
||||
import org.jetbrains.kotlin.utils.KotlinPaths
|
||||
import org.jetbrains.kotlin.utils.PathUtil
|
||||
import org.jetbrains.kotlin.utils.fileUtils.withReplacedExtensionOrNull
|
||||
import org.jetbrains.kotlin.utils.join
|
||||
import java.io.File
|
||||
import java.io.IOException
|
||||
@@ -239,7 +236,7 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
|
||||
if (!checkKotlinPackageUsage(environmentForJS.configuration, sourcesFiles)) return ExitCode.COMPILATION_ERROR
|
||||
|
||||
val outputDirPath = arguments.outputDir
|
||||
val outputName = arguments.outputName
|
||||
val outputName = arguments.moduleName
|
||||
if (outputDirPath == null) {
|
||||
messageCollector.report(ERROR, "IR: Specify output dir via -Xir-output-dir", null)
|
||||
return ExitCode.COMPILATION_ERROR
|
||||
|
||||
Reference in New Issue
Block a user