From 6ac46f2f385815f6b51bef9c81435d283c598459 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 18 Sep 2019 22:10:08 -0400 Subject: Now generating a "LuxProgram" class, instead of a "_" class. --- new-luxc/source/luxc/lang/packager.lux | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'new-luxc/source/luxc/lang/packager.lux') 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)) -- cgit v1.2.3