001    /*
002     * Copyright 2010-2013 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.jet.cli.common.arguments;
018    
019    import com.sampullara.cli.Argument;
020    import org.jetbrains.annotations.NotNull;
021    import org.jetbrains.annotations.Nullable;
022    
023    import static org.jetbrains.jet.cli.common.arguments.K2JsArgumentConstants.CALL;
024    import static org.jetbrains.jet.cli.common.arguments.K2JsArgumentConstants.NO_CALL;
025    
026    public class K2JSCompilerArguments extends CommonCompilerArguments {
027        @Argument(value = "output", description = "Output file path")
028        @ValueDescription("<path>")
029        public String outputFile;
030    
031        @Argument(value = "library-files", description = "Path to zipped library sources or kotlin files separated by commas")
032        @ValueDescription("<path[,]>")
033        public String[] libraryFiles;
034    
035        @Argument(value = "source-map", description = "Generate source map")
036        public boolean sourceMap;
037    
038        @Argument(value = "target", description = "Generate JS files for specific ECMA version (only ECMA 5 is supported)")
039        @ValueDescription("<version>")
040        public String target;
041    
042        @Nullable
043        @Argument(value = "main", description = "Whether a main function should be called; default '" + CALL + "' (main function will be auto detected)")
044        @ValueDescription("{" + CALL + "," + NO_CALL + "}")
045        public String main;
046    
047        @Argument(value = "output-prefix", description = "Path to file which will be added to the beginning of output file")
048        @ValueDescription("<path>")
049        public String outputPrefix;
050    
051        @Argument(value = "output-postfix", description = "Path to file which will be added to the end of output file")
052        @ValueDescription("<path>")
053        public String outputPostfix;
054    
055        @Override
056        @NotNull
057        public String executableScriptFileName() {
058            return "kotlinc-js";
059        }
060    }