minor refactoring to allow plugins to be added to the BytecodeCompiler
This commit is contained in:
@@ -83,4 +83,18 @@ public class KDocLoader {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Installs the KDoc compiler plugin if it can be created
|
||||
*/
|
||||
public static boolean install(String docOutputDir, JetCoreEnvironment environment) {
|
||||
KDocLoader loader = new KDocLoader(docOutputDir);
|
||||
CompilerPlugin processor = loader.createCompilerPlugin();
|
||||
if (processor != null) {
|
||||
environment.getCompilerPlugins().add(processor);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,11 +132,7 @@ public class KotlinCompiler {
|
||||
environment.setStubs(arguments.stubs);
|
||||
|
||||
if (arguments.docOutputDir != null) {
|
||||
KDocLoader factory = new KDocLoader(arguments.docOutputDir);
|
||||
CompilerPlugin processor = factory.createCompilerPlugin();
|
||||
if (processor != null) {
|
||||
environment.getMyEnvironment().getCompilerPlugins().add(processor);
|
||||
}
|
||||
KDocLoader.install(arguments.docOutputDir, environment.getMyEnvironment());
|
||||
}
|
||||
|
||||
if (arguments.stdlib != null) {
|
||||
|
||||
Reference in New Issue
Block a user