-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
awb99
committed
Jun 24, 2024
1 parent
a1766dd
commit 8f5e759
Showing
2 changed files
with
51 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,49 @@ | ||
(ns build | ||
(:require | ||
[clojure.tools.build.api :as b] | ||
[org.corfield.build :as bb] ; https://github.com/seancorfield/build-clj | ||
)) | ||
|
||
[deps-deploy.deps-deploy :as dd])) | ||
|
||
(def lib 'org.pinkgorilla/permission) | ||
(def version (format "0.0.%s" (b/git-count-revs nil))) | ||
(def version (format "0.2.%s" (b/git-count-revs nil))) | ||
(def class-dir "target/classes") | ||
(def basis (b/create-basis {:project "deps.edn"})) | ||
(def jar-file (format "target/%s-%s.jar" (name lib) version)) | ||
|
||
(defn clean [_] | ||
(b/delete {:path "target"})) | ||
|
||
(def pom-template | ||
[[:licenses | ||
[:license | ||
[:name "Eclipse Public License"] | ||
[:url "https://www.eclipse.org/legal/epl-v10.html"]]] | ||
[:developers | ||
[:developer | ||
[:name "pink-gorilla"]]] | ||
[:scm | ||
[:url "https://github.com/pink-gorilla/permission/"] | ||
[:connection "scm:git:git://github.com/pink-gorilla/permission.git"] | ||
[:developerConnection "scm:git:ssh://[email protected]/pink-gorilla/permission.git"]]]) | ||
|
||
(defn jar "build the JAR" [opts] | ||
(println "Building the JAR") | ||
(-> opts | ||
(assoc :lib lib | ||
:version version | ||
:transitive true) | ||
;(bb/run-tests) | ||
;(bb/clean) | ||
(bb/jar))) | ||
(def opts {:class-dir class-dir | ||
:lib lib | ||
:version version | ||
:basis basis | ||
:pom-data pom-template | ||
:src-dirs ["src"]}) | ||
|
||
(defn jar [_] | ||
(b/write-pom opts) | ||
(b/copy-dir {:src-dirs ["src" | ||
"resources"] | ||
:target-dir class-dir}) | ||
(b/jar {:class-dir class-dir | ||
:jar-file jar-file})) | ||
|
||
(defn deploy "Deploy the JAR to Clojars." [opts] | ||
(println "Deploying to Clojars.") | ||
(-> opts | ||
(assoc :lib lib | ||
:version version) | ||
(bb/deploy))) | ||
(defn deploy "Deploy the JAR to Clojars." [_] | ||
(println "Deploying to Clojars..") | ||
(dd/deploy {:installer :remote | ||
;:sign-releases? true | ||
:pom-file (b/pom-path (select-keys opts [:lib :class-dir])) | ||
;:artifact "target/tech.ml.dataset.jar" | ||
:artifact (b/resolve-path jar-file)})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,16 @@ | ||
{:paths ["src"] | ||
:deps {org.clojure/clojure {:mvn/version "1.11.1"}} | ||
:aliases | ||
{:build {:deps {io.github.clojure/tools.build {:git/tag "v0.6.1" :git/sha "515b334"} | ||
io.github.slipset/deps-deploy {:git/sha "b4359c5d67ca002d9ed0c4b41b710d7e5a82e3bf"} | ||
io.github.seancorfield/build-clj {:git/tag "v0.5.4" :git/sha "bc9c0cc"} | ||
babashka/fs {:mvn/version "0.0.5"}} | ||
:ns-default build} | ||
:aliases {:build {:deps {io.github.clojure/tools.build {:mvn/version "0.9.6"} | ||
slipset/deps-deploy {:mvn/version "0.2.1"} | ||
babashka/fs {:mvn/version "0.0.5"}} | ||
:ns-default build} | ||
|
||
|
||
:test | ||
{:extra-paths ["test"] | ||
:extra-deps {io.github.cognitect-labs/test-runner | ||
{:git/tag "v0.5.1" :git/sha "dfb30dd"}} | ||
:exec-fn cognitect.test-runner.api/test} | ||
|
||
:test | ||
{:extra-paths ["test"] | ||
:extra-deps {io.github.cognitect-labs/test-runner | ||
{:git/tag "v0.5.1" :git/sha "dfb30dd"}} | ||
:exec-fn cognitect.test-runner.api/test} | ||
; | ||
}} | ||
}} | ||
|
||
|