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
+7 -3
View File
@@ -16,14 +16,18 @@
import konan.internal.ExportForCppRuntime
external fun main(args: Array<String>)
// This function is produced by the code generator given
// the '-entry foo.bar.main' flag.
// It calls the requested entry point.
// The default is main(Array<String>):Unit in the root package.
@ExportForCppRuntime
external fun EntryPointSelector(args: Array<String>)
@ExportForCppRuntime
private fun Konan_start(args: Array<String>): Int {
try {
// This is kotlin program main entry point
main(args)
EntryPointSelector(args)
// Successfully finished:
return 0