aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/metadata.lux
blob: 11a79252884baeb95467cde253a34565f1994fcc (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
(.module:
  [lux #*
   [data
    ["." text
     ["%" format (#+ format)]]]
   [world
    [file (#+ Path)]
    [net
     ["." uri (#+ URI)]]]]
  [//
   ["." artifact (#+ Artifact)]])

(def: #export file
  Path
  "maven-metadata.xml")

(def: (project' separator artifact)
  (-> Text Artifact Text)
  (format (artifact.directory separator (get@ #artifact.group artifact))
          separator
          (get@ #artifact.name artifact)))

(def: (version' separator artifact)
  (-> Text Artifact Text)
  (format (..project' separator artifact)
          separator
          (get@ #artifact.version artifact)))

(template [<public> <private>]
  [(def: #export (<public> artifact)
     (-> Artifact URI)
     (let [/ uri.separator]
       (format (<private> / artifact) / ..file)))]

  [project ..project']
  [version ..version']
  )