JvmResolveUtil extracted for methods that are used only for tests

This commit is contained in:
Andrey Breslav
2014-04-22 19:55:50 +04:00
parent 2a3d1c1b18
commit af9694738e
14 changed files with 136 additions and 134 deletions
@@ -24,7 +24,7 @@ import org.jetbrains.jet.analyzer.AnalyzeExhaust;
import org.jetbrains.jet.cli.common.arguments.CompilerArgumentsUtil;
import org.jetbrains.jet.codegen.state.GenerationState;
import org.jetbrains.jet.lang.psi.JetFile;
import org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM;
import org.jetbrains.jet.lang.resolve.lazy.JvmResolveUtil;
import java.util.Collections;
import java.util.List;
@@ -41,14 +41,14 @@ public class GenerationUtils {
@NotNull
public static GenerationState compileFileGetGenerationStateForTest(@NotNull JetFile psiFile) {
AnalyzeExhaust analyzeExhaust = AnalyzerFacadeForJVM.analyzeOneFileWithJavaIntegrationAndCheckForErrors(
AnalyzeExhaust analyzeExhaust = JvmResolveUtil.analyzeOneFileWithJavaIntegrationAndCheckForErrors(
psiFile);
return compileFilesGetGenerationState(psiFile.getProject(), analyzeExhaust, Collections.singletonList(psiFile));
}
@NotNull
public static GenerationState compileManyFilesGetGenerationStateForTest(@NotNull Project project, @NotNull List<JetFile> files) {
AnalyzeExhaust analyzeExhaust = AnalyzerFacadeForJVM.analyzeFilesWithJavaIntegrationAndCheckForErrors(
AnalyzeExhaust analyzeExhaust = JvmResolveUtil.analyzeFilesWithJavaIntegrationAndCheckForErrors(
project, files, Predicates.<PsiFile>alwaysTrue());
return compileFilesGetGenerationState(project,analyzeExhaust, files);
}