Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2010-2018 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.messages.CompilerMessageSeverity
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.config.*
import kotlin.reflect.KVisibility
class K2JVMCompilerArguments : CommonCompilerArguments() {
companion object {
@JvmStatic
private val serialVersionUID = 0L
}
@Argument(value = "-d", valueDescription = "", description = "Destination for generated class files")
var destination: String? by NullableStringFreezableVar(null)
@Argument(
value = "-classpath",
shortName = "-cp",
valueDescription = "",
description = "List of directories and JAR/ZIP archives to search for user class files"
)
var classpath: String? by NullableStringFreezableVar(null)
@Argument(value = "-include-runtime", description = "Include Kotlin runtime into the resulting JAR")
var includeRuntime: Boolean by FreezableVar(false)
@Argument(
value = "-jdk-home",
valueDescription = "",
description = "Include a custom JDK from the specified location into the classpath instead of the default JAVA_HOME"
)
var jdkHome: String? by NullableStringFreezableVar(null)
@GradleOption(DefaultValues.BooleanFalseDefault::class)
@Argument(value = "-no-jdk", description = "Don't automatically include the Java runtime into the classpath")
var noJdk: Boolean by FreezableVar(false)
@Argument(
value = "-no-stdlib",
description = "Don't automatically include the Kotlin/JVM stdlib and Kotlin reflection into the classpath"
)
var noStdlib: Boolean by FreezableVar(false)
@Argument(value = "-no-reflect", description = "Don't automatically include Kotlin reflection into the classpath")
var noReflect: Boolean by FreezableVar(false)
@Argument(
value = "-expression",
shortName = "-e",
description = "Evaluate the given string as a Kotlin script"
)
var expression: String? by FreezableVar(null)
@Argument(
value = "-script-templates",
valueDescription = "",
description = "Script definition template classes"
)
var scriptTemplates: Array? by FreezableVar(null)
@GradleOption(DefaultValues.StringNullDefault::class)
@Argument(value = "-module-name", valueDescription = "", description = "Name of the generated .kotlin_module file")
var moduleName: String? by NullableStringFreezableVar(null)
@GradleOption(
value = DefaultValues.JvmTargetVersions::class,
backingFieldVisibility = KVisibility.INTERNAL
)
@Argument(
value = "-jvm-target",
valueDescription = "",
description = "Target version of the generated JVM bytecode (${JvmTarget.SUPPORTED_VERSIONS_DESCRIPTION}), default is 1.8"
)
var jvmTarget: String? by NullableStringFreezableVar(null)
@GradleOption(DefaultValues.BooleanFalseDefault::class)
@Argument(value = "-java-parameters", description = "Generate metadata for Java 1.8 reflection on method parameters")
var javaParameters: Boolean by FreezableVar(false)
// Advanced options
@Argument(
value = "-Xuse-ir",
description = "Use the IR backend. This option has no effect unless the language version less than 1.5 is used"
)
var useIR: Boolean by FreezableVar(false)
@GradleOption(DefaultValues.BooleanFalseDefault::class)
@Argument(value = "-Xuse-old-backend", description = "Use the old JVM backend")
var useOldBackend: Boolean by FreezableVar(false)
@Argument(
value = "-Xallow-unstable-dependencies",
description = "Do not report errors on classes in dependencies, which were compiled by an unstable version of the Kotlin compiler"
)
var allowUnstableDependencies: Boolean by FreezableVar(false)
@Argument(
value = "-Xabi-stability",
valueDescription = "{stable|unstable}",
description = "When using unstable compiler features such as FIR, use 'stable' to mark generated class files as stable\n" +
"to prevent diagnostics from stable compilers at the call site.\n" +
"When using the JVM IR backend, conversely, use 'unstable' to mark generated class files as unstable\n" +
"to force diagnostics to be reported."
)
var abiStability: String? by FreezableVar(null)
@Argument(
value = "-Xir-do-not-clear-binding-context",
description = "When using the IR backend, do not clear BindingContext between psi2ir and lowerings"
)
var doNotClearBindingContext: Boolean by FreezableVar(false)
@Argument(
value = "-Xbackend-threads",
valueDescription = "",
description = "When using the IR backend, run lowerings by file in N parallel threads.\n" +
"0 means use a thread per processor core.\n" +
"Default value is 1"
)
var backendThreads: String by FreezableVar("1")
@Argument(value = "-Xmodule-path", valueDescription = "", description = "Paths where to find Java 9+ modules")
var javaModulePath: String? by NullableStringFreezableVar(null)
@Argument(
value = "-Xadd-modules",
valueDescription = "",
description = "Root modules to resolve in addition to the initial modules,\n" +
"or all modules on the module path if is ALL-MODULE-PATH"
)
var additionalJavaModules: Array? by FreezableVar(null)
@Argument(value = "-Xno-call-assertions", description = "Don't generate not-null assertions for arguments of platform types")
var noCallAssertions: Boolean by FreezableVar(false)
@Argument(
value = "-Xno-receiver-assertions",
description = "Don't generate not-null assertion for extension receiver arguments of platform types"
)
var noReceiverAssertions: Boolean by FreezableVar(false)
@Argument(
value = "-Xno-param-assertions",
description = "Don't generate not-null assertions on parameters of methods accessible from Java"
)
var noParamAssertions: Boolean by FreezableVar(false)
@Argument(value = "-Xno-optimize", description = "Disable optimizations")
var noOptimize: Boolean by FreezableVar(false)
@Argument(
value = "-Xassertions", valueDescription = "{always-enable|always-disable|jvm|legacy}",
description = "Assert calls behaviour\n" +
"-Xassertions=always-enable: enable, ignore jvm assertion settings;\n" +
"-Xassertions=always-disable: disable, ignore jvm assertion settings;\n" +
"-Xassertions=jvm: enable, depend on jvm assertion settings;\n" +
"-Xassertions=legacy: calculate condition on each call, check depends on jvm assertion settings in the kotlin package;\n" +
"default: legacy"
)
var assertionsMode: String? by NullableStringFreezableVar(JVMAssertionsMode.DEFAULT.description)
@Argument(
value = "-Xbuild-file",
deprecatedName = "-module",
valueDescription = "",
description = "Path to the .xml build file to compile"
)
var buildFile: String? by NullableStringFreezableVar(null)
@Argument(value = "-Xmultifile-parts-inherit", description = "Compile multifile classes as a hierarchy of parts and facade")
var inheritMultifileParts: Boolean by FreezableVar(false)
@Argument(value = "-Xuse-type-table", description = "Use type table in metadata serialization")
var useTypeTable: Boolean by FreezableVar(false)
@Argument(
value = "-Xuse-old-class-files-reading",
description = "Use old class files reading implementation. This may slow down the build and cause problems with Groovy interop.\n" +
"Should be used in case of problems with the new implementation"
)
var useOldClassFilesReading: Boolean by FreezableVar(false)
@Argument(
value = "-Xuse-fast-jar-file-system",
description = "Use fast implementation on Jar FS. This may speed up compilation time, but currently it's an experimental mode"
)
var useFastJarFileSystem: Boolean by FreezableVar(false)
@Argument(
value = "-Xdump-declarations-to",
valueDescription = "",
description = "Path to JSON file to dump Java to Kotlin declaration mappings"
)
var declarationsOutputPath: String? by NullableStringFreezableVar(null)
@Argument(value = "-Xsingle-module", description = "Combine modules for source files and binary dependencies into a single module")
var singleModule: Boolean by FreezableVar(false)
@Argument(
value = "-Xsuppress-missing-builtins-error",
description = "Suppress the \"cannot access built-in declaration\" error (useful with -no-stdlib)"
)
var suppressMissingBuiltinsError: Boolean by FreezableVar(false)
@Argument(
value = "-Xscript-resolver-environment",
valueDescription = "",
description = "Script resolver environment in key-value pairs (the value could be quoted and escaped)"
)
var scriptResolverEnvironment: Array? by FreezableVar(null)
// Javac options
@Argument(value = "-Xuse-javac", description = "Use javac for Java source and class files analysis")
var useJavac: Boolean by FreezableVar(false)
@Argument(value = "-Xcompile-java", description = "Reuse javac analysis and compile Java source files")
var compileJava by FreezableVar(false)
@Argument(
value = "-Xjavac-arguments",
valueDescription = "