Ability to generate light classes for scripts
This commit is contained in:
@@ -33,10 +33,8 @@ import java.util.Set;
|
||||
import static org.jetbrains.jet.codegen.binding.CodegenBinding.registerClassNameForScript;
|
||||
|
||||
public class KotlinCodegenFacade {
|
||||
public static void compileCorrectFiles(
|
||||
@NotNull GenerationState state,
|
||||
@NotNull CompilationErrorHandler errorHandler
|
||||
) {
|
||||
|
||||
public static void prepareForCompilation(@NotNull GenerationState state) {
|
||||
for (JetFile file : state.getFiles()) {
|
||||
if (file.isScript()) {
|
||||
// SCRIPT: register class name for scripting from this file, move outside of this function
|
||||
@@ -50,6 +48,13 @@ public class KotlinCodegenFacade {
|
||||
}
|
||||
|
||||
state.beforeCompile();
|
||||
}
|
||||
|
||||
public static void compileCorrectFiles(
|
||||
@NotNull GenerationState state,
|
||||
@NotNull CompilationErrorHandler errorHandler
|
||||
) {
|
||||
prepareForCompilation(state);
|
||||
|
||||
MultiMap<FqName, JetFile> packageFqNameToFiles = new MultiMap<FqName, JetFile>();
|
||||
for (JetFile file : state.getFiles()) {
|
||||
|
||||
+2
-1
@@ -42,6 +42,7 @@ import com.intellij.util.containers.Stack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.codegen.CompilationErrorHandler;
|
||||
import org.jetbrains.jet.codegen.KotlinCodegenFacade;
|
||||
import org.jetbrains.jet.codegen.PackageCodegen;
|
||||
import org.jetbrains.jet.codegen.binding.CodegenBinding;
|
||||
import org.jetbrains.jet.codegen.state.GenerationState;
|
||||
@@ -293,7 +294,7 @@ public class KotlinJavaFileStubProvider<T extends WithFileStubAndExtraDiagnostic
|
||||
null,
|
||||
forExtraDiagnostics
|
||||
);
|
||||
state.beforeCompile();
|
||||
KotlinCodegenFacade.prepareForCompilation(state);
|
||||
|
||||
bindingContext = state.getBindingContext();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user