diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/program/aedifex.lux | 15 | ||||
-rw-r--r-- | stdlib/source/program/aedifex/cache.lux | 2 | ||||
-rw-r--r-- | stdlib/source/program/aedifex/command/deps.lux | 26 | ||||
-rw-r--r-- | stdlib/source/program/aedifex/dependency/resolution.lux | 2 |
4 files changed, 23 insertions, 22 deletions
diff --git a/stdlib/source/program/aedifex.lux b/stdlib/source/program/aedifex.lux index a05dee430..6f98c7651 100644 --- a/stdlib/source/program/aedifex.lux +++ b/stdlib/source/program/aedifex.lux @@ -23,7 +23,8 @@ ["." xml]] [collection ["." set] - ["." dictionary (#+ Dictionary)]]] + ["." dictionary (#+ Dictionary)] + ["." list ("#\." functor)]]] [tool [compiler [language @@ -40,7 +41,7 @@ ["#." pom] ["#." cli] ["#." cache] - ["#." repository (#+ Address)] + ["#." repository (#+ Address Repository)] ["#." dependency #_ ["#" resolution]] ["#." command (#+ Command) @@ -53,10 +54,16 @@ ["#/." auto] ["#/." deploy]]]) +(def: repositories + (-> /.Profile (List (Repository Promise))) + (|>> (get@ #/.repositories) + set.to-list + (list\map (|>> /repository.remote /repository.async)))) + (def: (with-dependencies command profile) (All [a] (-> (Command a) (Command a))) (do /action.monad - [_ (/command/deps.do! profile)] + [_ (/command/deps.do! (file.async file.default) (..repositories profile) profile)] (command profile))) (exception: (cannot-find-repository {repository Text} @@ -103,7 +110,7 @@ (wrap [])) #/cli.Dependencies - (exec (/command/deps.do! profile) + (exec (/command/deps.do! (file.async file.default) (..repositories profile) profile) (wrap [])) (#/cli.Compilation compilation) diff --git a/stdlib/source/program/aedifex/cache.lux b/stdlib/source/program/aedifex/cache.lux index ef72dc988..dca14b496 100644 --- a/stdlib/source/program/aedifex/cache.lux +++ b/stdlib/source/program/aedifex/cache.lux @@ -72,7 +72,7 @@ (do {! (try.with promise.monad)} [] (|> (dictionary.entries resolution) - (list.filter (|>> product.right //package.local?)) + (list.filter (|>> product.right //package.local? not)) (monad.map ! (function (_ [dependency package]) (..write-one system dependency package))) (:: ! map (set.from-list //artifact.hash))))) diff --git a/stdlib/source/program/aedifex/command/deps.lux b/stdlib/source/program/aedifex/command/deps.lux index 91bbf0ec1..bc4d88f6c 100644 --- a/stdlib/source/program/aedifex/command/deps.lux +++ b/stdlib/source/program/aedifex/command/deps.lux @@ -4,34 +4,28 @@ [monad (#+ do)]] [control [concurrency - ["." promise]]] + ["." promise (#+ Promise)]]] [data [collection - ["." set (#+ Set)] - ["." list ("#\." functor)]]] + ["." set (#+ Set)]]] [world ["." file]]] ["." /// #_ [command (#+ Command)] [artifact (#+ Artifact)] + [repository (#+ Repository)] ["#" profile] ["#." action (#+ Action)] ["#." cache] - ["#." repository] ["#." dependency #_ - ["#" resolution]]]) + ["#/." resolution]]]) -(def: #export (do! profile) - (Command (Set Artifact)) +(def: #export (do! fs repositories profile) + (-> (file.System Promise) (List (Repository Promise)) (Command (Set Artifact))) (do ///action.monad - [cache (///cache.read-all (file.async file.default) - (set.to-list (get@ #///.dependencies profile)) - ///dependency.empty) - resolution (///dependency.all (list\map (|>> ///repository.remote ///repository.async) - (set.to-list (get@ #///.repositories profile))) - (set.to-list (get@ #///.dependencies profile)) - cache) - cached (///cache.write-all (file.async file.default) - resolution) + [#let [dependencies (set.to-list (get@ #///.dependencies profile))] + cache (///cache.read-all fs dependencies ///dependency/resolution.empty) + resolution (///dependency/resolution.all repositories dependencies cache) + cached (///cache.write-all fs resolution) #let [_ (log! "Successfully resolved dependencies!")]] (wrap cached))) diff --git a/stdlib/source/program/aedifex/dependency/resolution.lux b/stdlib/source/program/aedifex/dependency/resolution.lux index 8becf87dd..f5dbb0d54 100644 --- a/stdlib/source/program/aedifex/dependency/resolution.lux +++ b/stdlib/source/program/aedifex/dependency/resolution.lux @@ -107,7 +107,7 @@ ["Artifact" (%.text (///artifact.format (get@ #//.artifact dependency)))] ["Type" (%.text (get@ #//.type dependency))])) -(def: (any repositories dependency) +(def: #export (any repositories dependency) (-> (List (Repository Promise)) Dependency (Promise (Try Package))) (case repositories #.Nil |