minor refactoring to allow plugins to be added to the BytecodeCompiler
This commit is contained in:
@@ -18,6 +18,10 @@ package org.jetbrains.jet.buildtools.core;
|
||||
|
||||
import org.jetbrains.jet.compiler.CompileEnvironment;
|
||||
import org.jetbrains.jet.compiler.CompileEnvironmentException;
|
||||
import org.jetbrains.jet.compiler.CompilerPlugin;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@@ -25,6 +29,7 @@ import org.jetbrains.jet.compiler.CompileEnvironmentException;
|
||||
*/
|
||||
public class BytecodeCompiler {
|
||||
|
||||
private List<CompilerPlugin> compilerPlugins = new ArrayList<CompilerPlugin>();
|
||||
|
||||
public BytecodeCompiler () {
|
||||
}
|
||||
@@ -49,6 +54,9 @@ public class BytecodeCompiler {
|
||||
env.addToClasspath( classpath );
|
||||
}
|
||||
|
||||
// lets register any compiler plugins
|
||||
env.getMyEnvironment().getCompilerPlugins().addAll(getCompilerPlugins());
|
||||
|
||||
return env;
|
||||
}
|
||||
|
||||
@@ -108,4 +116,12 @@ public class BytecodeCompiler {
|
||||
public void moduleToJar ( String module, String jar, boolean includeRuntime, String stdlib, String[] classpath ) {
|
||||
env( stdlib, classpath ).compileModuleScript( module, jar, null, includeRuntime );
|
||||
}
|
||||
|
||||
public List<CompilerPlugin> getCompilerPlugins() {
|
||||
return compilerPlugins;
|
||||
}
|
||||
|
||||
public void setCompilerPlugins(List<CompilerPlugin> compilerPlugins) {
|
||||
this.compilerPlugins = compilerPlugins;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user