aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/metadata.lux
blob: a7cd9945cfb7a4ea1ed766cdb0498c88b9167072 (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
... This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
... If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

(.require
 [library
  [lux (.except)
   [data
    ["[0]" text (.only)
     ["%" \\format (.only format)]]]
   [world
    [file (.only Path)]
    [net
     [uri (.only URI)
      ["[0]" path]]]]]]
 ["[0]" //
  ["[1][0]" artifact (.only Artifact)]])

(def remote_file
  Path
  "maven-metadata.xml")

(def .public (remote_artifact_uri artifact)
  (-> Artifact URI)
  (let [/ path.separator]
    (format (//artifact.directory / (the //artifact.#group artifact))
            / (the //artifact.#name artifact)
            / (the //artifact.#version artifact)
            / ..remote_file)))

(def .public (remote_project_uri artifact)
  (-> Artifact URI)
  (let [/ path.separator]
    (format (//artifact.directory / (the //artifact.#group artifact))
            / (the //artifact.#name artifact)
            / ..remote_file)))

(def local_file
  Path
  "maven-metadata-local.xml")

(def .public (local_uri remote_uri)
  (-> URI URI)
  (text.replaced_once ..remote_file ..local_file remote_uri))

(def .public (remote_uri local_uri)
  (-> URI URI)
  (text.replaced_once ..local_file ..remote_file local_uri))