Skip to content
This repository has been archived by the owner on May 15, 2021. It is now read-only.

Commit

Permalink
Include clojars and maven in pom.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobobryant committed May 29, 2019
1 parent d5b33ec commit 52f32fb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
9 changes: 6 additions & 3 deletions src/trident/build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ set -x
(doseq [lib (or (not-empty (map symbol libs)) (keys projects))]
(let [dest (abspath "target" lib "src" group-id)
[local-deps maven-deps] (get-deps projects lib)
deps-edn (merge {:paths ["src"]
:deps (select-keys managed-deps maven-deps)}
(select-keys opts [:mvn/repos :aliases]))
deps-edn (-> {:paths ["src"]
:deps (select-keys managed-deps maven-deps)}
(merge (select-keys opts [:mvn/repos :aliases]))
(update :mvn/repos assoc
"clojars" {:url "https://repo.clojars.org/"}
"maven" {:url "https://repo1.maven.org/maven2"}))
lib-edn (merge (select-keys opts [:version :group-id :github-repo :cljdoc-dir])
{:artifact-id (str lib)
:git-dir (abspath ".")})]
Expand Down
6 changes: 3 additions & 3 deletions src/trident/build/pom.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
[clojure.tools.deps.alpha.gen.pom :as gen.pom]
[clojure.java.io :as io]
[clojure.tools.deps.alpha.reader :refer [read-deps]]
[clojure.string :refer [ends-with?]]
[clojure.string :refer [ends-with? trim]]
[clojure.zip :as zip]))

(xml/alias-uri 'pom "http://maven.apache.org/POM/4.0.0")

(defn sync-pom [{:keys [group-id artifact-id version github-repo]}]
(let [clean? (= "" (sh "git" "status" "--porcelain"))
_ (when (not (or clean? (ends-with? version "SNAPSHOT")))
(throw (ex-info "Can't release without a clean commit" {})))
commit (sh "git" "rev-list" "-n" "1" "HEAD")
(throw (ex-info "Can't do a non-snapshot release without a clean commit" {})))
commit (trim (sh "git" "rev-list" "-n" "1" "HEAD"))
pom-path (abspath "pom.xml")]
(io/delete-file pom-path true)
(gen.pom/sync-pom
Expand Down
2 changes: 1 addition & 1 deletion trident.edn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{:version "0.1.1-3-SNAPSHOT"
{:version "0.1.1-4-SNAPSHOT"
:group-id "trident"
:github-repo "jacobobryant/trident"
:cljdoc-dir "/home/arch/dev/cljdoc/"
Expand Down

0 comments on commit 52f32fb

Please sign in to comment.