Skip to content

Commit fe6ccb2

Browse files
committed
Setup build
1 parent 8d9337d commit fe6ccb2

File tree

2 files changed

+68
-4
lines changed

2 files changed

+68
-4
lines changed

build.clj

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
;; clj -T:build <var>
2+
3+
(ns build
4+
(:require [clojure.tools.build.api :as build]
5+
[net.lewisship.build :as b]))
6+
7+
(def lib 'io.aviso/pretty)
8+
(def version "1.3")
9+
10+
(def jar-params {:project-name lib
11+
:version version})
12+
13+
(defn clean
14+
[_params]
15+
(build/delete {:path "target"}))
16+
17+
(defn jar
18+
[_params]
19+
(b/create-jar jar-params))
20+
21+
(defn deploy
22+
[_params]
23+
(clean nil)
24+
(jar nil)
25+
(b/deploy-jar jar-params))
26+
27+
(defn codox
28+
[_params]
29+
(b/codox {:project-name lib
30+
:version version
31+
:aliases [:dev]}))
32+
33+
(def publish-dir "../aviso-docs")
34+
35+
(defn publish
36+
"Generate Codox documentation and publish via a GitHub push."
37+
[_params]
38+
(println "Generating Codox documentation")
39+
(codox nil)
40+
(println "Copying documentation to" publish-dir "...")
41+
(build/copy-dir {:target-dir publish-dir
42+
:src-dirs ["target/doc"]})
43+
(println "Committing changes ...")
44+
(build/process {:dir publish-dir
45+
:command-args ["git" "commit" "-a" "-m" (str "io.aviso/pretty " version)]})
46+
(println "Pushing changes ...")
47+
(build/process {:dir publish-dir
48+
:command-args ["git" "push"]}))

deps.edn

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,24 @@
1010
com.walmartlabs/test-reporting {:mvn/version "1.2"}
1111
org.clojure/core.async {:mvn/version "1.5.648"}}}
1212

13-
:main
14-
{:main-opts ["-m" "io.aviso.repl"]}
13+
;; clj -X:dev:test
14+
:test
15+
{:extra-deps {io.github.cognitect-labs/test-runner {:git/tag "v0.5.1"
16+
:git/sha "dfb30dd"}}
17+
:exec-fn cognitect.test-runner.api/test}
1518

16-
:demo
17-
{:main-opts ["-m" "demo"]}}}
19+
;; clj -T:build <command>
20+
:build
21+
{:deps {io.github.hlship/build-tools
22+
{:git/tag "v0.5" :git/sha "ca4876"}}
23+
:ns-default build}}
24+
25+
:main
26+
{:main-opts ["-m" "io.aviso.repl"]}
27+
28+
:demo
29+
{:main-opts ["-m" "demo"]}
30+
31+
:codox/config
32+
{:description "Clojure library to help print things, prettily"
33+
:source-uri "https://github.com/AvisoNovate/pretty/blob/master/{filepath}#L{line}"}}

0 commit comments

Comments
 (0)