aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/command/deps.lux
blob: 71dffeec1084cbebaa9a8e63f1432481c441ef60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
(.module:
  [lux #*
   [abstract
    [monad (#+ do)]]
   [control
    [concurrency
     ["." promise (#+ Promise)]]]
   [data
    [collection
     ["." set (#+ Set)]
     ["." list ("#\." fold)]
     ["." dictionary]]]
   [world
    [program (#+ Program)]
    ["." file]
    ["." console (#+ Console)]]]
  ["." // #_
   ["#." clean]
   ["/#" // #_
    [command (#+ Command)]
    [artifact (#+ Artifact)]
    [repository (#+ Repository)]
    ["#" profile]
    ["#." action (#+ Action)]
    ["#." dependency #_
     ["#/." resolution (#+ Resolution)]
     ["#/." deployment]]]])

(def: #export (do! console local remotes profile)
  (-> (Console Promise) (Repository Promise) (List (Repository Promise)) (Command Resolution))
  (do ///action.monad
    [#let [dependencies (set.to_list (get@ #///.dependencies profile))]
     cache (///dependency/resolution.all (list local) dependencies ///dependency/resolution.empty)
     resolution (///dependency/resolution.all remotes dependencies cache)
     cached (|> (dictionary.keys cache)
                (list\fold dictionary.remove resolution)
                (///dependency/deployment.all local))
     _ (console.write_line //clean.success console)]
    (wrap resolution)))