aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/command
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/program/aedifex/command')
-rw-r--r--stdlib/source/program/aedifex/command/auto.lux2
-rw-r--r--stdlib/source/program/aedifex/command/build.lux63
-rw-r--r--stdlib/source/program/aedifex/command/clean.lux11
-rw-r--r--stdlib/source/program/aedifex/command/deploy.lux3
-rw-r--r--stdlib/source/program/aedifex/command/install.lux6
-rw-r--r--stdlib/source/program/aedifex/command/pom.lux49
-rw-r--r--stdlib/source/program/aedifex/command/test.lux44
-rw-r--r--stdlib/source/program/aedifex/command/version.lux6
8 files changed, 101 insertions, 83 deletions
diff --git a/stdlib/source/program/aedifex/command/auto.lux b/stdlib/source/program/aedifex/command/auto.lux
index e3cfaac74..7ae0c53d3 100644
--- a/stdlib/source/program/aedifex/command/auto.lux
+++ b/stdlib/source/program/aedifex/command/auto.lux
@@ -33,7 +33,7 @@
(# ! each (|>> (try.else (list))
(monad.each ! (targets fs))))
(# ! conjoint)
- (# ! each (|>> list.together (list& path))))))
+ (# ! each (|>> list.together (partial_list path))))))
(def: .public delay
Nat
diff --git a/stdlib/source/program/aedifex/command/build.lux b/stdlib/source/program/aedifex/command/build.lux
index 4538a2834..4ff240f96 100644
--- a/stdlib/source/program/aedifex/command/build.lux
+++ b/stdlib/source/program/aedifex/command/build.lux
@@ -143,7 +143,7 @@
(implementation: version_order
(Order Version)
- (def: &equivalence
+ (def: equivalence
text.equivalence)
(def: (< left right)
@@ -218,7 +218,8 @@
{try.#Failure error}
(if (exception.match? shell.no_more_output error)
(write! {try.#Success []})
- (async.upon! write! (console.write_line error console)))
+ (async.upon! write! (is (Async (Try Any))
+ (console.write_line error console))))
{try.#Success line}
(async.upon! (function (_ outcome)
@@ -229,7 +230,8 @@
{try.#Success _}
(async.upon! again
(# process <capability> []))))
- (console.write_line line console)))))
+ (is (Async (Try Any))
+ (console.write_line line console))))))
io.run!)]
read!))]
@@ -269,9 +271,9 @@
_
(revised ///runtime.#parameters
- (|>> (list& "-cp" (..jvm_class_path host_dependencies)
- "--add-opens" "java.base/java.lang=ALL-UNNAMED"
- "-Xss16m"))
+ (|>> (partial_list "-cp" (..jvm_class_path host_dependencies)
+ "--add-opens" "java.base/java.lang=ALL-UNNAMED"
+ "-Xss16m"))
runtime)))
(def: .public (do! console program fs shell resolution)
@@ -290,26 +292,28 @@
(do ///action.monad
[[resolution lux] (async#in (..lux resolution (the ///.#lux profile)))
.let [host_dependencies (..host_dependencies fs home resolution)
- [[command lux_params] output] (case lux
- {#JVM dependency}
- [(|> (the ///.#java profile)
- (has ///runtime.#parameters (list "program._"))
- (with_jvm_class_path {.#Item (..path fs home dependency) host_dependencies}))
- "program.jar"]
-
- (^.template [<tag> <runtime> <program>]
- [{<tag> dependency}
- [(|> dependency
- (..path fs home)
- (///runtime.for (the <runtime> profile)))
- <program>]])
- ([#JS ///.#js "program.js"]
- [#Python ///.#java "program.py"]
- [#Lua ///.#java "program.lua"]
- [#Ruby ///.#java (file.rooted fs "program" ruby_packager.main_file)]))
+ [[command_environment command lux_params] output]
+ (case lux
+ {#JVM dependency}
+ [(|> (the ///.#java profile)
+ (has ///runtime.#parameters (list "program._"))
+ (with_jvm_class_path {.#Item (..path fs home dependency) host_dependencies}))
+ "program.jar"]
+
+ (^.template [<tag> <runtime> <program>]
+ [{<tag> dependency}
+ [(|> dependency
+ (..path fs home)
+ (///runtime.for (the <runtime> profile)))
+ <program>]])
+ ([#JS ///.#js "program.js"]
+ [#Python ///.#java "program.py"]
+ [#Lua ///.#java "program.lua"]
+ [#Ruby ///.#java (file.rooted fs "program" ruby_packager.main_file)]))
/ (# fs separator)
cache_directory (format working_directory / target)]
- _ (console.write_line ..start console)
+ _ (is (Async (Try Any))
+ (console.write_line ..start console))
.let [full_parameters (list.together (list lux_params
(list "build")
(..plural "--library" (..libraries fs home resolution))
@@ -319,17 +323,18 @@
(..singular "--target" cache_directory)
(..singular "--module" program_module)
(..singular "--configuration" (configuration.format (the ///.#configuration profile)))))]
- process (# shell execute [environment
+ process (# shell execute [(dictionary.composite command_environment environment)
working_directory
command
full_parameters])
_ (..log_output! console process)
_ (..log_error! console process)
exit (# process await [])
- _ (console.write_line (if (i.= shell.normal exit)
- ..success
- ..failure)
- console)]
+ _ (is (Async (Try Any))
+ (console.write_line (if (i.= shell.normal exit)
+ ..success
+ ..failure)
+ console))]
(in [exit
lux
(format cache_directory / output)])))))))
diff --git a/stdlib/source/program/aedifex/command/clean.lux b/stdlib/source/program/aedifex/command/clean.lux
index 16bfce404..98f1461a8 100644
--- a/stdlib/source/program/aedifex/command/clean.lux
+++ b/stdlib/source/program/aedifex/command/clean.lux
@@ -20,11 +20,12 @@
(def: (clean_files! fs root)
(-> (file.System Async) Path (Async (Try Any)))
- (let [! ///action.monad]
- (|> root
- (# fs directory_files)
- (# ! each (monad.each ! (# fs delete)))
- (# ! conjoint))))
+ (do [! ///action.monad]
+ [_ (|> root
+ (# fs directory_files)
+ (# ! each (monad.each ! (# fs delete)))
+ (# ! conjoint))]
+ (in [])))
(def: .public success
(-> ///.Target Text)
diff --git a/stdlib/source/program/aedifex/command/deploy.lux b/stdlib/source/program/aedifex/command/deploy.lux
index eeecd1f8d..6fcd84e21 100644
--- a/stdlib/source/program/aedifex/command/deploy.lux
+++ b/stdlib/source/program/aedifex/command/deploy.lux
@@ -77,4 +77,5 @@
///package.#pom [pom
pom_data
(///dependency/status.verified pom_data)]]))]
- (console.write_line ..success console)))
+ (is (Async (Try Any))
+ (console.write_line ..success console))))
diff --git a/stdlib/source/program/aedifex/command/install.lux b/stdlib/source/program/aedifex/command/install.lux
index 6933264d3..41338674d 100644
--- a/stdlib/source/program/aedifex/command/install.lux
+++ b/stdlib/source/program/aedifex/command/install.lux
@@ -73,7 +73,9 @@
///package.#pom [pom
pom_data
(///dependency/status.verified pom_data)]]))]
- (console.write_line ..success console))
+ (is (Async (Try Any))
+ (console.write_line ..success console)))
_
- (console.write_line ..failure console)))
+ (is (Async (Try Any))
+ (console.write_line ..failure console))))
diff --git a/stdlib/source/program/aedifex/command/pom.lux b/stdlib/source/program/aedifex/command/pom.lux
index 20bad61fe..23c25e7e1 100644
--- a/stdlib/source/program/aedifex/command/pom.lux
+++ b/stdlib/source/program/aedifex/command/pom.lux
@@ -1,26 +1,26 @@
(.using
- [library
- [lux "*"
- [abstract
- [monad {"+" do}]]
- [control
- ["[0]" try ("[1]#[0]" functor)]
- [concurrency
- ["[0]" async {"+" Async} ("[1]#[0]" monad)]]]
- [data
- [text
- ["%" format {"+" format}]
- [encoding
- ["[0]" utf8]]]
- [format
- ["[0]" xml]]]
- [world
- ["[0]" file]
- ["[0]" console {"+" Console}]]]]
- ["[0]" /// "_"
- [command {"+" Command}]
- ["[1][0]" action]
- ["[1][0]" pom]])
+ [library
+ [lux "*"
+ [abstract
+ [monad {"+" do}]]
+ [control
+ ["[0]" try {"+" Try} ("[1]#[0]" functor)]
+ [concurrency
+ ["[0]" async {"+" Async} ("[1]#[0]" monad)]]]
+ [data
+ [text
+ ["%" format {"+" format}]
+ [encoding
+ ["[0]" utf8]]]
+ [format
+ ["[0]" xml]]]
+ [world
+ ["[0]" file]
+ ["[0]" console {"+" Console}]]]]
+ ["[0]" /// "_"
+ [command {"+" Command}]
+ ["[1][0]" action]
+ ["[1][0]" pom]])
(def: .public success
(format "Successfully created POM file: " ///pom.file))
@@ -32,5 +32,6 @@
(try#each (|>> (# xml.codec encoded)
(# utf8.codec encoded)))
async#in)
- _ (# fs write content ///pom.file)]
- (console.write_line ..success console)))
+ _ (# fs write ///pom.file content)]
+ (is (Async (Try Any))
+ (console.write_line ..success console))))
diff --git a/stdlib/source/program/aedifex/command/test.lux b/stdlib/source/program/aedifex/command/test.lux
index 3df3e0724..e6d36bfd8 100644
--- a/stdlib/source/program/aedifex/command/test.lux
+++ b/stdlib/source/program/aedifex/command/test.lux
@@ -4,8 +4,12 @@
[abstract
[monad {"+" do}]]
[control
+ [try {"+" Try}]
[concurrency
["[0]" async {"+" Async} ("[1]#[0]" monad)]]]
+ [data
+ [collection
+ ["[0]" dictionary]]]
[macro
["^" pattern]]
[math
@@ -41,32 +45,34 @@
(has ///.#program (the ///.#test profile) profile))]
(if (i.= shell.normal build_exit)
(do !
- [_ (console.write_line ..start console)
+ [_ (is (Async (Try Any))
+ (console.write_line ..start console))
.let [host_dependencies (//build.host_dependencies fs home resolution)
- [test_command test_parameters] (case compiler
- {//build.#JVM dependency}
- (|> program
- (///runtime.for (the ///.#java profile))
- (//build.with_jvm_class_path host_dependencies))
+ [command_environment test_command test_parameters] (case compiler
+ {//build.#JVM dependency}
+ (|> program
+ (///runtime.for (the ///.#java profile))
+ (//build.with_jvm_class_path host_dependencies))
- (^.template [<tag> <runtime>]
- [{<tag> artifact}
- (///runtime.for (the <runtime> profile)
- program)])
- ([//build.#JS ///.#js]
- [//build.#Python ///.#python]
- [//build.#Lua ///.#lua]
- [//build.#Ruby ///.#ruby]))]
- process (# shell execute [environment
+ (^.template [<tag> <runtime>]
+ [{<tag> artifact}
+ (///runtime.for (the <runtime> profile)
+ program)])
+ ([//build.#JS ///.#js]
+ [//build.#Python ///.#python]
+ [//build.#Lua ///.#lua]
+ [//build.#Ruby ///.#ruby]))]
+ process (# shell execute [(dictionary.composite command_environment environment)
working_directory
test_command
test_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)]
+ _ (is (Async (Try Any))
+ (console.write_line (if (i.= shell.normal exit)
+ ..success
+ ..failure)
+ console))]
(in [exit []]))
(in [build_exit []])))))
diff --git a/stdlib/source/program/aedifex/command/version.lux b/stdlib/source/program/aedifex/command/version.lux
index c61e796df..9c40edd97 100644
--- a/stdlib/source/program/aedifex/command/version.lux
+++ b/stdlib/source/program/aedifex/command/version.lux
@@ -2,6 +2,7 @@
[library
[lux "*"
[control
+ [try {"+" Try}]
[concurrency
["[0]" async {"+" Async}]]]
["[0]" meta "_"
@@ -16,5 +17,6 @@
(def: .public (do! console profile)
(-> (Console Async) (Command Any))
- (console.write_line (version.format meta/version.latest)
- console))
+ (is (Async (Try Any))
+ (console.write_line (version.format meta/version.latest)
+ console)))