Get rid of getModuleName(), pass configuration to createContextWithSealedModule
Add KotlinTestUtils.newConfiguration() which creates a configuration and sets
the module name to the default test one ("test-module")
This commit is contained in:
+5
-3
@@ -138,12 +138,14 @@ public enum TopDownAnalyzerFacadeForJVM {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static MutableModuleContext createContextWithSealedModule(@NotNull Project project, @NotNull String moduleName) {
|
||||
public static MutableModuleContext createContextWithSealedModule(
|
||||
@NotNull Project project, @NotNull CompilerConfiguration configuration
|
||||
) {
|
||||
ProjectContext projectContext = ContextKt.ProjectContext(project);
|
||||
JvmBuiltIns builtIns = new JvmBuiltIns(projectContext.getStorageManager());
|
||||
MutableModuleContext context = ContextKt.ContextForNewModule(
|
||||
projectContext, Name.special("<" + moduleName + ">"), JvmPlatform.INSTANCE,
|
||||
builtIns
|
||||
projectContext, Name.special("<" + configuration.getNotNull(JVMConfigurationKeys.MODULE_NAME) + ">"),
|
||||
JvmPlatform.INSTANCE, builtIns
|
||||
);
|
||||
builtIns.setOwnerModuleDescriptor(context.getModule());
|
||||
context.setDependencies(context.getModule(), context.getBuiltIns().getBuiltInsModule());
|
||||
|
||||
Reference in New Issue
Block a user