KT-11410: Add Xmultifile-parts-inherit CLI option.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2016 JetBrains s.r.o.
|
* Copyright 2010-2015 JetBrains s.r.o.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -57,6 +57,7 @@ class GenerationState @JvmOverloads constructor(
|
|||||||
disableInline: Boolean = false,
|
disableInline: Boolean = false,
|
||||||
disableOptimization: Boolean = false,
|
disableOptimization: Boolean = false,
|
||||||
val useTypeTableInSerializer: Boolean = false,
|
val useTypeTableInSerializer: Boolean = false,
|
||||||
|
val inheritMultifileParts: Boolean = false,
|
||||||
val packagesWithObsoleteParts: Collection<FqName> = emptySet(),
|
val packagesWithObsoleteParts: Collection<FqName> = emptySet(),
|
||||||
val obsoleteMultifileClasses: Collection<FqName> = emptySet(),
|
val obsoleteMultifileClasses: Collection<FqName> = emptySet(),
|
||||||
// for PackageCodegen in incremental compilation mode
|
// for PackageCodegen in incremental compilation mode
|
||||||
|
|||||||
+4
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2016 JetBrains s.r.o.
|
* Copyright 2010-2015 JetBrains s.r.o.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -64,6 +64,9 @@ public class K2JVMCompilerArguments extends CommonCompilerArguments {
|
|||||||
@Argument(value = "Xreport-perf", description = "Report detailed performance statistics")
|
@Argument(value = "Xreport-perf", description = "Report detailed performance statistics")
|
||||||
public boolean reportPerf;
|
public boolean reportPerf;
|
||||||
|
|
||||||
|
@Argument(value = "Xmultifile-parts-inherit", description = "Compile multifile classes as a hierarchy of parts and facade")
|
||||||
|
public boolean inheritMultifileParts;
|
||||||
|
|
||||||
@Argument(value = "Xallow-kotlin-package", description = "Allow compiling code in package 'kotlin'")
|
@Argument(value = "Xallow-kotlin-package", description = "Allow compiling code in package 'kotlin'")
|
||||||
public boolean allowKotlinPackage;
|
public boolean allowKotlinPackage;
|
||||||
|
|
||||||
|
|||||||
@@ -280,6 +280,7 @@ open class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
|
|||||||
configuration.put(JVMConfigurationKeys.DISABLE_INLINE, arguments.noInline)
|
configuration.put(JVMConfigurationKeys.DISABLE_INLINE, arguments.noInline)
|
||||||
configuration.put(JVMConfigurationKeys.DISABLE_OPTIMIZATION, arguments.noOptimize)
|
configuration.put(JVMConfigurationKeys.DISABLE_OPTIMIZATION, arguments.noOptimize)
|
||||||
configuration.put(JVMConfigurationKeys.DECLARATIONS_JSON_PATH, arguments.declarationsOutputPath)
|
configuration.put(JVMConfigurationKeys.DECLARATIONS_JSON_PATH, arguments.declarationsOutputPath)
|
||||||
|
configuration.put(JVMConfigurationKeys.INHERIT_MULTIFILE_PARTS, arguments.inheritMultifileParts);
|
||||||
configuration.put(CLIConfigurationKeys.ALLOW_KOTLIN_PACKAGE, arguments.allowKotlinPackage);
|
configuration.put(CLIConfigurationKeys.ALLOW_KOTLIN_PACKAGE, arguments.allowKotlinPackage);
|
||||||
configuration.put(CLIConfigurationKeys.REPORT_PERF, arguments.reportPerf);
|
configuration.put(CLIConfigurationKeys.REPORT_PERF, arguments.reportPerf);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,10 +109,7 @@ class KotlinCoreEnvironment private constructor(
|
|||||||
private val sourceFiles = ArrayList<KtFile>()
|
private val sourceFiles = ArrayList<KtFile>()
|
||||||
private val javaRoots = ArrayList<JavaRoot>()
|
private val javaRoots = ArrayList<JavaRoot>()
|
||||||
|
|
||||||
val configuration: CompilerConfiguration = configuration.copy().let {
|
val configuration: CompilerConfiguration = configuration.copy().apply { setReadOnly(true) }
|
||||||
it.setReadOnly(true)
|
|
||||||
it
|
|
||||||
}
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
PersistentFSConstants.setMaxIntellisenseFileSize(FileUtilRt.LARGE_FOR_CONTENT_LOADING)
|
PersistentFSConstants.setMaxIntellisenseFileSize(FileUtilRt.LARGE_FOR_CONTENT_LOADING)
|
||||||
|
|||||||
@@ -399,6 +399,7 @@ object KotlinToJVMBytecodeCompiler {
|
|||||||
configuration.get(JVMConfigurationKeys.DISABLE_INLINE, false),
|
configuration.get(JVMConfigurationKeys.DISABLE_INLINE, false),
|
||||||
configuration.get(JVMConfigurationKeys.DISABLE_OPTIMIZATION, false),
|
configuration.get(JVMConfigurationKeys.DISABLE_OPTIMIZATION, false),
|
||||||
/* useTypeTableInSerializer = */ false,
|
/* useTypeTableInSerializer = */ false,
|
||||||
|
configuration.get(JVMConfigurationKeys.INHERIT_MULTIFILE_PARTS, false),
|
||||||
packagesWithObsoleteParts,
|
packagesWithObsoleteParts,
|
||||||
obsoleteMultifileClasses,
|
obsoleteMultifileClasses,
|
||||||
targetId,
|
targetId,
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ public class JVMConfigurationKeys {
|
|||||||
CompilerConfigurationKey.create("disable inline");
|
CompilerConfigurationKey.create("disable inline");
|
||||||
public static final CompilerConfigurationKey<Boolean> DISABLE_OPTIMIZATION =
|
public static final CompilerConfigurationKey<Boolean> DISABLE_OPTIMIZATION =
|
||||||
CompilerConfigurationKey.create("disable optimization");
|
CompilerConfigurationKey.create("disable optimization");
|
||||||
|
public static final CompilerConfigurationKey<Boolean> INHERIT_MULTIFILE_PARTS =
|
||||||
|
CompilerConfigurationKey.create("compile multifile classes to a hierarchy of parts and facade");
|
||||||
|
|
||||||
public static final CompilerConfigurationKey<IncrementalCompilationComponents> INCREMENTAL_COMPILATION_COMPONENTS =
|
public static final CompilerConfigurationKey<IncrementalCompilationComponents> INCREMENTAL_COMPILATION_COMPONENTS =
|
||||||
CompilerConfigurationKey.create("incremental cache provider");
|
CompilerConfigurationKey.create("incremental cache provider");
|
||||||
|
|||||||
+1
@@ -4,6 +4,7 @@ where advanced options include:
|
|||||||
-Xno-param-assertions Don't generate not-null assertions on parameters of methods accessible from Java
|
-Xno-param-assertions Don't generate not-null assertions on parameters of methods accessible from Java
|
||||||
-Xno-optimize Disable optimizations
|
-Xno-optimize Disable optimizations
|
||||||
-Xreport-perf Report detailed performance statistics
|
-Xreport-perf Report detailed performance statistics
|
||||||
|
-Xmultifile-parts-inherit Compile multifile classes as a hierarchy of parts and facade
|
||||||
-Xallow-kotlin-package Allow compiling code in package 'kotlin'
|
-Xallow-kotlin-package Allow compiling code in package 'kotlin'
|
||||||
-Xskip-metadata-version-check Try loading binary incompatible classes, may cause crashes
|
-Xskip-metadata-version-check Try loading binary incompatible classes, may cause crashes
|
||||||
-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
|
||||||
|
|||||||
Reference in New Issue
Block a user