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 import org.jetbrains.annotations.Nullable;
022
023 import static org.jetbrains.kotlin.cli.common.arguments.K2JsArgumentConstants.CALL;
024 import static org.jetbrains.kotlin.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 = "no-stdlib", description = "Don't use bundled Kotlin stdlib")
032 public boolean noStdlib;
033
034 @Argument(value = "library-files", description = "Path to zipped library sources or kotlin files separated by commas")
035 @ValueDescription("<path[,]>")
036 public String[] libraryFiles;
037
038 @Argument(value = "source-map", description = "Generate source map")
039 public boolean sourceMap;
040
041 @Argument(value = "meta-info", description = "Generate metadata")
042 public boolean metaInfo;
043
044 @Argument(value = "kjsm", description = "Generate kjsm-files (for creating libraries)")
045 public boolean kjsm;
046
047 @Argument(value = "target", description = "Generate JS files for specific ECMA version (only ECMA 5 is supported)")
048 @ValueDescription("<version>")
049 public String target;
050
051 @Nullable
052 @Argument(value = "main", description = "Whether a main function should be called; default '" + CALL + "' (main function will be auto detected)")
053 @ValueDescription("{" + CALL + "," + NO_CALL + "}")
054 public String main;
055
056 @Argument(value = "output-prefix", description = "Path to file which will be added to the beginning of output file")
057 @ValueDescription("<path>")
058 public String outputPrefix;
059
060 @Argument(value = "output-postfix", description = "Path to file which will be added to the end of output file")
061 @ValueDescription("<path>")
062 public String outputPostfix;
063
064 @Override
065 @NotNull
066 public String executableScriptFileName() {
067 return "kotlinc-js";
068 }
069 }