aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program
diff options
context:
space:
mode:
authorEduardo Julian2021-11-29 17:53:01 -0400
committerEduardo Julian2021-11-29 17:53:01 -0400
commit13323c55a4d34ddb74b67fab684d4431f9624dd1 (patch)
tree2d5912a5a50640176507b8274293980c0376475b /stdlib/source/program
parentbd6ff5014b4d9fad6c6fa6ab3a2e30fc768687e1 (diff)
New packaging for Ruby programs.
Diffstat (limited to '')
-rw-r--r--stdlib/source/program/aedifex/command/build.lux7
-rw-r--r--stdlib/source/program/aedifex/command/test.lux50
-rw-r--r--stdlib/source/program/compositor.lux14
3 files changed, 43 insertions, 28 deletions
diff --git a/stdlib/source/program/aedifex/command/build.lux b/stdlib/source/program/aedifex/command/build.lux
index 9fbc34542..15a671615 100644
--- a/stdlib/source/program/aedifex/command/build.lux
+++ b/stdlib/source/program/aedifex/command/build.lux
@@ -23,6 +23,11 @@
[number
["n" nat]
["i" int]]]
+ [tool
+ [compiler
+ [meta
+ ["[0]" packager
+ ["[0]_[1]" ruby]]]]]
[world
["[0]" program {"+" Program}]
["[0]" file {"+" Path}]
@@ -291,7 +296,7 @@
([#JS ///.#js "program.js"]
[#Python ///.#java "program.py"]
[#Lua ///.#java "program.lua"]
- [#Ruby ///.#java "program.rb"]))
+ [#Ruby ///.#java (file.rooted fs "program" ruby_packager.main_file)]))
/ (# fs separator)
cache_directory (format working_directory / target)]
_ (console.write_line ..start console)
diff --git a/stdlib/source/program/aedifex/command/test.lux b/stdlib/source/program/aedifex/command/test.lux
index b2f67ba07..4aa1ecc54 100644
--- a/stdlib/source/program/aedifex/command/test.lux
+++ b/stdlib/source/program/aedifex/command/test.lux
@@ -1,28 +1,28 @@
(.using
- [library
- [lux "*"
- [abstract
- [monad {"+" do}]]
- [control
- [concurrency
- ["[0]" async {"+" Async} ("[1]#[0]" monad)]]]
- [math
- [number
- ["i" int]]]
- [world
- ["[0]" program {"+" Program}]
- ["[0]" file]
- ["[0]" shell {"+" Exit Shell}]
- ["[0]" console {"+" Console}]]]]
- ["[0]" // "_"
- ["[1][0]" build]
- ["/[1]" // "_"
- ["[1]" profile]
- ["[1][0]" action]
- ["[1][0]" command {"+" Command}]
- ["[1][0]" runtime]
- [dependency
- [resolution {"+" Resolution}]]]])
+ [library
+ [lux "*"
+ [abstract
+ [monad {"+" do}]]
+ [control
+ [concurrency
+ ["[0]" async {"+" Async} ("[1]#[0]" monad)]]]
+ [math
+ [number
+ ["i" int]]]
+ [world
+ ["[0]" program {"+" Program}]
+ ["[0]" file]
+ ["[0]" shell {"+" Exit Shell}]
+ ["[0]" console {"+" Console}]]]]
+ ["[0]" // "_"
+ ["[1][0]" build]
+ ["/[1]" // "_"
+ ["[1]" profile]
+ ["[1][0]" action]
+ ["[1][0]" command {"+" Command}]
+ ["[1][0]" runtime]
+ [dependency
+ [resolution {"+" Resolution}]]]])
(def: .public start "[TEST STARTED]")
(def: .public success "[TEST ENDED]")
@@ -46,7 +46,7 @@
(|> program
(///runtime.for (value@ ///.#java profile))
(//build.with_jvm_class_path host_dependencies))
-
+
(^template [<tag> <runtime>]
[{<tag> artifact}
(///runtime.for (value@ <runtime> profile)
diff --git a/stdlib/source/program/compositor.lux b/stdlib/source/program/compositor.lux
index 8e0077b4a..54fc903ad 100644
--- a/stdlib/source/program/compositor.lux
+++ b/stdlib/source/program/compositor.lux
@@ -5,7 +5,7 @@
["@" target]
["[0]" debug]
[abstract
- [monad {"+" do}]]
+ ["[0]" monad {"+" do}]]
[control
["[0]" io {"+" IO io}]
["[0]" try {"+" Try}]
@@ -87,7 +87,17 @@
(-> (file.System Async) (Dictionary file.Path Binary) [Packager file.Path] Static Archive Context (Async (Try Any)))
(case (packager host_dependencies archive context)
{try.#Success content}
- (# fs write content package)
+ (case content
+ {.#Left content}
+ (# fs write content package)
+
+ {.#Right content}
+ (do [! (try.with async.monad)]
+ [_ (# fs make_directory package)
+ _ (monad.each ! (function (_ [name content])
+ (# fs write content (file.rooted fs package name)))
+ content)]
+ (in [])))
{try.#Failure error}
(# async.monad in {try.#Failure error})))