[JS DCE] Add an ability to define overwriting strategy when copying dependencies in dev-mode

* CLI option "-Xdev-mode-overwriting-strategy"
* System Property "kotlin.js.dce.devmode.overwriting.strategy"

Possible values: "older", "all".

#KT-36349 Fixed
This commit is contained in:
Zalim Bashorov
2020-02-19 16:51:09 +03:00
parent 07ca355af8
commit 6f61ea7f67
5 changed files with 40 additions and 37 deletions
@@ -1,21 +1,13 @@
/*
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.cli.common.arguments
import org.jetbrains.kotlin.cli.common.arguments.DevModeOverwritingStrategies.ALL
import org.jetbrains.kotlin.cli.common.arguments.DevModeOverwritingStrategies.OLDER
class K2JSDceArguments : CommonToolArguments() {
companion object {
@JvmStatic private val serialVersionUID = 0L
@@ -48,4 +40,16 @@ class K2JSDceArguments : CommonToolArguments() {
)
@GradleOption(DefaultValues.BooleanFalseDefault::class)
var devMode: Boolean by FreezableVar(false)
@Argument(
value = "-Xdev-mode-overwriting-strategy",
valueDescription = "{$OLDER|$ALL}",
description = "Overwriting strategy during copy dependencies in development mode"
)
var devModeOverwritingStrategy: String? by NullableStringFreezableVar(null)
}
object DevModeOverwritingStrategies {
const val OLDER = "older"
const val ALL = "all"
}