CLI: removed unnecessary code that depended on KT-1863 and KT-2498.
This commit is contained in:
@@ -97,7 +97,6 @@ public abstract class CLICompiler<A extends CompilerArguments> {
|
||||
* Strategy method to configure the environment, allowing compiler
|
||||
* based tools to customise their own plugins
|
||||
*/
|
||||
//TODO: add parameter annotations when KT-1863 is resolved
|
||||
protected void configureEnvironment(@NotNull CompilerConfiguration configuration, @NotNull A arguments) {
|
||||
configuration.addAll(CLIConfigurationKeys.COMPILER_PLUGINS, compilerPlugins);
|
||||
}
|
||||
@@ -158,9 +157,8 @@ public abstract class CLICompiler<A extends CompilerArguments> {
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: can't declare parameters as not null due to KT-1863
|
||||
@NotNull
|
||||
protected abstract ExitCode doExecute(A arguments, MessageCollector messageCollector, Disposable rootDisposable);
|
||||
protected abstract ExitCode doExecute(@NotNull A arguments, @NotNull MessageCollector messageCollector, @NotNull Disposable rootDisposable);
|
||||
|
||||
//TODO: can we make it private?
|
||||
@NotNull
|
||||
|
||||
@@ -67,7 +67,11 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected ExitCode doExecute(K2JSCompilerArguments arguments, MessageCollector messageCollector, Disposable rootDisposable) {
|
||||
protected ExitCode doExecute(
|
||||
@NotNull K2JSCompilerArguments arguments,
|
||||
@NotNull MessageCollector messageCollector,
|
||||
@NotNull Disposable rootDisposable
|
||||
) {
|
||||
if (arguments.sourceFiles == null) {
|
||||
messageCollector.report(CompilerMessageSeverity.ERROR, "Specify sources location via -sourceFiles", NO_LOCATION);
|
||||
return ExitCode.INTERNAL_ERROR;
|
||||
|
||||
@@ -36,7 +36,6 @@ import org.jetbrains.jet.utils.KotlinPathsFromHomeDir;
|
||||
import org.jetbrains.jet.utils.PathUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.PrintStream;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -54,7 +53,11 @@ public class K2JVMCompiler extends CLICompiler<K2JVMCompilerArguments> {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
protected ExitCode doExecute(K2JVMCompilerArguments arguments, MessageCollector messageCollector, Disposable rootDisposable) {
|
||||
protected ExitCode doExecute(
|
||||
@NotNull K2JVMCompilerArguments arguments,
|
||||
@NotNull MessageCollector messageCollector,
|
||||
@NotNull Disposable rootDisposable
|
||||
) {
|
||||
KotlinPaths paths = arguments.kotlinHome != null
|
||||
? new KotlinPathsFromHomeDir(new File(arguments.kotlinHome))
|
||||
: PathUtil.getKotlinPathsForCompiler();
|
||||
@@ -166,21 +169,6 @@ public class K2JVMCompiler extends CLICompiler<K2JVMCompilerArguments> {
|
||||
return new K2JVMCompilerArguments();
|
||||
}
|
||||
|
||||
// TODO this method is here only to workaround KT-2498
|
||||
@Override
|
||||
protected void configureEnvironment(@NotNull CompilerConfiguration configuration, @NotNull K2JVMCompilerArguments arguments) {
|
||||
super.configureEnvironment(configuration, arguments);
|
||||
}
|
||||
|
||||
//TODO: Hacked! Be sure that our kotlin stuff builds correctly before you remove.
|
||||
// our compiler throws method not found error
|
||||
// probably relates to KT-1863... well, may be not
|
||||
@NotNull
|
||||
@Override
|
||||
public ExitCode exec(@NotNull PrintStream errStream, @NotNull K2JVMCompilerArguments arguments) {
|
||||
return super.exec(errStream, arguments);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static List<File> getClasspath(@NotNull KotlinPaths paths, @NotNull K2JVMCompilerArguments arguments) {
|
||||
List<File> classpath = Lists.newArrayList();
|
||||
|
||||
Reference in New Issue
Block a user