aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/artifact
diff options
context:
space:
mode:
authorEduardo Julian2020-10-24 05:05:26 -0400
committerEduardo Julian2020-10-24 05:05:26 -0400
commitbcd68d4691e7b2f6d56e0ab92b591c14d7a26a48 (patch)
tree3e739d4b5d963ad98f54e1748c28ea1d33aa7330 /stdlib/source/program/aedifex/artifact
parentc006a5fe8e82f6fc7c8cdb9db0f44c06d229f34e (diff)
Re-named "search" to "one" and "search-all" to "all".
Diffstat (limited to '')
-rw-r--r--stdlib/source/program/aedifex/artifact.lux48
-rw-r--r--stdlib/source/program/aedifex/artifact/extension.lux34
-rw-r--r--stdlib/source/program/aedifex/artifact/type.lux2
3 files changed, 45 insertions, 39 deletions
diff --git a/stdlib/source/program/aedifex/artifact.lux b/stdlib/source/program/aedifex/artifact.lux
index 47a9027d0..dc0892eb1 100644
--- a/stdlib/source/program/aedifex/artifact.lux
+++ b/stdlib/source/program/aedifex/artifact.lux
@@ -5,7 +5,7 @@
["." hash (#+ Hash)]]
[data
["." text
- ["%" format (#+ format)]]
+ ["%" format (#+ Format)]]
[collection
["." list ("#@." monoid)]]]
[world
@@ -42,31 +42,41 @@
text.hash
))
-(def: group-separator
- ".")
+(template [<separator> <definition>]
+ [(def: <definition>
+ Text
+ <separator>)]
-(def: version-separator
- "-")
+ ["." group-separator]
+ ["-" version-separator]
+ [":" identity-separator]
+ )
(def: #export (identity artifact)
(-> Artifact Text)
- (format (get@ #name artifact)
- ..version-separator
- (get@ #version artifact)))
+ (%.format (get@ #name artifact)
+ ..version-separator
+ (get@ #version artifact)))
+
+(def: #export (format value)
+ (Format Artifact)
+ (%.format (get@ #group value)
+ ..identity-separator
+ (..identity value)))
(def: #export (path artifact)
(-> Artifact Text)
- (let [directory (format (|> artifact
- (get@ #group)
- (text.split-all-with ..group-separator)
- (text.join-with uri.separator))
- uri.separator
- (get@ #name artifact)
- uri.separator
- (get@ #version artifact))]
- (format directory
- uri.separator
- (..identity artifact))))
+ (let [directory (%.format (|> artifact
+ (get@ #group)
+ (text.split-all-with ..group-separator)
+ (text.join-with uri.separator))
+ uri.separator
+ (get@ #name artifact)
+ uri.separator
+ (get@ #version artifact))]
+ (%.format directory
+ uri.separator
+ (..identity artifact))))
(def: #export (local artifact)
(-> Artifact (List Text))
diff --git a/stdlib/source/program/aedifex/artifact/extension.lux b/stdlib/source/program/aedifex/artifact/extension.lux
index 04d40fec4..412bf699a 100644
--- a/stdlib/source/program/aedifex/artifact/extension.lux
+++ b/stdlib/source/program/aedifex/artifact/extension.lux
@@ -2,7 +2,9 @@
[lux #*
[data
[text
- ["%" format (#+ format)]]]]
+ ["%" format (#+ format)]]]
+ [macro
+ ["." template]]]
["." // #_
["#" type]])
@@ -16,22 +18,14 @@
(-> //.Type Extension)
(|>> (format ..separator)))
-(def: #export lux-library
- Extension
- (..extension //.lux-library))
-
-(def: #export jvm-library
- Extension
- (..extension //.jvm-library))
-
-(def: #export pom
- Extension
- (..extension //.pom))
-
-(def: #export sha1
- Extension
- (format ..separator "sha1"))
-
-(def: #export md5
- Extension
- (format ..separator "md5"))
+(template [<name>]
+ [(def: #export <name>
+ Extension
+ (..extension (template.identifier [//._] [<name>])))]
+
+ [lux-library]
+ [jvm-library]
+ [pom]
+ [sha1]
+ [md5]
+ )
diff --git a/stdlib/source/program/aedifex/artifact/type.lux b/stdlib/source/program/aedifex/artifact/type.lux
index e5836d13f..35035ebc4 100644
--- a/stdlib/source/program/aedifex/artifact/type.lux
+++ b/stdlib/source/program/aedifex/artifact/type.lux
@@ -13,4 +13,6 @@
["tar" lux-library]
["jar" jvm-library]
["pom" pom]
+ ["sha1" sha1]
+ ["md5" md5]
)