Default module name extraction
This commit is contained in:
@@ -39,6 +39,7 @@ import org.jetbrains.kotlin.config.CompilerConfiguration
|
||||
import org.jetbrains.kotlin.config.IncrementalCompilation
|
||||
import org.jetbrains.kotlin.config.Services
|
||||
import org.jetbrains.kotlin.config.addKotlinSourceRoot
|
||||
import org.jetbrains.kotlin.load.java.JvmAbi
|
||||
import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCompilationComponents
|
||||
import org.jetbrains.kotlin.resolve.AnalyzerScriptParameter
|
||||
import org.jetbrains.kotlin.util.PerformanceCounter
|
||||
@@ -134,7 +135,7 @@ public open class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
|
||||
else
|
||||
emptyList<AnalyzerScriptParameter>())
|
||||
|
||||
configuration.put(JVMConfigurationKeys.MODULE_NAME, arguments.moduleName ?: "main")
|
||||
configuration.put(JVMConfigurationKeys.MODULE_NAME, arguments.moduleName ?: JvmAbi.DEFAULT_MODULE_NAME)
|
||||
|
||||
putAdvancedOptions(configuration, arguments)
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ public final class JvmAbi {
|
||||
public static final String KOTLIN_CLASS_FIELD_NAME = "$kotlinClass";
|
||||
public static final String KOTLIN_PACKAGE_FIELD_NAME = "$kotlinPackage";
|
||||
public static final String MODULE_NAME_FIELD = "$moduleName";
|
||||
public static final String DEFAULT_MODULE_NAME = "main";
|
||||
public static final ClassId REFLECTION_FACTORY_IMPL = ClassId.topLevel(new FqName("kotlin.reflect.jvm.internal.ReflectionFactoryImpl"));
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -19,6 +19,7 @@ package kotlin.reflect.jvm.internal;
|
||||
import kotlin.jvm.KotlinReflectionNotSupportedError;
|
||||
import kotlin.jvm.internal.*;
|
||||
import kotlin.reflect.*;
|
||||
import org.jetbrains.kotlin.load.java.JvmAbi;
|
||||
|
||||
/**
|
||||
* @suppress
|
||||
@@ -32,7 +33,7 @@ public class ReflectionFactoryImpl extends ReflectionFactory {
|
||||
|
||||
@Override
|
||||
public KPackage createKotlinPackage(Class javaClass) {
|
||||
return createKotlinPackage(javaClass, "main");
|
||||
return createKotlinPackage(javaClass, JvmAbi.DEFAULT_MODULE_NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user