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")
|
@Argument(value = "-Xenable-jvm-default", description = "Allow to use '@JvmDefault' for JVM default method support")
|
||||||
var enableJvmDefault: Boolean by FreezableVar(false)
|
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.
|
// Paths to output directories for friend modules.
|
||||||
var friendPaths: Array<String>? by FreezableVar(null)
|
var friendPaths: Array<String>? by FreezableVar(null)
|
||||||
|
|
||||||
|
|||||||
@@ -232,7 +232,10 @@ class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
|
|||||||
true
|
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
|
// if scripting plugin is not enabled explicitly (probably from another path) try to enable it implicitly
|
||||||
val libPath = paths?.libPath ?: File(".")
|
val libPath = paths?.libPath ?: File(".")
|
||||||
val pluginJar = File(libPath, PathUtil.KOTLIN_SCRIPTING_COMPILER_PLUGIN_JAR)
|
val pluginJar = File(libPath, PathUtil.KOTLIN_SCRIPTING_COMPILER_PLUGIN_JAR)
|
||||||
|
|||||||
+2
@@ -9,6 +9,8 @@ where advanced options include:
|
|||||||
Normalize constructor calls (disable: don't normalize; enable: normalize), default is disable
|
Normalize constructor calls (disable: don't normalize; enable: normalize), default is disable
|
||||||
-Xdump-declarations-to=<path> Path to JSON file to dump Java to Kotlin declaration mappings
|
-Xdump-declarations-to=<path> Path to JSON file to dump Java to Kotlin declaration mappings
|
||||||
-Xenable-jvm-default Allow to use '@JvmDefault' for JVM default method support
|
-Xenable-jvm-default Allow to use '@JvmDefault' for JVM default method support
|
||||||
|
-Xdisable-default-scripting-plugin
|
||||||
|
Do not enable scripting plugin by default
|
||||||
-Xmultifile-parts-inherit Compile multifile classes as a hierarchy of parts and facade
|
-Xmultifile-parts-inherit Compile multifile classes as a hierarchy of parts and facade
|
||||||
-Xmodule-path=<path> Paths where to find Java 9+ modules
|
-Xmodule-path=<path> Paths where to find Java 9+ modules
|
||||||
-Xjavac-arguments=<option[,]> Java compiler arguments
|
-Xjavac-arguments=<option[,]> Java compiler arguments
|
||||||
|
|||||||
Reference in New Issue
Block a user