From 13323c55a4d34ddb74b67fab684d4431f9624dd1 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 29 Nov 2021 17:53:01 -0400 Subject: New packaging for Ruby programs. --- stdlib/source/program/aedifex/command/build.lux | 7 +++- stdlib/source/program/aedifex/command/test.lux | 50 ++++++++++++------------- stdlib/source/program/compositor.lux | 14 ++++++- 3 files changed, 43 insertions(+), 28 deletions(-) (limited to 'stdlib/source/program') 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 [ ] [{ artifact} (///runtime.for (value@ 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}))) -- cgit v1.2.3