Initial checkin of klib support.

The libraries exist in two incarnations:
    packed foo.klib and unpacked foo/ .
The compiler when given '-library foo' expects to find either
a foo.klib file and unpack it, or an already unpacked foo/ directory.

The stdlib is always unpacked in dist/klib .

The semantics of -o has changed slightly.
It now accepts '-o foo' and the compiler
either produces foo.kexe or foo.klib .
This commit is contained in:
Alexander Gorshenev
2017-04-27 16:14:17 +03:00
committed by alexander-gorshenev
parent 77e093354f
commit 3b5ce031f8
24 changed files with 564 additions and 203 deletions
@@ -117,7 +117,7 @@ abstract class KonanTest extends JavaExec {
}
String buildExePath() {
def exeName = project.file(source).name.replace(".kt", ".kt.exe")
def exeName = project.file(source).name.replace(".kt", "")
return "$outputDirectory/$exeName"
}
@@ -206,9 +206,10 @@ fun handleExceptionContinuation(x: (Throwable) -> Unit): Continuation<Any?> = ob
@TaskAction
void executeTest() {
createOutputDirectory()
def exe = buildExePath()
def program = buildExePath()
def exe = "${program}.kexe"
compileTest(buildCompileList(), exe)
compileTest(buildCompileList(), program)
if (!run) {
println "to be executed manually: $exe"