J2K: CommonToolArguments and inheritors
This commit is contained in:
+38
-37
@@ -14,50 +14,53 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.cli.common.arguments;
|
||||
package org.jetbrains.kotlin.cli.common.arguments
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.config.AnalysisFlag;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.jetbrains.kotlin.config.AnalysisFlag
|
||||
import java.util.*
|
||||
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
public abstract class CommonCompilerArguments extends CommonToolArguments {
|
||||
public static final long serialVersionUID = 0L;
|
||||
abstract class CommonCompilerArguments : CommonToolArguments() {
|
||||
companion object {
|
||||
@JvmStatic private val serialVersionUID = 0L
|
||||
|
||||
public static final String PLUGIN_OPTION_FORMAT = "plugin:<pluginId>:<optionName>=<value>";
|
||||
const val PLUGIN_OPTION_FORMAT = "plugin:<pluginId>:<optionName>=<value>"
|
||||
|
||||
@GradleOption(DefaultValues.LanguageVersions.class)
|
||||
const val WARN = "warn"
|
||||
const val ERROR = "error"
|
||||
const val ENABLE = "enable"
|
||||
}
|
||||
|
||||
@GradleOption(DefaultValues.LanguageVersions::class)
|
||||
@Argument(
|
||||
value = "-language-version",
|
||||
valueDescription = "<version>",
|
||||
description = "Provide source compatibility with specified language version"
|
||||
)
|
||||
public String languageVersion;
|
||||
var languageVersion: String? = null
|
||||
|
||||
@GradleOption(DefaultValues.LanguageVersions.class)
|
||||
@GradleOption(DefaultValues.LanguageVersions::class)
|
||||
@Argument(
|
||||
value = "-api-version",
|
||||
valueDescription = "<version>",
|
||||
description = "Allow to use declarations only from the specified version of bundled libraries"
|
||||
)
|
||||
public String apiVersion;
|
||||
var apiVersion: String? = null
|
||||
|
||||
@Argument(
|
||||
value = "-kotlin-home",
|
||||
valueDescription = "<path>",
|
||||
description = "Path to Kotlin compiler home directory, used for runtime libraries discovery"
|
||||
)
|
||||
public String kotlinHome;
|
||||
var kotlinHome: String? = null
|
||||
|
||||
@Argument(value = "-P", valueDescription = PLUGIN_OPTION_FORMAT, description = "Pass an option to a plugin")
|
||||
public String[] pluginOptions;
|
||||
var pluginOptions: Array<String>? = null
|
||||
|
||||
// Advanced options
|
||||
|
||||
@Argument(value = "-Xno-inline", description = "Disable method inlining")
|
||||
public boolean noInline;
|
||||
var noInline: Boolean = false
|
||||
|
||||
// TODO Remove in 1.0
|
||||
@Argument(
|
||||
@@ -65,52 +68,50 @@ public abstract class CommonCompilerArguments extends CommonToolArguments {
|
||||
valueDescription = "<count>",
|
||||
description = "Repeat compilation (for performance analysis)"
|
||||
)
|
||||
public String repeat;
|
||||
var repeat: String? = null
|
||||
|
||||
@Argument(value = "-Xskip-metadata-version-check", description = "Load classes with bad metadata version anyway (incl. pre-release classes)")
|
||||
public boolean skipMetadataVersionCheck;
|
||||
@Argument(
|
||||
value = "-Xskip-metadata-version-check",
|
||||
description = "Load classes with bad metadata version anyway (incl. pre-release classes)"
|
||||
)
|
||||
var skipMetadataVersionCheck: Boolean = false
|
||||
|
||||
@Argument(value = "-Xallow-kotlin-package", description = "Allow compiling code in package 'kotlin'")
|
||||
public boolean allowKotlinPackage;
|
||||
var allowKotlinPackage: Boolean = false
|
||||
|
||||
@Argument(value = "-Xreport-output-files", description = "Report source to output files mapping")
|
||||
public boolean reportOutputFiles;
|
||||
var reportOutputFiles: Boolean = false
|
||||
|
||||
@Argument(value = "-Xplugin", valueDescription = "<path>", description = "Load plugins from the given classpath")
|
||||
public String[] pluginClasspaths;
|
||||
var pluginClasspaths: Array<String>? = null
|
||||
|
||||
@Argument(value = "-Xmulti-platform", description = "Enable experimental language support for multi-platform projects")
|
||||
public boolean multiPlatform;
|
||||
var multiPlatform: Boolean = false
|
||||
|
||||
@Argument(value = "-Xno-check-impl", description = "Do not check presence of 'impl' modifier in multi-platform projects")
|
||||
public boolean noCheckImpl;
|
||||
var noCheckImpl: Boolean = false
|
||||
|
||||
@Argument(
|
||||
value = "-Xintellij-plugin-root",
|
||||
valueDescription = "<path>",
|
||||
description = "Path to the kotlin-compiler.jar or directory where IntelliJ configuration files can be found"
|
||||
)
|
||||
public String intellijPluginRoot;
|
||||
var intellijPluginRoot: String? = null
|
||||
|
||||
@Argument(
|
||||
value = "-Xcoroutines",
|
||||
valueDescription = "{enable|warn|error}",
|
||||
description = "Enable coroutines or report warnings or errors on declarations and use sites of 'suspend' modifier"
|
||||
)
|
||||
public String coroutinesState = WARN;
|
||||
var coroutinesState: String? = WARN
|
||||
|
||||
public static final String WARN = "warn";
|
||||
public static final String ERROR = "error";
|
||||
public static final String ENABLE = "enable";
|
||||
|
||||
@NotNull
|
||||
public Map<AnalysisFlag<?>, Object> configureAnalysisFlags() {
|
||||
Map<AnalysisFlag<?>, Object> result = new HashMap<>();
|
||||
result.put(AnalysisFlag.getSkipMetadataVersionCheck(), skipMetadataVersionCheck);
|
||||
result.put(AnalysisFlag.getMultiPlatformDoNotCheckImpl(), noCheckImpl);
|
||||
return result;
|
||||
open fun configureAnalysisFlags(): MutableMap<AnalysisFlag<*>, Any> {
|
||||
return HashMap<AnalysisFlag<*>, Any>().apply {
|
||||
put(AnalysisFlag.skipMetadataVersionCheck, skipMetadataVersionCheck)
|
||||
put(AnalysisFlag.multiPlatformDoNotCheckImpl, noCheckImpl)
|
||||
}
|
||||
}
|
||||
|
||||
// Used only for serialize and deserialize settings. Don't use in other places!
|
||||
public static final class DummyImpl extends CommonCompilerArguments {}
|
||||
class DummyImpl : CommonCompilerArguments()
|
||||
}
|
||||
|
||||
+16
-16
@@ -14,34 +14,34 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.cli.common.arguments;
|
||||
package org.jetbrains.kotlin.cli.common.arguments
|
||||
|
||||
import org.jetbrains.kotlin.utils.SmartList;
|
||||
import org.jetbrains.kotlin.utils.SmartList
|
||||
import java.io.Serializable
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
abstract class CommonToolArguments : Serializable {
|
||||
companion object {
|
||||
@JvmStatic private val serialVersionUID = 0L
|
||||
}
|
||||
|
||||
public abstract class CommonToolArguments implements Serializable {
|
||||
private static final long serialVersionUID = 0L;
|
||||
var freeArgs: MutableList<String> = SmartList()
|
||||
|
||||
public List<String> freeArgs = new SmartList<>();
|
||||
|
||||
public transient ArgumentParseErrors errors = new ArgumentParseErrors();
|
||||
@Transient var errors: ArgumentParseErrors = ArgumentParseErrors()
|
||||
|
||||
@Argument(value = "-help", shortName = "-h", description = "Print a synopsis of standard options")
|
||||
public boolean help;
|
||||
var help: Boolean = false
|
||||
|
||||
@Argument(value = "-X", description = "Print a synopsis of advanced options")
|
||||
public boolean extraHelp;
|
||||
var extraHelp: Boolean = false
|
||||
|
||||
@Argument(value = "-version", description = "Display compiler version")
|
||||
public boolean version;
|
||||
var version: Boolean = false
|
||||
|
||||
@GradleOption(DefaultValues.BooleanFalseDefault.class)
|
||||
@GradleOption(DefaultValues.BooleanFalseDefault::class)
|
||||
@Argument(value = "-verbose", description = "Enable verbose logging output")
|
||||
public boolean verbose;
|
||||
var verbose: Boolean = false
|
||||
|
||||
@GradleOption(DefaultValues.BooleanFalseDefault.class)
|
||||
@GradleOption(DefaultValues.BooleanFalseDefault::class)
|
||||
@Argument(value = "-nowarn", description = "Generate no warnings")
|
||||
public boolean suppressWarnings;
|
||||
var suppressWarnings: Boolean = false
|
||||
}
|
||||
|
||||
+35
-33
@@ -14,100 +14,102 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.cli.common.arguments;
|
||||
package org.jetbrains.kotlin.cli.common.arguments
|
||||
|
||||
import static org.jetbrains.kotlin.cli.common.arguments.K2JsArgumentConstants.CALL;
|
||||
import static org.jetbrains.kotlin.cli.common.arguments.K2JsArgumentConstants.NO_CALL;
|
||||
import org.jetbrains.kotlin.cli.common.arguments.K2JsArgumentConstants.CALL
|
||||
import org.jetbrains.kotlin.cli.common.arguments.K2JsArgumentConstants.NO_CALL
|
||||
|
||||
public class K2JSCompilerArguments extends CommonCompilerArguments {
|
||||
public static final long serialVersionUID = 0L;
|
||||
class K2JSCompilerArguments : CommonCompilerArguments() {
|
||||
companion object {
|
||||
@JvmStatic private val serialVersionUID = 0L
|
||||
}
|
||||
|
||||
@GradleOption(DefaultValues.StringNullDefault.class)
|
||||
@GradleOption(DefaultValues.StringNullDefault::class)
|
||||
@Argument(value = "-output", valueDescription = "<path>", description = "Output file path")
|
||||
public String outputFile;
|
||||
var outputFile: String? = null
|
||||
|
||||
@GradleOption(DefaultValues.BooleanTrueDefault.class)
|
||||
@GradleOption(DefaultValues.BooleanTrueDefault::class)
|
||||
@Argument(value = "-no-stdlib", description = "Don't use bundled Kotlin stdlib")
|
||||
public boolean noStdlib;
|
||||
var noStdlib: Boolean = false
|
||||
|
||||
@Argument(
|
||||
value = "-libraries",
|
||||
valueDescription = "<path>",
|
||||
description = "Paths to Kotlin libraries with .meta.js and .kjsm files, separated by system path separator"
|
||||
)
|
||||
public String libraries;
|
||||
var libraries: String? = null
|
||||
|
||||
@GradleOption(DefaultValues.BooleanFalseDefault.class)
|
||||
@GradleOption(DefaultValues.BooleanFalseDefault::class)
|
||||
@Argument(value = "-source-map", description = "Generate source map")
|
||||
public boolean sourceMap;
|
||||
var sourceMap: Boolean = false
|
||||
|
||||
@GradleOption(DefaultValues.StringNullDefault.class)
|
||||
@GradleOption(DefaultValues.StringNullDefault::class)
|
||||
@Argument(value = "-source-map-prefix", description = "Prefix for paths in a source map")
|
||||
public String sourceMapPrefix;
|
||||
var sourceMapPrefix: String? = null
|
||||
|
||||
@Argument(
|
||||
value = "-source-map-source-roots",
|
||||
valueDescription = "<path>",
|
||||
description = "Base directories which are used to calculate relative paths to source files in source map"
|
||||
)
|
||||
public String sourceMapSourceRoots;
|
||||
var sourceMapSourceRoots: String? = null
|
||||
|
||||
@GradleOption(DefaultValues.JsSourceMapContentModes.class)
|
||||
@GradleOption(DefaultValues.JsSourceMapContentModes::class)
|
||||
@Argument(
|
||||
value = "-source-map-embed-sources",
|
||||
valueDescription = "{ always, never, inlining }",
|
||||
description = "Embed source files into source map"
|
||||
)
|
||||
public String sourceMapEmbedSources;
|
||||
var sourceMapEmbedSources: String? = null
|
||||
|
||||
@GradleOption(DefaultValues.BooleanTrueDefault.class)
|
||||
@GradleOption(DefaultValues.BooleanTrueDefault::class)
|
||||
@Argument(value = "-meta-info", description = "Generate .meta.js and .kjsm files with metadata. Use to create a library")
|
||||
public boolean metaInfo;
|
||||
var metaInfo: Boolean = false
|
||||
|
||||
@GradleOption(DefaultValues.JsEcmaVersions.class)
|
||||
@GradleOption(DefaultValues.JsEcmaVersions::class)
|
||||
@Argument(value = "-target", valueDescription = "{ v5 }", description = "Generate JS files for specific ECMA version")
|
||||
public String target;
|
||||
var target: String? = null
|
||||
|
||||
@GradleOption(DefaultValues.JsModuleKinds.class)
|
||||
@GradleOption(DefaultValues.JsModuleKinds::class)
|
||||
@Argument(
|
||||
value = "-module-kind",
|
||||
valueDescription = "{ plain, amd, commonjs, umd }",
|
||||
description = "Kind of a module generated by compiler"
|
||||
)
|
||||
public String moduleKind = K2JsArgumentConstants.MODULE_PLAIN;
|
||||
var moduleKind: String? = K2JsArgumentConstants.MODULE_PLAIN
|
||||
|
||||
@GradleOption(DefaultValues.JsMain.class)
|
||||
@Argument(value = "-main", valueDescription = "{" + CALL + "," + NO_CALL + "}", description = "Whether a main function should be called")
|
||||
public String main;
|
||||
@GradleOption(DefaultValues.JsMain::class)
|
||||
@Argument(value = "-main", valueDescription = "{$CALL,$NO_CALL}", description = "Whether a main function should be called")
|
||||
var main: String? = null
|
||||
|
||||
@Argument(
|
||||
value = "-output-prefix",
|
||||
valueDescription = "<path>",
|
||||
description = "Path to file which will be added to the beginning of output file"
|
||||
)
|
||||
public String outputPrefix;
|
||||
var outputPrefix: String? = null
|
||||
|
||||
@Argument(
|
||||
value = "-output-postfix",
|
||||
valueDescription = "<path>",
|
||||
description = "Path to file which will be added to the end of output file"
|
||||
)
|
||||
public String outputPostfix;
|
||||
var outputPostfix: String? = null
|
||||
|
||||
// Advanced options
|
||||
|
||||
@GradleOption(DefaultValues.BooleanFalseDefault.class)
|
||||
@GradleOption(DefaultValues.BooleanFalseDefault::class)
|
||||
@Argument(value = "-Xtyped-arrays", description = "Translate primitive arrays to JS typed arrays")
|
||||
public boolean typedArrays;
|
||||
var typedArrays: Boolean = false
|
||||
|
||||
@GradleOption(DefaultValues.BooleanFalseDefault.class)
|
||||
@GradleOption(DefaultValues.BooleanFalseDefault::class)
|
||||
@Argument(value = "-Xfriend-modules-disabled", description = "Disable internal declaration export")
|
||||
public boolean friendModulesDisabled;
|
||||
var friendModulesDisabled: Boolean = false
|
||||
|
||||
@Argument(
|
||||
value = "-Xfriend-modules",
|
||||
valueDescription = "<path>",
|
||||
description = "Paths to friend modules"
|
||||
)
|
||||
public String friendModules;
|
||||
var friendModules: String? = null
|
||||
}
|
||||
|
||||
+8
-6
@@ -14,28 +14,30 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.cli.common.arguments;
|
||||
package org.jetbrains.kotlin.cli.common.arguments
|
||||
|
||||
public class K2JSDceArguments extends CommonToolArguments {
|
||||
private static final long serialVersionUID = 0;
|
||||
class K2JSDceArguments : CommonToolArguments() {
|
||||
companion object {
|
||||
@JvmStatic private val serialVersionUID = 0L
|
||||
}
|
||||
|
||||
@Argument(
|
||||
value = "-output-dir",
|
||||
valueDescription = "<path>",
|
||||
description = "Output directory"
|
||||
)
|
||||
public String outputDirectory;
|
||||
var outputDirectory: String? = null
|
||||
|
||||
@Argument(
|
||||
value = "-keep",
|
||||
valueDescription = "<fully.qualified.name[,]>",
|
||||
description = "List of fully-qualified names of declarations that shouldn't be eliminated"
|
||||
)
|
||||
public String[] declarationsToKeep;
|
||||
var declarationsToKeep: Array<String>? = null
|
||||
|
||||
@Argument(
|
||||
value = "-Xprint-reachability-info",
|
||||
description = "Print declarations marked as reachable"
|
||||
)
|
||||
public boolean printReachabilityInfo;
|
||||
var printReachabilityInfo: Boolean = false
|
||||
}
|
||||
|
||||
+51
-58
@@ -14,78 +14,76 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.cli.common.arguments;
|
||||
package org.jetbrains.kotlin.cli.common.arguments
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.config.AnalysisFlag;
|
||||
import org.jetbrains.kotlin.config.Jsr305State;
|
||||
import org.jetbrains.kotlin.config.JvmTarget;
|
||||
import org.jetbrains.kotlin.config.AnalysisFlag
|
||||
import org.jetbrains.kotlin.config.Jsr305State
|
||||
import org.jetbrains.kotlin.config.JvmTarget
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
public class K2JVMCompilerArguments extends CommonCompilerArguments {
|
||||
public static final long serialVersionUID = 0L;
|
||||
class K2JVMCompilerArguments : CommonCompilerArguments() {
|
||||
companion object {
|
||||
@JvmStatic private val serialVersionUID = 0L
|
||||
}
|
||||
|
||||
@Argument(value = "-d", valueDescription = "<directory|jar>", description = "Destination for generated class files")
|
||||
public String destination;
|
||||
var destination: String? = null
|
||||
|
||||
@Argument(value = "-classpath", shortName = "-cp", valueDescription = "<path>", description = "Paths where to find user class files")
|
||||
public String classpath;
|
||||
var classpath: String? = null
|
||||
|
||||
@GradleOption(DefaultValues.BooleanFalseDefault.class)
|
||||
@GradleOption(DefaultValues.BooleanFalseDefault::class)
|
||||
@Argument(value = "-include-runtime", description = "Include Kotlin runtime in to resulting .jar")
|
||||
public boolean includeRuntime;
|
||||
var includeRuntime: Boolean = false
|
||||
|
||||
@GradleOption(DefaultValues.StringNullDefault.class)
|
||||
@GradleOption(DefaultValues.StringNullDefault::class)
|
||||
@Argument(
|
||||
value = "-jdk-home",
|
||||
valueDescription = "<path>",
|
||||
description = "Path to JDK home directory to include into classpath, if differs from default JAVA_HOME"
|
||||
)
|
||||
public String jdkHome;
|
||||
var jdkHome: String? = null
|
||||
|
||||
@GradleOption(DefaultValues.BooleanFalseDefault.class)
|
||||
@GradleOption(DefaultValues.BooleanFalseDefault::class)
|
||||
@Argument(value = "-no-jdk", description = "Don't include Java runtime into classpath")
|
||||
public boolean noJdk;
|
||||
var noJdk: Boolean = false
|
||||
|
||||
@GradleOption(DefaultValues.BooleanTrueDefault.class)
|
||||
@GradleOption(DefaultValues.BooleanTrueDefault::class)
|
||||
@Argument(value = "-no-stdlib", description = "Don't include Kotlin runtime into classpath")
|
||||
public boolean noStdlib;
|
||||
var noStdlib: Boolean = false
|
||||
|
||||
@GradleOption(DefaultValues.BooleanTrueDefault.class)
|
||||
@GradleOption(DefaultValues.BooleanTrueDefault::class)
|
||||
@Argument(value = "-no-reflect", description = "Don't include Kotlin reflection implementation into classpath")
|
||||
public boolean noReflect;
|
||||
var noReflect: Boolean = false
|
||||
|
||||
@Argument(value = "-script", description = "Evaluate the script file")
|
||||
public boolean script;
|
||||
var script: Boolean = false
|
||||
|
||||
@Argument(
|
||||
value = "-script-templates",
|
||||
valueDescription = "<fully qualified class name[,]>",
|
||||
description = "Script definition template classes"
|
||||
)
|
||||
public String[] scriptTemplates;
|
||||
var scriptTemplates: Array<String>? = null
|
||||
|
||||
@Argument(value = "-module-name", description = "Module name")
|
||||
public String moduleName;
|
||||
var moduleName: String? = null
|
||||
|
||||
@GradleOption(DefaultValues.JvmTargetVersions.class)
|
||||
@GradleOption(DefaultValues.JvmTargetVersions::class)
|
||||
@Argument(
|
||||
value = "-jvm-target",
|
||||
valueDescription = "<version>",
|
||||
description = "Target version of the generated JVM bytecode (1.6 or 1.8), default is 1.6"
|
||||
)
|
||||
public String jvmTarget = JvmTarget.DEFAULT.getDescription();
|
||||
var jvmTarget: String? = JvmTarget.DEFAULT.description
|
||||
|
||||
@GradleOption(DefaultValues.BooleanFalseDefault.class)
|
||||
@GradleOption(DefaultValues.BooleanFalseDefault::class)
|
||||
@Argument(value = "-java-parameters", description = "Generate metadata for Java 1.8 reflection on method parameters")
|
||||
public boolean javaParameters;
|
||||
var javaParameters: Boolean = false
|
||||
|
||||
// Advanced options
|
||||
|
||||
@Argument(value = "-Xmodule-path", valueDescription = "<path>", description = "Paths where to find Java 9+ modules")
|
||||
public String javaModulePath;
|
||||
var javaModulePath: String? = null
|
||||
|
||||
@Argument(
|
||||
value = "-Xadd-modules",
|
||||
@@ -93,89 +91,84 @@ public class K2JVMCompilerArguments extends CommonCompilerArguments {
|
||||
description = "Root modules to resolve in addition to the initial modules,\n" +
|
||||
"or all modules on the module path if <module> is ALL-MODULE-PATH"
|
||||
)
|
||||
public String[] additionalJavaModules;
|
||||
var additionalJavaModules: Array<String>? = null
|
||||
|
||||
@Argument(value = "-Xno-call-assertions", description = "Don't generate not-null assertion after each invocation of method returning not-null")
|
||||
public boolean noCallAssertions;
|
||||
var noCallAssertions: Boolean = false
|
||||
|
||||
@Argument(value = "-Xno-param-assertions", description = "Don't generate not-null assertions on parameters of methods accessible from Java")
|
||||
public boolean noParamAssertions;
|
||||
var noParamAssertions: Boolean = false
|
||||
|
||||
@Argument(value = "-Xno-optimize", description = "Disable optimizations")
|
||||
public boolean noOptimize;
|
||||
var noOptimize: Boolean = false
|
||||
|
||||
@Argument(value = "-Xreport-perf", description = "Report detailed performance statistics")
|
||||
public boolean reportPerf;
|
||||
var reportPerf: Boolean = false
|
||||
|
||||
@Argument(value = "-Xbuild-file", deprecatedName = "-module", valueDescription = "<path>", description = "Path to the .xml build file to compile")
|
||||
public String buildFile;
|
||||
var buildFile: String? = null
|
||||
|
||||
@Argument(value = "-Xmultifile-parts-inherit", description = "Compile multifile classes as a hierarchy of parts and facade")
|
||||
public boolean inheritMultifileParts;
|
||||
var inheritMultifileParts: Boolean = false
|
||||
|
||||
@Argument(value = "-Xskip-runtime-version-check", description = "Allow Kotlin runtime libraries of incompatible versions in the classpath")
|
||||
public boolean skipRuntimeVersionCheck;
|
||||
var skipRuntimeVersionCheck: Boolean = false
|
||||
|
||||
@Argument(
|
||||
value = "-Xuse-old-class-files-reading",
|
||||
description = "Use old class files reading implementation " +
|
||||
"(may slow down the build and should be used in case of problems with the new implementation)"
|
||||
)
|
||||
public boolean useOldClassFilesReading;
|
||||
var useOldClassFilesReading: Boolean = false
|
||||
|
||||
@Argument(
|
||||
value = "-Xdump-declarations-to",
|
||||
valueDescription = "<path>",
|
||||
description = "Path to JSON file to dump Java to Kotlin declaration mappings"
|
||||
)
|
||||
public String declarationsOutputPath;
|
||||
var declarationsOutputPath: String? = null
|
||||
|
||||
@Argument(value = "-Xsingle-module", description = "Combine modules for source files and binary dependencies into a single module")
|
||||
public boolean singleModule;
|
||||
var singleModule: Boolean = false
|
||||
|
||||
@Argument(value = "-Xadd-compiler-builtins", description = "Add definitions of built-in declarations to the compilation classpath (useful with -no-stdlib)")
|
||||
public boolean addCompilerBuiltIns;
|
||||
var addCompilerBuiltIns: Boolean = false
|
||||
|
||||
@Argument(value = "-Xload-builtins-from-dependencies", description = "Load definitions of built-in declarations from module dependencies, instead of from the compiler")
|
||||
public boolean loadBuiltInsFromDependencies;
|
||||
var loadBuiltInsFromDependencies: Boolean = false
|
||||
|
||||
@Argument(
|
||||
value = "-Xscript-resolver-environment",
|
||||
valueDescription = "<key=value[,]>",
|
||||
description = "Script resolver environment in key-value pairs (the value could be quoted and escaped)"
|
||||
)
|
||||
public String[] scriptResolverEnvironment;
|
||||
var scriptResolverEnvironment: Array<String>? = null
|
||||
|
||||
// Javac options
|
||||
@Argument(value = "-Xuse-javac", description = "Use javac for Java source and class files analysis")
|
||||
public boolean useJavac;
|
||||
var useJavac: Boolean = false
|
||||
|
||||
@Argument(
|
||||
value = "-Xjavac-arguments",
|
||||
valueDescription = "<option[,]>",
|
||||
description = "Java compiler arguments")
|
||||
public String[] javacArguments;
|
||||
var javacArguments: Array<String>? = null
|
||||
|
||||
@Argument(
|
||||
value = "-Xjsr305-annotations",
|
||||
valueDescription = "{ignore|enable}",
|
||||
description = "Specify global behavior for JSR-305 nullability annotations: ignore, or treat as other supported nullability annotations"
|
||||
)
|
||||
public String jsr305GlobalReportLevel = Jsr305State.DEFAULT.getDescription();
|
||||
var jsr305GlobalReportLevel: String? = Jsr305State.DEFAULT.description
|
||||
|
||||
// Paths to output directories for friend modules.
|
||||
public String[] friendPaths;
|
||||
var friendPaths: Array<String>? = null
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public Map<AnalysisFlag<?>, Object> configureAnalysisFlags() {
|
||||
Map<AnalysisFlag<?>, Object> result = super.configureAnalysisFlags();
|
||||
for (Jsr305State state : Jsr305State.values()) {
|
||||
if (state.getDescription().equals(jsr305GlobalReportLevel)) {
|
||||
result.put(AnalysisFlag.getLoadJsr305Annotations(), state);
|
||||
break;
|
||||
}
|
||||
override fun configureAnalysisFlags(): MutableMap<AnalysisFlag<*>, Any> {
|
||||
val result = super.configureAnalysisFlags()
|
||||
Jsr305State.values().firstOrNull { it.description == jsr305GlobalReportLevel }?.let {
|
||||
result.put(AnalysisFlag.loadJsr305Annotations, it)
|
||||
}
|
||||
return result;
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
+7
-5
@@ -14,13 +14,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.cli.common.arguments;
|
||||
package org.jetbrains.kotlin.cli.common.arguments
|
||||
|
||||
public class K2MetadataCompilerArguments extends CommonCompilerArguments {
|
||||
public static final long serialVersionUID = 0L;
|
||||
class K2MetadataCompilerArguments : CommonCompilerArguments() {
|
||||
companion object {
|
||||
@JvmStatic private val serialVersionUID = 0L
|
||||
}
|
||||
|
||||
@Argument(value = "-d", valueDescription = "<directory|jar>", description = "Destination for generated .kotlin_metadata files")
|
||||
public String destination;
|
||||
var destination: String? = null
|
||||
|
||||
@Argument(
|
||||
value = "-classpath",
|
||||
@@ -28,5 +30,5 @@ public class K2MetadataCompilerArguments extends CommonCompilerArguments {
|
||||
valueDescription = "<path>",
|
||||
description = "Paths where to find library .kotlin_metadata files"
|
||||
)
|
||||
public String classpath;
|
||||
var classpath: String? = null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user