aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/command/build.lux
diff options
context:
space:
mode:
authorEduardo Julian2020-12-29 23:29:54 -0400
committerEduardo Julian2020-12-29 23:29:54 -0400
commit02d27daeacac74785c2b0f4d1ce03d432377a36e (patch)
tree5129c496d136deb57880f202153e96f4f585e355 /stdlib/source/program/aedifex/command/build.lux
parent832a9361b632331e82a64c07baa560487ca8abde (diff)
Unified repository abstraction for Aedifex.
Diffstat (limited to 'stdlib/source/program/aedifex/command/build.lux')
-rw-r--r--stdlib/source/program/aedifex/command/build.lux19
1 files changed, 14 insertions, 5 deletions
diff --git a/stdlib/source/program/aedifex/command/build.lux b/stdlib/source/program/aedifex/command/build.lux
index a05d7ad85..7241b1de4 100644
--- a/stdlib/source/program/aedifex/command/build.lux
+++ b/stdlib/source/program/aedifex/command/build.lux
@@ -26,13 +26,14 @@
[program (#+ Program)]
["." file (#+ Path)]
["." shell (#+ Shell)]
- ["." console (#+ Console)]]]
+ ["." console (#+ Console)]
+ [net
+ ["." uri]]]]
["." /// #_
["#" profile]
["#." action]
["#." command (#+ Command)]
["#." local]
- ["#." cache]
["#." repository]
["#." runtime]
["#." dependency (#+ Dependency)
@@ -102,11 +103,19 @@
_
(exception.throw ..no_available_compiler [])))
+(def: (path fs home artifact)
+ (All [!] (-> (file.System !) Path Artifact Path))
+ (let [/ (\ fs separator)]
+ (|> artifact
+ ///local.uri
+ (text.replace_all uri.separator /)
+ (format home /))))
+
(def: (libraries fs home)
(All [!] (-> (file.System !) Path Resolution (List Path)))
(|>> dictionary.keys
(list.filter (|>> (get@ #///dependency.type) (text\= ///artifact/type.lux_library)))
- (list\map (|>> (get@ #///dependency.artifact) (///local.path fs home)))))
+ (list\map (|>> (get@ #///dependency.artifact) (..path fs home)))))
(def: (singular name)
(-> Text Text (List Text))
@@ -138,9 +147,9 @@
(do ///action.monad
[[resolution compiler] (promise\wrap (..compiler resolution))
#let [[command output] (let [[compiler output] (case compiler
- (#JVM artifact) [(///runtime.java (///local.path fs home artifact))
+ (#JVM artifact) [(///runtime.java (..path fs home artifact))
"program.jar"]
- (#JS artifact) [(///runtime.node (///local.path fs home artifact))
+ (#JS artifact) [(///runtime.node (..path fs home artifact))
"program.js"])]
[(format compiler " build") output])
/ (\ fs separator)