tangled
alpha
login
or
join now
noahbogart.com
/
sinker
0
fork
atom
catch exceptions hook, line, and sinker
0
fork
atom
overview
issues
pulls
pipelines
Move to clein
noahbogart.com
7 months ago
992b4390
29c577ad
+10
-72
2 changed files
expand all
collapse all
unified
split
build.clj
deps.edn
-69
build.clj
···
1
1
-
(ns build
2
2
-
(:refer-clojure :exclude [test])
3
3
-
(:require [clojure.tools.build.api :as b]
4
4
-
[deps-deploy.deps-deploy :as dd]))
5
5
-
6
6
-
(def lib 'net.clojars.noahtheduke/sinker)
7
7
-
(def version "0.1.0-SNAPSHOT")
8
8
-
#_ ; alternatively, use MAJOR.MINOR.COMMITS:
9
9
-
(def version (format "1.0.%s" (b/git-count-revs nil)))
10
10
-
(def class-dir "target/classes")
11
11
-
12
12
-
(defn test "Run all the tests." [opts]
13
13
-
(let [basis (b/create-basis {:aliases [:test]})
14
14
-
cmds (b/java-command
15
15
-
{:basis basis
16
16
-
:main 'clojure.main
17
17
-
:main-args ["-m" "lazytest.main"]})
18
18
-
{:keys [exit]} (b/process cmds)]
19
19
-
(when-not (zero? exit) (throw (ex-info "Tests failed" {}))))
20
20
-
opts)
21
21
-
22
22
-
(defn- pom-template [version]
23
23
-
[[:description "FIXME: my new library."]
24
24
-
[:url "https://github.com/noahtheduke/sinker"]
25
25
-
[:licenses
26
26
-
[:license
27
27
-
[:name "Eclipse Public License"]
28
28
-
[:url "http://www.eclipse.org/legal/epl-v10.html"]]]
29
29
-
[:developers
30
30
-
[:developer
31
31
-
[:name "Noah"]]]
32
32
-
[:scm
33
33
-
[:url "https://github.com/noahtheduke/sinker"]
34
34
-
[:connection "scm:git:https://github.com/noahtheduke/sinker.git"]
35
35
-
[:developerConnection "scm:git:ssh:git@github.com:noahtheduke/sinker.git"]
36
36
-
[:tag (str "v" version)]]])
37
37
-
38
38
-
(defn- jar-opts [opts]
39
39
-
(assoc opts
40
40
-
:lib lib :version version
41
41
-
:jar-file (format "target/%s-%s.jar" lib version)
42
42
-
:basis (b/create-basis {})
43
43
-
:class-dir class-dir
44
44
-
:target "target"
45
45
-
:src-dirs ["src"]
46
46
-
:pom-data (pom-template version)))
47
47
-
48
48
-
(defn ci "Run the CI pipeline of tests (and build the JAR)." [opts]
49
49
-
(test opts)
50
50
-
(b/delete {:path "target"})
51
51
-
(let [opts (jar-opts opts)]
52
52
-
(println "\nWriting pom.xml...")
53
53
-
(b/write-pom opts)
54
54
-
(println "\nCopying source...")
55
55
-
(b/copy-dir {:src-dirs ["resources" "src"] :target-dir class-dir})
56
56
-
(println "\nBuilding JAR..." (:jar-file opts))
57
57
-
(b/jar opts))
58
58
-
opts)
59
59
-
60
60
-
(defn install "Install the JAR locally." [opts]
61
61
-
(let [opts (jar-opts opts)]
62
62
-
(b/install opts))
63
63
-
opts)
64
64
-
65
65
-
(defn deploy "Deploy the JAR to Clojars." [opts]
66
66
-
(let [{:keys [jar-file] :as opts} (jar-opts opts)]
67
67
-
(dd/deploy {:installer :remote :artifact (b/resolve-path jar-file)
68
68
-
:pom-file (b/pom-path (select-keys opts [:lib :class-dir]))}))
69
69
-
opts)
+10
-3
deps.edn
···
26
26
27
27
:runner {:main-opts ["-m" "lazytest.main"]}
28
28
29
29
-
:build {:deps {io.github.clojure/tools.build {:mvn/version "0.10.9"}
30
30
-
slipset/deps-deploy {:mvn/version "0.2.2"}}
31
31
-
:ns-default build}}}
29
29
+
:clein {:deps {io.github.noahtheduke/clein {:mvn/version "0.5.0"}}
30
30
+
:main-opts ["-m" "noahtheduke.clein"]}
31
31
+
:clein/build {:lib noahtheduke.sinker
32
32
+
:main noahtheduke.sinker
33
33
+
:version "resources/SINKER_VERSION"
34
34
+
:url "https://tangled.sh/@noahbogart.com/sinker"
35
35
+
:license {:name "MPL-2.0"
36
36
+
:url "https://mozilla.org/MPL/2.0"}
37
37
+
:src-dirs ["src"]
38
38
+
:resource-dirs ["resources"]}}}