001 /** 002 * 003 * Licensed to the Apache Software Foundation (ASF) under one or more 004 * contributor license agreements. See the NOTICE file distributed with 005 * this work for additional information regarding copyright ownership. 006 * The ASF licenses this file to You under the Apache License, Version 2.0 007 * (the "License"); you may not use this file except in compliance with 008 * the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, software 013 * distributed under the License is distributed on an "AS IS" BASIS, 014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 015 * See the License for the specific language governing permissions and 016 * limitations under the License. 017 */ 018 package org.jetbrains.jet.cli.jvm; 019 020 import com.sampullara.cli.Argument; 021 import org.jetbrains.jet.cli.common.CompilerArguments; 022 023 import java.util.List; 024 025 /** 026 * Command line arguments for the {@link K2JVMCompiler} 027 */ 028 @SuppressWarnings("UnusedDeclaration") 029 public class K2JVMCompilerArguments extends CompilerArguments { 030 031 032 // TODO ideally we'd unify this with 'src' to just having a single field that supports multiple files/dirs 033 private List<String> sourceDirs; 034 035 public List<String> getSourceDirs() { 036 return sourceDirs; 037 } 038 039 public void setSourceDirs(List<String> sourceDirs) { 040 this.sourceDirs = sourceDirs; 041 } 042 043 @Argument(value = "jar", description = "jar file name") 044 public String jar; 045 046 @Argument(value = "src", description = "source file or directory") 047 public String src; 048 049 @Argument(value = "classpath", description = "classpath to use when compiling") 050 public String classpath; 051 052 @Argument(value = "annotations", description = "paths to external annotations") 053 public String annotations; 054 055 @Argument(value = "includeRuntime", description = "include Kotlin runtime in to resulting jar") 056 public boolean includeRuntime; 057 058 @Argument(value = "noJdk", description = "don't include Java runtime into classpath") 059 public boolean noJdk; 060 061 @Argument(value = "noStdlib", description = "don't include Kotlin runtime into classpath") 062 public boolean noStdlib; 063 064 @Argument(value = "noJdkAnnotations", description = "don't include JDK external annotations into classpath") 065 public boolean noJdkAnnotations; 066 067 @Argument(value = "notNullAssertions", description = "generate not-null assertion after each invokation of method returning not-null") 068 public boolean notNullAssertions; 069 070 @Argument(value = "notNullParamAssertions", description = "generate not-null assertions on parameters of methods accessible from Java") 071 public boolean notNullParamAssertions; 072 073 @Argument(value = "builtins", description = "compile builtin classes (internal)") 074 public boolean builtins; 075 076 @Argument(value = "output", description = "output directory") 077 public String outputDir; 078 079 @Argument(value = "module", description = "module to compile") 080 public String module; 081 082 @Argument(value = "script", description = "evaluate script") 083 public boolean script; 084 085 @Argument(value = "tags", description = "Demarcate each compilation message (error, warning, etc) with an open and close tag") 086 public boolean tags; 087 088 @Argument(value = "verbose", description = "Enable verbose logging output") 089 public boolean verbose; 090 091 @Argument(value = "version", description = "Display compiler version") 092 public boolean version; 093 094 @Argument(value = "help", alias = "h", description = "show help") 095 public boolean help; 096 097 @Argument(value = "kotlinHome", description = "Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery") 098 public String kotlinHome; 099 100 public String getKotlinHome() { 101 return kotlinHome; 102 } 103 104 public void setKotlinHome(String kotlinHome) { 105 this.kotlinHome = kotlinHome; 106 } 107 108 public String getClasspath() { 109 return classpath; 110 } 111 112 public void setClasspath(String classpath) { 113 this.classpath = classpath; 114 } 115 116 @Override 117 public boolean isHelp() { 118 return help; 119 } 120 121 public void setHelp(boolean help) { 122 this.help = help; 123 } 124 125 public boolean isIncludeRuntime() { 126 return includeRuntime; 127 } 128 129 public void setIncludeRuntime(boolean includeRuntime) { 130 this.includeRuntime = includeRuntime; 131 } 132 133 public String getJar() { 134 return jar; 135 } 136 137 public void setJar(String jar) { 138 this.jar = jar; 139 } 140 141 public String getModule() { 142 return module; 143 } 144 145 public void setModule(String module) { 146 this.module = module; 147 } 148 149 public String getOutputDir() { 150 return outputDir; 151 } 152 153 public void setOutputDir(String outputDir) { 154 this.outputDir = outputDir; 155 } 156 157 public String getSrc() { 158 return src; 159 } 160 161 public void setSrc(String src) { 162 this.src = src; 163 } 164 165 @Override 166 public boolean isTags() { 167 return tags; 168 } 169 170 @Override 171 public boolean isVersion() { 172 return version; 173 } 174 175 @Override 176 public boolean isVerbose() { 177 return verbose; 178 } 179 180 public void setTags(boolean tags) { 181 this.tags = tags; 182 } 183 184 public void setNoStdlib(boolean noStdlib) { 185 this.noStdlib = noStdlib; 186 } 187 }