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