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 = "target", description = "Generate JS files for specific ECMA version (only ECMA 5 is supported)")
045 @ValueDescription("<version>")
046 public String target;
047
048 @Nullable
049 @Argument(value = "main", description = "Whether a main function should be called; default '" + CALL + "' (main function will be auto detected)")
050 @ValueDescription("{" + CALL + "," + NO_CALL + "}")
051 public String main;
052
053 @Argument(value = "output-prefix", description = "Path to file which will be added to the beginning of output file")
054 @ValueDescription("<path>")
055 public String outputPrefix;
056
057 @Argument(value = "output-postfix", description = "Path to file which will be added to the end of output file")
058 @ValueDescription("<path>")
059 public String outputPostfix;
060
061 @Override
062 @NotNull
063 public String executableScriptFileName() {
064 return "kotlinc-js";
065 }
066 }