Add abstract methods to CompilerArguments. Add parameters to K2JSCompilerArguments.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.jet.cli.common;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.sampullara.cli.Argument;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
@@ -28,7 +29,6 @@ public abstract class CompilerArguments {
|
||||
@NotNull
|
||||
private List<CompilerPlugin> compilerPlugins = Lists.newArrayList();
|
||||
|
||||
|
||||
@NotNull
|
||||
public List<CompilerPlugin> getCompilerPlugins() {
|
||||
return compilerPlugins;
|
||||
@@ -40,4 +40,8 @@ public abstract class CompilerArguments {
|
||||
public void setCompilerPlugins(@NotNull List<CompilerPlugin> compilerPlugins) {
|
||||
this.compilerPlugins = compilerPlugins;
|
||||
}
|
||||
|
||||
public abstract boolean isHelp();
|
||||
public abstract boolean isTags();
|
||||
public abstract boolean isVersion();
|
||||
}
|
||||
|
||||
@@ -16,9 +16,43 @@
|
||||
|
||||
package org.jetbrains.jet.cli.js;
|
||||
|
||||
import com.sampullara.cli.Argument;
|
||||
import org.jetbrains.jet.cli.common.CompilerArguments;
|
||||
|
||||
/**
|
||||
* @author Pavel Talanov
|
||||
*/
|
||||
//TODO
|
||||
public class K2JSCompilerArguments {
|
||||
public class K2JSCompilerArguments extends CompilerArguments {
|
||||
@Argument(value = "output", description = "output directory")
|
||||
public String outputDir;
|
||||
|
||||
@Argument(value = "module", description = "module to compile")
|
||||
public String module;
|
||||
|
||||
@Argument(value = "tags", description = "Demarcate each compilation message (error, warning, etc) with an open and close tag")
|
||||
public boolean tags;
|
||||
|
||||
@Argument(value = "verbose", description = "Enable verbose logging output")
|
||||
public boolean verbose;
|
||||
|
||||
@Argument(value = "version", description = "Display compiler version")
|
||||
public boolean version;
|
||||
|
||||
@Argument(value = "help", alias = "h", description = "show help")
|
||||
public boolean help;
|
||||
|
||||
@Override
|
||||
public boolean isHelp() {
|
||||
return help;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVersion() {
|
||||
return version;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,18 +39,12 @@ public class K2JVMCompilerArguments extends CompilerArguments {
|
||||
this.sourceDirs = sourceDirs;
|
||||
}
|
||||
|
||||
@Argument(value = "output", description = "output directory")
|
||||
public String outputDir;
|
||||
|
||||
@Argument(value = "jar", description = "jar file name")
|
||||
public String jar;
|
||||
|
||||
@Argument(value = "src", description = "source file or directory")
|
||||
public String src;
|
||||
|
||||
@Argument(value = "module", description = "module to compile")
|
||||
public String module;
|
||||
|
||||
@Argument(value = "classpath", description = "classpath to use when compiling")
|
||||
public String classpath;
|
||||
|
||||
@@ -63,12 +57,15 @@ public class K2JVMCompilerArguments extends CompilerArguments {
|
||||
@Argument(value = "jdkHeaders", description = "Path to the kotlin-jdk-headers.jar")
|
||||
public String jdkHeaders;
|
||||
|
||||
@Argument(value = "help", alias = "h", description = "show help")
|
||||
public boolean help;
|
||||
|
||||
@Argument(value = "mode", description = "Special compiler modes: stubs or jdkHeaders")
|
||||
public String mode;
|
||||
|
||||
@Argument(value = "output", description = "output directory")
|
||||
public String outputDir;
|
||||
|
||||
@Argument(value = "module", description = "module to compile")
|
||||
public String module;
|
||||
|
||||
@Argument(value = "tags", description = "Demarcate each compilation message (error, warning, etc) with an open and close tag")
|
||||
public boolean tags;
|
||||
|
||||
@@ -78,6 +75,8 @@ public class K2JVMCompilerArguments extends CompilerArguments {
|
||||
@Argument(value = "version", description = "Display compiler version")
|
||||
public boolean version;
|
||||
|
||||
@Argument(value = "help", alias = "h", description = "show help")
|
||||
public boolean help;
|
||||
|
||||
public String getClasspath() {
|
||||
return classpath;
|
||||
@@ -87,6 +86,7 @@ public class K2JVMCompilerArguments extends CompilerArguments {
|
||||
this.classpath = classpath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHelp() {
|
||||
return help;
|
||||
}
|
||||
@@ -143,10 +143,16 @@ public class K2JVMCompilerArguments extends CompilerArguments {
|
||||
this.stdlib = stdlib;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setTags(boolean tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user