diff --git a/build.clj b/build.clj index 6a12d44..c7c9e4d 100644 --- a/build.clj +++ b/build.clj @@ -1,7 +1,8 @@ (ns build (:refer-clojure :exclude [test]) (:require [clojure.tools.build.api :as b] ; for b/git-count-revs - [org.corfield.build :as bb])) + [org.corfield.build :as bb] + [deps-deploy.deps-deploy :as dd])) (def lib 'org.scicloj/scicloj.ml.xgboost) ; alternatively, use MAJOR.MINOR.COMMITS: @@ -61,7 +62,23 @@ (assoc :lib lib :version version) (bb/install))) +;; (defn deploy "Deploy the JAR to Clojars." [opts] +;; (-> opts +;; (assoc :lib lib :version version) +;; (bb/deploy))) + +(defn- jar-opts [opts] + (assoc opts + :lib lib :version version + :jar-file (format "target/%s-%s.jar" lib version) + :basis (b/create-basis {}) + :class-dir class-dir + :target "target" + :src-dirs ["src"] + :pom-data (pom-template))) + (defn deploy "Deploy the JAR to Clojars." [opts] - (-> opts - (assoc :lib lib :version version) - (bb/deploy))) + (let [{:keys [jar-file] :as opts} (jar-opts opts)] + (dd/deploy {:installer :remote :artifact (b/resolve-path jar-file) + :pom-file (b/pom-path (select-keys opts [:lib :class-dir]))})) + opts) \ No newline at end of file diff --git a/deps.edn b/deps.edn index 88880b4..ddc3560 100644 --- a/deps.edn +++ b/deps.edn @@ -24,7 +24,11 @@ :build {:deps {io.github.seancorfield/build-clj - {:git/tag "v0.4.0" :git/sha "54e39ae"}} + {:git/tag "v0.4.0" :git/sha "54e39ae"} + io.github.clojure/tools.build {:mvn/version "0.9.6"} + slipset/deps-deploy {:mvn/version "0.2.1"} + + } :ns-default build} :run-tests {:main-opts ["-m" "kaocha.runner"]}