From 446c6793a428e4d2f20d4aae4978ff9a9f3cacda Mon Sep 17 00:00:00 2001 From: Sebastian Sellmair Date: Tue, 4 Apr 2023 22:12:43 +0200 Subject: [PATCH] [Gradle] Kotlin2JsCompile: Remove redundant processArgs KTIJ-24976 --- .../gradle/targets/js/ir/KotlinJsIrLink.kt | 30 ------------------- .../kotlin/gradle/tasks/Kotlin2JsCompile.kt | 7 ----- 2 files changed, 37 deletions(-) diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/js/ir/KotlinJsIrLink.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/js/ir/KotlinJsIrLink.kt index e82212f7962..b906ff08c29 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/js/ir/KotlinJsIrLink.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/js/ir/KotlinJsIrLink.kt @@ -94,36 +94,6 @@ abstract class KotlinJsIrLink @Inject constructor( } } - override fun processArgs(args: K2JSCompilerArguments) { - super.processArgs(args) - KotlinBuildStatsService.applyIfInitialised { - it.report(BooleanMetrics.JS_IR_INCREMENTAL, incrementalJsIr) - val newArgs = K2JSCompilerArguments() - parseCommandLineArguments(ArgumentUtils.convertArgumentsToStringList(args), newArgs) - it.report( - StringMetrics.JS_OUTPUT_GRANULARITY, - if (newArgs.irPerModule) - KotlinJsIrOutputGranularity.PER_MODULE.name.toLowerCaseAsciiOnly() - else - KotlinJsIrOutputGranularity.WHOLE_PROGRAM.name.toLowerCaseAsciiOnly() - ) - } - - // moduleName can start with @ for group of NPM packages - // but args parsing @ as start of argfile - // so WA we provide moduleName as one parameter - if (args.moduleName != null) { - args.freeArgs += "-ir-output-name=${args.moduleName}" - args.moduleName = null - } - - args.includes = entryModule.get().asFile.canonicalPath - - if (usingCacheDirectory()) { - args.cacheDirectory = rootCacheDirectory.get().asFile.also { it.mkdirs() }.absolutePath - } - } - override fun contributeAdditionalCompilerArguments(context: ContributeCompilerArgumentsContext) { super.contributeAdditionalCompilerArguments(context) diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/tasks/Kotlin2JsCompile.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/tasks/Kotlin2JsCompile.kt index 60cca530ff7..149367a3fa0 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/tasks/Kotlin2JsCompile.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/tasks/Kotlin2JsCompile.kt @@ -286,12 +286,6 @@ abstract class Kotlin2JsCompile @Inject constructor( override val incrementalProps: List get() = super.incrementalProps + listOf(friendDependencies) - open fun processArgs( - args: K2JSCompilerArguments - ) { - - } - protected open fun contributeAdditionalCompilerArguments(context: ContributeCompilerArgumentsContext) = Unit override fun callCompilerAsync( @@ -345,7 +339,6 @@ abstract class Kotlin2JsCompile @Inject constructor( reportingSettings = reportingSettings(), incrementalCompilationEnvironment = icEnv ) - processArgs(args) compilerRunner.runJsCompilerAsync( args, environment,