From 5d9fe393959c4c9c9bcbd04cef3115f7f834612f Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 18 Sep 2019 19:20:50 -0400 Subject: Added packaging machinery for the JVM compiler. --- new-luxc/source/program.lux | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'new-luxc/source/program.lux') diff --git a/new-luxc/source/program.lux b/new-luxc/source/program.lux index f22d9ef58..dd44128df 100644 --- a/new-luxc/source/program.lux +++ b/new-luxc/source/program.lux @@ -10,6 +10,8 @@ [parser [cli (#+ program:)]]] [data + [text + ["%" format (#+ format)]] [collection [array (#+ Array)] ["." dictionary]]] @@ -32,6 +34,7 @@ ["/." cli]]] [luxc [lang + ["." packager] [host ["_" jvm ["$d" def] @@ -132,8 +135,8 @@ $i.SWAP ($i.GOTO @loop) ($i.label @end) - $i.POP - ($i.ASTORE 0))) + $i.POP)) + feed-inputsI ($i.INVOKEVIRTUAL jvm.$Function runtime.apply-method (runtime.apply-signature 1)) run-ioI (|>> ($i.CHECKCAST jvm.$Function) $i.NULL ($i.INVOKEVIRTUAL jvm.$Function runtime.apply-method (runtime.apply-signature 1))) @@ -148,19 +151,24 @@ (list) $Object (list) (|>> ($d.method #_.Public _.staticM "main" main-type - (|>> prepare-input-listI - programI + (|>> programI + prepare-input-listI + feed-inputsI run-ioI - $i.POP $i.RETURN))))])) (program: [{service /cli.service}] - (/.compiler @.jvm - ".jvm" - ..expander - analysis.bundle - ..platform - translation.bundle - directive.bundle - ..program - service)) + (let [(^slots [#/cli.target #/cli.module]) (case service + (#/cli.Compilation configuration) configuration + (#/cli.Interpretation configuration) configuration) + jar-path (format target (:: file.system separator) "program.jar")] + (/.compiler @.jvm + ".jvm" + ..expander + analysis.bundle + ..platform + translation.bundle + directive.bundle + ..program + service + [(packager.package module) jar-path]))) -- cgit v1.2.3