aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--new-luxc/source/luxc/lang/packager.lux18
-rw-r--r--new-luxc/source/program.lux11
2 files changed, 14 insertions, 15 deletions
diff --git a/new-luxc/source/luxc/lang/packager.lux b/new-luxc/source/luxc/lang/packager.lux
index 3f8cb36cb..f18055b18 100644
--- a/new-luxc/source/luxc/lang/packager.lux
+++ b/new-luxc/source/luxc/lang/packager.lux
@@ -12,7 +12,7 @@
[target
[jvm
[encoding
- ["." name]]]]
+ ["." name (#+ External)]]]]
[tool
[compiler
[phase
@@ -71,16 +71,14 @@
(def: manifest-version "1.0")
(def: class-name
- (-> Module Text)
+ (-> Text Text)
(text.suffix ".class"))
-(def: main "_")
-
-(def: (manifest module)
- (-> Module java/util/jar/Manifest)
+(def: (manifest program-class)
+ (-> External java/util/jar/Manifest)
(let [manifest (java/util/jar/Manifest::new)]
(exec (do-to (java/util/jar/Manifest::getMainAttributes manifest)
- (java/util/jar/Attributes::put (java/util/jar/Attributes$Name::MAIN_CLASS) ..main)
+ (java/util/jar/Attributes::put (java/util/jar/Attributes$Name::MAIN_CLASS) program-class)
(java/util/jar/Attributes::put (java/util/jar/Attributes$Name::MANIFEST_VERSION) ..manifest-version))
manifest)))
@@ -99,10 +97,10 @@
row.to-list
(list@fold ..write-class sink)))
-(def: #export (package module outputs)
- (-> Module (Output Definition) Binary)
+(def: #export (package program-class outputs)
+ (-> External (Output Definition) Binary)
(let [buffer (java/io/ByteArrayOutputStream::new (.int mega-byte))
- sink (java/util/jar/JarOutputStream::new buffer (manifest module))]
+ sink (java/util/jar/JarOutputStream::new buffer (manifest program-class))]
(exec (|> outputs
row.to-list
(list@fold ..write-module sink))
diff --git a/new-luxc/source/program.lux b/new-luxc/source/program.lux
index dd44128df..91b42c981 100644
--- a/new-luxc/source/program.lux
+++ b/new-luxc/source/program.lux
@@ -91,6 +91,8 @@
#platform.phase expression.translate
#platform.runtime runtime.translate})))
+(def: program-class "LuxProgram")
+
(def: #export (program programI)
(-> _.Inst _.Definition)
(let [$Object ($t.class "java.lang.Object" (list))
@@ -142,12 +144,11 @@
($i.INVOKEVIRTUAL jvm.$Function runtime.apply-method (runtime.apply-signature 1)))
main-type ($t.method [(list ($t.array ($t.class "java.lang.String" (list))))
$t.void
- (list)])
- bytecode-name "_"]
- [bytecode-name
+ (list)])]
+ [..program-class
($d.class #_.V1_6
#_.Public _.finalC
- bytecode-name
+ ..program-class
(list) $Object
(list)
(|>> ($d.method #_.Public _.staticM "main" main-type
@@ -171,4 +172,4 @@
directive.bundle
..program
service
- [(packager.package module) jar-path])))
+ [(packager.package ..program-class) jar-path])))