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.CommonCompilerArguments; 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 CommonCompilerArguments { 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 (allows many paths separated by the system path separator)") 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 = "output", description = "output directory") 074 public String outputDir; 075 076 @Argument(value = "module", description = "module to compile") 077 public String module; 078 079 @Argument(value = "script", description = "evaluate script") 080 public boolean script; 081 082 @Argument(value = "kotlinHome", description = "Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery") 083 public String kotlinHome; 084 085 public String getKotlinHome() { 086 return kotlinHome; 087 } 088 089 public void setKotlinHome(String kotlinHome) { 090 this.kotlinHome = kotlinHome; 091 } 092 093 public String getClasspath() { 094 return classpath; 095 } 096 097 public void setClasspath(String classpath) { 098 this.classpath = classpath; 099 } 100 101 public boolean isIncludeRuntime() { 102 return includeRuntime; 103 } 104 105 public void setIncludeRuntime(boolean includeRuntime) { 106 this.includeRuntime = includeRuntime; 107 } 108 109 public String getJar() { 110 return jar; 111 } 112 113 public void setJar(String jar) { 114 this.jar = jar; 115 } 116 117 public String getModule() { 118 return module; 119 } 120 121 public void setModule(String module) { 122 this.module = module; 123 } 124 125 public String getOutputDir() { 126 return outputDir; 127 } 128 129 public void setOutputDir(String outputDir) { 130 this.outputDir = outputDir; 131 } 132 133 @Override 134 public String getSrc() { 135 return src; 136 } 137 138 public void setSrc(String src) { 139 this.src = src; 140 } 141 142 public void setNoStdlib(boolean noStdlib) { 143 this.noStdlib = noStdlib; 144 } 145 }