aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/command/build.lux
diff options
context:
space:
mode:
authorEduardo Julian2020-10-03 20:13:27 -0400
committerEduardo Julian2020-10-03 20:13:27 -0400
commit2d16bdfa2854d851034eff9f042863dcceb8664a (patch)
treea1c593916c6ec9d6e9c132e641fc8b34b85a07f8 /stdlib/source/program/aedifex/command/build.lux
parent618b1ce9743bb79f1ae3375b05a394a4183b21e8 (diff)
Gave Aedifex support for multiple profiles.
Diffstat (limited to 'stdlib/source/program/aedifex/command/build.lux')
-rw-r--r--stdlib/source/program/aedifex/command/build.lux33
1 files changed, 20 insertions, 13 deletions
diff --git a/stdlib/source/program/aedifex/command/build.lux b/stdlib/source/program/aedifex/command/build.lux
index 0e5d1e229..f505f1d0a 100644
--- a/stdlib/source/program/aedifex/command/build.lux
+++ b/stdlib/source/program/aedifex/command/build.lux
@@ -16,11 +16,12 @@
["%" format (#+ format)]]
[collection
["." list ("#@." functor)]
- ["." dictionary]]]
+ ["." dictionary]
+ ["." set]]]
[world
["." file (#+ Path)]]]
["." /// #_
- ["#" project]
+ ["#" profile]
["#." action]
["#." command (#+ Command)]
["#." local]
@@ -55,6 +56,7 @@
(exception: #export no-available-compiler)
(exception: #export no-specified-program)
+(exception: #export no-specified-target)
(type: #export Compiler
(#JVM Artifact)
@@ -107,18 +109,25 @@
(-> Text (List Text) Text)
(|> values (list@map (|>> (format name " "))) (text.join-with " ")))
-(def: #export (do! project)
+(def: #export (do! profile)
(Command [Compiler
Path])
- (case (get@ #///.program project)
- (#.Some program)
+ (case [(get@ #///.program profile)
+ (get@ #///.target profile)]
+ [#.None _]
+ (promise@wrap (exception.throw ..no-specified-program []))
+
+ [_ #.None]
+ (promise@wrap (exception.throw ..no-specified-target []))
+
+ [(#.Some program) (#.Some target)]
(do ///action.monad
[cache (///local.all-cached (file.async file.system)
- (get@ #///.dependencies project)
+ (set.to-list (get@ #///.dependencies profile))
///dependency.empty)
resolution (promise.future
- (///dependency.resolve-all (get@ #///.repositories project)
- (get@ #///.dependencies project)
+ (///dependency.resolve-all (set.to-list (get@ #///.repositories profile))
+ (set.to-list (get@ #///.dependencies profile))
cache))
_ (///local.cache-all (file.async file.system)
resolution)
@@ -130,10 +139,10 @@
"program.jar"]
(#JS artifact) [(format "node --stack_size=8192 " (///local.path file.system artifact))
"program.js"])
- cache-directory (format working-directory (:: file.system separator) (get@ #///.target project))
+ cache-directory (format working-directory (:: file.system separator) target)
command (format prefix " build"
" " (..plural-parameter "--library" libraries)
- " " (..plural-parameter "--source" (get@ #///.sources project))
+ " " (..plural-parameter "--source" (set.to-list (get@ #///.sources profile)))
" " (..singular-parameter "--target" cache-directory)
" " (..singular-parameter "--module" program))]
#let [_ (log! "[BUILD STARTED]")]
@@ -141,6 +150,4 @@
#let [_ (log! "[BUILD ENDED]")]]
(wrap [compiler
(format cache-directory (:: file.system separator) output)]))
-
- #.None
- (promise@wrap (exception.throw ..no-specified-program []))))
+ ))