Simplify public methods of KotlinToJVMBytecodeCompiler
Pass as much as possible in the single CompilerConfiguration instance instead of in separate function parameters. Add corresponding keys to JVMConfigurationKeys. Re changes in compileModules: since output directory (stored now under the key OUTPUT_DIRECTORY) is different for each module, the configuration of the whole project is no longer applicable when compiling individual modules. Thus we copy the project configuration for each module and add the output directory value
This commit is contained in:
@@ -19,12 +19,20 @@ package org.jetbrains.kotlin.config;
|
||||
import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCompilationComponents;
|
||||
import org.jetbrains.kotlin.modules.Module;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
public class JVMConfigurationKeys {
|
||||
private JVMConfigurationKeys() {
|
||||
}
|
||||
|
||||
public static final CompilerConfigurationKey<File> OUTPUT_DIRECTORY =
|
||||
CompilerConfigurationKey.create("output directory");
|
||||
public static final CompilerConfigurationKey<File> OUTPUT_JAR =
|
||||
CompilerConfigurationKey.create("output .jar");
|
||||
public static final CompilerConfigurationKey<Boolean> INCLUDE_RUNTIME =
|
||||
CompilerConfigurationKey.create("include runtime to the resulting .jar");
|
||||
|
||||
public static final CompilerConfigurationKey<Boolean> DISABLE_CALL_ASSERTIONS =
|
||||
CompilerConfigurationKey.create("disable not-null call assertions");
|
||||
public static final CompilerConfigurationKey<Boolean> DISABLE_PARAM_ASSERTIONS =
|
||||
@@ -41,7 +49,7 @@ public class JVMConfigurationKeys {
|
||||
public static final CompilerConfigurationKey<IncrementalCompilationComponents> INCREMENTAL_COMPILATION_COMPONENTS =
|
||||
CompilerConfigurationKey.create("incremental cache provider");
|
||||
|
||||
public static final CompilerConfigurationKey<String> MODULE_XML_FILE_PATH =
|
||||
public static final CompilerConfigurationKey<File> MODULE_XML_FILE =
|
||||
CompilerConfigurationKey.create("path to module.xml");
|
||||
|
||||
public static final CompilerConfigurationKey<String> DECLARATIONS_JSON_PATH =
|
||||
@@ -50,6 +58,9 @@ public class JVMConfigurationKeys {
|
||||
public static final CompilerConfigurationKey<List<Module>> MODULES =
|
||||
CompilerConfigurationKey.create("module data");
|
||||
|
||||
public static final CompilerConfigurationKey<List<String>> FRIEND_PATHS =
|
||||
CompilerConfigurationKey.create("friend module paths");
|
||||
|
||||
public static final CompilerConfigurationKey<String> MODULE_NAME =
|
||||
CompilerConfigurationKey.create("module name");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user