From 7db42ab1b9d3c764772ca63c74bf44bb2b8b8325 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 9 Jul 2022 14:35:38 -0400 Subject: First-class programs instead of having a "lux program" extension. --- stdlib/source/program/aedifex/command/build.lux | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'stdlib/source/program/aedifex/command/build.lux') diff --git a/stdlib/source/program/aedifex/command/build.lux b/stdlib/source/program/aedifex/command/build.lux index 9eae7660d..190ec3802 100644 --- a/stdlib/source/program/aedifex/command/build.lux +++ b/stdlib/source/program/aedifex/command/build.lux @@ -16,7 +16,7 @@ ["[0]" text (.use "[1]#[0]" order) ["%" \\format (.only format)]] [collection - ["[0]" list (.use "[1]#[0]" functor mix)] + ["[0]" list (.use "[1]#[0]" functor mix monoid)] ["[0]" dictionary (.only Dictionary)] ["[0]" set]]] [math @@ -34,7 +34,7 @@ ["[0]" packager (.only) ["[0]_[1]" ruby]]]]] [world - ["[0]" program (.only Program)] + ["[0]" environment (.only Environment)] ["[0]" file (.only Path)] ["[0]" shell (.only Exit Process Shell)] ["[0]" console (.only Console)] @@ -275,19 +275,19 @@ "--add-opens" "java.base/java.lang=ALL-UNNAMED")) runtime))) -(def .public (do! console program fs shell resolution) - (-> (Console Async) (Program Async) (file.System Async) (Shell Async) Resolution (Command [Exit Lux Path])) +(def .public (do! console environment fs shell resolution) + (-> (Console Async) (Environment Async) (file.System Async) (Shell Async) Resolution (Command [Exit Lux Path])) (function (_ profile) (let [target (the ///.#target profile)] (case (the ///.#program profile) {.#None} (async#in (exception.except ..no_specified_program [])) - {.#Some program_module} + {.#Some [program_module program_definition]} (do async.monad - [environment (program.environment async.monad program) - .let [home (at program home) - working_directory (at program directory)]] + [.let [home (at environment home) + working_directory (at environment directory)] + environment (environment.environment async.monad environment)] (do ///action.monad [[resolution lux] (async#in (..lux resolution (the ///.#lux profile))) .let [host_dependencies (..host_dependencies fs home resolution) @@ -320,7 +320,10 @@ (..plural "--compiler" (list#each compiler.format (the ///.#compilers profile))) (..plural "--source" (set.list (the ///.#sources profile))) (..singular "--target" cache_directory) - (..singular "--module" program_module) + (case program_module + "" (..singular "--module" program_definition) + _ (list#composite (..singular "--module" program_module) + (..singular "--program" program_definition))) (..singular "--configuration" (configuration.format (the ///.#configuration profile)))))] process (at shell execute [(dictionary.composite environment command_environment) working_directory -- cgit v1.2.3