aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/package.lux
blob: 31376c6f55f59e5356635a6446a79f6fa1b7b01a (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
40
41
42
43
44
45
46
47
(.module:
  [lux #*
   [abstract
    ["." equivalence (#+ Equivalence)]]
   [control
    ["." try (#+ Try) ("#@." functor)]
    [parser
     ["<.>" xml]]]
   [data
    ["." binary (#+ Binary)]
    [format
     ["." xml (#+ XML)]]
    [collection
     [set (#+ Set)]]]]
  ["." // #_
   [dependency (#+ Dependency)]
   ["/" profile]
   ["#." hash (#+ Hash SHA-1 MD5)]
   ["#." pom]])

(type: #export Package
  {#library Binary
   #pom XML
   #sha-1 (Hash SHA-1)
   #md5 (Hash MD5)})

(def: #export (local pom library)
  (-> XML Binary Package)
  {#library library
   #pom pom
   #sha-1 (//hash.sha-1 library)
   #md5 (//hash.md5 library)})

(def: #export dependencies
  (-> Package (Try (Set Dependency)))
  (|>> (get@ #pom)
       (<xml>.run //pom.parser)
       (try@map (get@ #/.dependencies))))

(def: #export equivalence
  (Equivalence Package)
  ($_ equivalence.product
      binary.equivalence
      xml.equivalence
      //hash.equivalence
      //hash.equivalence
      ))