From 86bcfadb774618defaa27bbb9361a93d288fb985 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 12 Jul 2021 22:51:25 -0400 Subject: A bit more clarity for Licentia licenses. --- stdlib/source/program/aedifex/command/auto.lux | 6 +-- stdlib/source/program/aedifex/command/build.lux | 20 +++++---- stdlib/source/program/aedifex/command/test.lux | 57 +++++++++++++------------ 3 files changed, 44 insertions(+), 39 deletions(-) (limited to 'stdlib/source/program/aedifex/command') diff --git a/stdlib/source/program/aedifex/command/auto.lux b/stdlib/source/program/aedifex/command/auto.lux index 398fb26cf..ee2ab4bbd 100644 --- a/stdlib/source/program/aedifex/command/auto.lux +++ b/stdlib/source/program/aedifex/command/auto.lux @@ -12,7 +12,7 @@ ["." set]]] [world [program (#+ Program)] - [shell (#+ Shell)] + [shell (#+ Exit Shell)] [console (#+ Console)] ["." file ["." watch (#+ Watcher)]]]] @@ -45,8 +45,8 @@ (def: #export (do! delay watcher command) (All [a] (-> Nat (Watcher Promise) - (-> (Console Promise) (Program Promise) (file.System Promise) (Shell Promise) Resolution (Command a)) - (-> (Console Promise) (Program Promise) (file.System Promise) (Shell Promise) Resolution (Command Any)))) + (-> (Console Promise) (Program Promise) (file.System Promise) (Shell Promise) Resolution (Command [Exit a])) + (-> (Console Promise) (Program Promise) (file.System Promise) (Shell Promise) Resolution (Command [Exit Any])))) (function (_ console program fs shell resolution) (function (_ profile) (with_expansions [ ((command console program fs shell resolution) profile)] diff --git a/stdlib/source/program/aedifex/command/build.lux b/stdlib/source/program/aedifex/command/build.lux index 2f603dbc1..34351f636 100644 --- a/stdlib/source/program/aedifex/command/build.lux +++ b/stdlib/source/program/aedifex/command/build.lux @@ -23,7 +23,7 @@ [world ["." program (#+ Program)] ["." file (#+ Path)] - ["." shell (#+ Process Shell)] + ["." shell (#+ Exit Process Shell)] ["." console (#+ Console)] [net ["." uri]]]] @@ -169,7 +169,7 @@ ) (def: #export (do! console program fs shell resolution) - (-> (Console Promise) (Program Promise) (file.System Promise) (Shell Promise) Resolution (Command [Compiler Path])) + (-> (Console Promise) (Program Promise) (file.System Promise) (Shell Promise) Resolution (Command [Exit Compiler Path])) (function (_ profile) (let [target (get@ #///.target profile)] (case (get@ #///.program profile) @@ -186,13 +186,14 @@ #let [[[command compiler_params] output] (case compiler (^template [ ] [( dependency) - [( (..path fs home dependency)) + [(///runtime.for (get@ profile) + (..path fs home dependency)) ]]) - ([#JVM ///runtime.java "program.jar"] - [#JS ///runtime.node "program.js"] - [#Python ///runtime.java "program.py"] - [#Lua ///runtime.java "program.lua"] - [#Ruby ///runtime.java "program.rb"])) + ([#JVM #///.java "program.jar"] + [#JS #///.js "program.js"] + [#Python #///.java "program.py"] + [#Lua #///.java "program.lua"] + [#Ruby #///.java "program.rb"])) / (\ fs separator) cache_directory (format working_directory / target)] _ (console.write_line ..start console) @@ -212,5 +213,6 @@ ..success ..failure) console)] - (wrap [compiler + (wrap [exit + compiler (format cache_directory / output)]))))))) diff --git a/stdlib/source/program/aedifex/command/test.lux b/stdlib/source/program/aedifex/command/test.lux index 0ccc0cfb2..55614ba80 100644 --- a/stdlib/source/program/aedifex/command/test.lux +++ b/stdlib/source/program/aedifex/command/test.lux @@ -14,7 +14,7 @@ [world ["." program (#+ Program)] ["." file] - ["." shell (#+ Shell)] + ["." shell (#+ Exit Shell)] ["." console (#+ Console)]]] ["." // #_ ["#." build] @@ -31,32 +31,35 @@ (def: #export failure "[TEST FAILED]") (def: #export (do! console program fs shell resolution profile) - (-> (Console Promise) (Program Promise) (file.System Promise) (Shell Promise) Resolution (Command Any)) + (-> (Console Promise) (Program Promise) (file.System Promise) (Shell Promise) Resolution (Command [Exit Any])) (do promise.monad [environment (program.environment promise.monad program) #let [working_directory (\ program directory)]] - (do ///action.monad - [[compiler program] (//build.do! console program fs shell resolution - (set@ #///.program (get@ #///.test profile) profile)) - _ (console.write_line ..start console) - #let [[compiler_command compiler_parameters] (case compiler - (^template [ ] - [( artifact) - ( program)]) - ([#//build.JVM ///runtime.java] - [#//build.JS ///runtime.node] - [#//build.Python ///runtime.python] - [#//build.Lua ///runtime.lua] - [#//build.Ruby ///runtime.ruby]))] - process (\ shell execute [environment - working_directory - compiler_command - compiler_parameters]) - _ (//build.log_output! console process) - _ (//build.log_error! console process) - exit (\ process await []) - _ (console.write_line (if (i.= shell.normal exit) - ..success - ..failure) - console)] - (wrap [])))) + (do {! ///action.monad} + [[build_exit compiler program] (//build.do! console program fs shell resolution + (set@ #///.program (get@ #///.test profile) profile))] + (if (i.= shell.normal build_exit) + (do ! + [_ (console.write_line ..start console) + #let [[compiler_command compiler_parameters] (case compiler + (^template [ ] + [( artifact) + (///runtime.for (get@ profile) program)]) + ([#//build.JVM #///.java] + [#//build.JS #///.js] + [#//build.Python #///.python] + [#//build.Lua #///.lua] + [#//build.Ruby #///.ruby]))] + process (\ shell execute [environment + working_directory + compiler_command + compiler_parameters]) + _ (//build.log_output! console process) + _ (//build.log_error! console process) + exit (\ process await []) + _ (console.write_line (if (i.= shell.normal exit) + ..success + ..failure) + console)] + (wrap [exit []])) + (wrap [build_exit []]))))) -- cgit v1.2.3