001    /*
002     * Copyright 2010-2015 JetBrains s.r.o.
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     * http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    
017    package org.jetbrains.kotlin.cli.common.arguments;
018    
019    import com.sampullara.cli.Argument;
020    import org.jetbrains.annotations.NotNull;
021    
022    public class K2JVMCompilerArguments extends CommonCompilerArguments {
023        @Argument(value = "d", description = "Destination for generated class files")
024        @ValueDescription("<directory|jar>")
025        public String destination;
026    
027        @Argument(value = "classpath", alias = "cp", description = "Paths where to find user class files")
028        @ValueDescription("<path>")
029        public String classpath;
030    
031        @Argument(value = "annotations", description = "Paths to external annotations")
032        @ValueDescription("<path>")
033        public String annotations;
034    
035        @Argument(value = "include-runtime", description = "Include Kotlin runtime in to resulting .jar")
036        public boolean includeRuntime;
037    
038        @Argument(value = "no-jdk", description = "Don't include Java runtime into classpath")
039        public boolean noJdk;
040    
041        @Argument(value = "no-stdlib", description = "Don't include Kotlin runtime into classpath")
042        public boolean noStdlib;
043    
044        @Argument(value = "no-jdk-annotations", description = "Don't include JDK external annotations into classpath")
045        public boolean noJdkAnnotations;
046    
047        @Argument(value = "module", description = "Path to the module file to compile")
048        @ValueDescription("<path>")
049        public String module;
050    
051        @Argument(value = "script", description = "Evaluate the script file")
052        public boolean script;
053    
054        @Argument(value = "kotlin-home", description = "Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery")
055        @ValueDescription("<path>")
056        public String kotlinHome;
057    
058        @Argument(value = "module-name", description = "Module name")
059        public String moduleName;
060    
061        // Advanced options
062    
063        @Argument(value = "Xno-call-assertions", description = "Don't generate not-null assertion after each invocation of method returning not-null")
064        public boolean noCallAssertions;
065    
066        @Argument(value = "Xno-param-assertions", description = "Don't generate not-null assertions on parameters of methods accessible from Java")
067        public boolean noParamAssertions;
068    
069        @Argument(value = "Xno-optimize", description = "Disable optimizations")
070        public boolean noOptimize;
071    
072        @Argument(value = "Xmultifile-package-facades", description = "Compile package facade classes as multifile classes")
073        public boolean packageFacadesAsMultifileClasses;
074    
075        @Argument(value = "Xreport-perf", description = "Report detailed performance statistics")
076        public boolean reportPerf;
077    
078        @Override
079        @NotNull
080        public String executableScriptFileName() {
081            return "kotlinc-jvm";
082        }
083    
084    }