Make KDoc generate documentation on red code
KDoc is not a compiler, so it should not care whether or not the code is valid. Therefore suppress the compiler's exit code, errors and warnings in KDoc plugin
This commit is contained in:
+10
-1
@@ -206,7 +206,7 @@ public abstract class KotlinCompileMojoBase extends AbstractMojo {
|
||||
}
|
||||
};
|
||||
|
||||
final ExitCode exitCode = compiler.exec(messageCollector, arguments);
|
||||
final ExitCode exitCode = executeCompiler(compiler, arguments, messageCollector);
|
||||
|
||||
switch (exitCode) {
|
||||
case COMPILATION_ERROR:
|
||||
@@ -258,6 +258,15 @@ public abstract class KotlinCompileMojoBase extends AbstractMojo {
|
||||
return new K2JVMCompilerArguments();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected ExitCode executeCompiler(
|
||||
@NotNull CLICompiler compiler,
|
||||
@NotNull CommonCompilerArguments arguments,
|
||||
@NotNull MessageCollector messageCollector
|
||||
) {
|
||||
return compiler.exec(messageCollector, arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* Derived classes can register custom plugins or configurations
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user