Add a compiler option to disable default scripting plugin
This commit is contained in:
+3
@@ -231,6 +231,9 @@ class K2JVMCompilerArguments : CommonCompilerArguments() {
|
||||
@Argument(value = "-Xenable-jvm-default", description = "Allow to use '@JvmDefault' for JVM default method support")
|
||||
var enableJvmDefault: Boolean by FreezableVar(false)
|
||||
|
||||
@Argument(value = "-Xdisable-default-scripting-plugin", description = "Do not enable scripting plugin by default")
|
||||
var disableDefaultScriptingPlugin: Boolean by FreezableVar(false)
|
||||
|
||||
// Paths to output directories for friend modules.
|
||||
var friendPaths: Array<String>? by FreezableVar(null)
|
||||
|
||||
|
||||
@@ -232,7 +232,10 @@ class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
|
||||
true
|
||||
}
|
||||
|
||||
if (!isEmbeddable && pluginClasspaths.none { File(it).name == PathUtil.KOTLIN_SCRIPTING_COMPILER_PLUGIN_JAR }) {
|
||||
if (!isEmbeddable &&
|
||||
pluginClasspaths.none { File(it).name == PathUtil.KOTLIN_SCRIPTING_COMPILER_PLUGIN_JAR } &&
|
||||
!arguments.disableDefaultScriptingPlugin
|
||||
) {
|
||||
// if scripting plugin is not enabled explicitly (probably from another path) try to enable it implicitly
|
||||
val libPath = paths?.libPath ?: File(".")
|
||||
val pluginJar = File(libPath, PathUtil.KOTLIN_SCRIPTING_COMPILER_PLUGIN_JAR)
|
||||
|
||||
Reference in New Issue
Block a user