aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/program.lux
diff options
context:
space:
mode:
authorEduardo Julian2019-09-18 19:20:50 -0400
committerEduardo Julian2019-09-18 19:20:50 -0400
commit5d9fe393959c4c9c9bcbd04cef3115f7f834612f (patch)
treea683700f7221a5410a65502d73d3d46016951b3c /new-luxc/source/program.lux
parentf0a95ee657fef968df1f5f88dc741256e1153e63 (diff)
Added packaging machinery for the JVM compiler.
Diffstat (limited to 'new-luxc/source/program.lux')
-rw-r--r--new-luxc/source/program.lux36
1 files changed, 22 insertions, 14 deletions
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])))