Entry point selection.

$ kotlinc -entry foo.bar.qux ...

selects `qux(args: Array<String>):Unit` in the package `foo.bar` as an entry point.

The short flag is `-e`.
This commit is contained in:
Alexander Gorshenev
2017-06-01 18:45:54 +03:00
committed by alexander-gorshenev
parent a2fa4938f3
commit 5192bd1313
11 changed files with 205 additions and 3 deletions
@@ -122,6 +122,7 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
put(CommonConfigurationKeys.MODULE_NAME, output)
put(ABI_VERSION, 1)
arguments.mainPackage ?.let{ put(ENTRY, it) }
arguments.runtimeFile ?.let{ put(RUNTIME_FILE, it) }
arguments.propertyFile ?.let{ put(PROPERTY_FILE, it) }
@@ -57,6 +57,9 @@ class K2NativeCompilerArguments : CommonCompilerArguments() {
@field:Argument(value = "-output", shortName = "-o", valueDescription = "<path>", description = "Output file path")
@JvmField var outputFile: String? = null
@field:Argument(value = "-entry", shortName = "-e", valueDescription = "<name>", description = "Qualified entry point name")
@JvmField var mainPackage: String? = null
@field:Argument(value = "-produce", shortName = "-p", valueDescription = "{program|library|bitcode}", description = "Produce either .kexe, .klib or a .bc file.")
@JvmField var produce: String? = null