Skip to content

Commit 60dc6be

Browse files
committed
add build.clj, a new method
1 parent 4e02964 commit 60dc6be

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

build.clj

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
(ns build
2+
(:refer-clojure :exclude [test])
3+
(:require [clojure.tools.build.api :as b] ; for b/git-count-revs
4+
[org.corfield.build :as bb]))
5+
6+
(def lib 'clj-djl/clj-djl)
7+
;; alternatively, use MAJOR.MINOR.COMMITS:
8+
;;(def version (format "0.2.%s" (b/git-count-revs nil)))
9+
(def version "0.1.9")
10+
11+
(defn test "Run the tests." [opts]
12+
(bb/run-tests opts))
13+
14+
(defn ci "Run the CI pipeline of tests (and build the JAR)." [opts]
15+
(-> opts
16+
(assoc :lib lib :version version :aliases [:test-runner])
17+
(bb/run-tests)
18+
(bb/clean)
19+
(bb/jar)))
20+
21+
(defn ci-no-test "Run the CI pipeline of tests (and build the JAR)." [opts]
22+
(-> opts
23+
(assoc :lib lib :version version)
24+
(bb/clean)
25+
(bb/jar)))
26+
27+
(def jar ci-no-test)
28+
29+
(defn install "Install the JAR locally." [opts]
30+
(-> opts
31+
(assoc :lib lib :version version)
32+
(bb/install)))
33+
34+
(defn deploy "Deploy the JAR to Clojars." [opts]
35+
(-> opts
36+
(assoc :lib lib :version version)
37+
(bb/deploy)))

deps.edn

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{:paths ["src" "target/classes"]
2+
3+
:deps {
4+
org.clojure/clojure {:mvn/version "1.10.3"}
5+
ai.djl/api {:mvn/version "0.16.0"}
6+
ai.djl/model-zoo {:mvn/version "0.16.0"}
7+
ai.djl/basicdataset {:mvn/version "0.16.0"}
8+
ai.djl.mxnet/mxnet-engine {:mvn/version "0.16.0"}
9+
ai.djl.mxnet/mxnet-native-auto {:mvn/version "1.8.0"}
10+
net.mikera/core.matrix {:mvn/version "0.62.0"}
11+
org.slf4j/slf4j-api {:mvn/version "1.7.32"}
12+
org.slf4j/slf4j-nop {:mvn/version "1.7.32"}
13+
}
14+
:aliases {
15+
:codox {:extra-deps {codox/codox {:mvn/version "0.10.8"}
16+
codox-theme-rdash/codox-theme-rdash {:mvn/version "0.1.2"}}
17+
:exec-fn codox.main/generate-docs
18+
:exec-args {:project {:name "clj-djl"}
19+
:metadata {:doc/format :markdown}
20+
:themes [:rdash]
21+
:source-paths ["src"]
22+
:source-uri "https://github.com/scicloj/clj-djl/blob/master/{filepath}#L{line}"
23+
:output-path "docs"}}
24+
25+
:build {:extra-deps {io.github.seancorfield/build-clj
26+
{:git/tag "v0.8.0" :git/sha "9bd8b8a"}}
27+
:ns-default build}
28+
29+
:test {:extra-paths ["test"]
30+
:extra-deps {io.github.cognitect-labs/test-runner
31+
{:git/tag "v0.5.1" :git/sha "dfb30dd"}}
32+
:main-opts ["-m" "cognitect.test-runner"]}}}

0 commit comments

Comments
 (0)