Introduce ModuleContext, ProjectContext and use it some of the APIs

This commit is contained in:
Pavel V. Talanov
2015-05-15 17:17:09 +03:00
parent 9d22a39924
commit 01efbb1502
34 changed files with 450 additions and 574 deletions
@@ -320,11 +320,9 @@ public class KotlinToJVMBytecodeCompiler {
ModuleDescriptorImpl analyzeModule = TopDownAnalyzerFacadeForJVM.createSealedJavaModule();
return TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegrationWithCustomContext(
environment.getProject(),
ContextPackage.GlobalContext(),
ContextPackage.ModuleContext(analyzeModule, environment.getProject()),
environment.getSourceFiles(),
sharedTrace,
analyzeModule,
environment.getConfiguration().get(JVMConfigurationKeys.MODULE_IDS),
environment.getConfiguration().get(JVMConfigurationKeys.INCREMENTAL_CACHE_PROVIDER)
);
@@ -44,7 +44,7 @@ import org.jetbrains.kotlin.codegen.KotlinCodegenFacade;
import org.jetbrains.kotlin.codegen.state.GenerationState;
import org.jetbrains.kotlin.config.CompilerConfiguration;
import org.jetbrains.kotlin.context.ContextPackage;
import org.jetbrains.kotlin.context.GlobalContextImpl;
import org.jetbrains.kotlin.context.ModuleContext;
import org.jetbrains.kotlin.descriptors.ScriptDescriptor;
import org.jetbrains.kotlin.descriptors.impl.CompositePackageFragmentProvider;
import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl;
@@ -110,7 +110,7 @@ public class ReplInterpreter {
this.trace = new CliLightClassGenerationSupport.NoScopeRecordCliBindingTrace();
this.module = TopDownAnalyzerFacadeForJVM.createJavaModule("<repl>");
GlobalContextImpl context = ContextPackage.GlobalContext();
ModuleContext context = ContextPackage.ModuleContext(module, project);
scriptDeclarationFactory = new ScriptMutableDeclarationProviderFactory();
@@ -123,10 +123,8 @@ public class ReplInterpreter {
};
InjectorForReplWithJava injector = new InjectorForReplWithJava(
project,
context,
trace,
module,
scriptDeclarationFactory,
ProjectScope.getAllScope(project),
scopeProvider