Skip to content

Commit d21b4a9

Browse files
committed
script
1 parent d1b26c2 commit d21b4a9

File tree

2 files changed

+35
-4
lines changed

2 files changed

+35
-4
lines changed

script/update-dep.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
set -e
44

5-
clojure -Ascript -m update-dep $1 $2
5+
clojure -Sdeps '{:deps {org.clojure/tools.deps.alpha {:mvn/version "0.5.460"}}}' -Ascript:test -m update-dep $1 $2
66

77
if [[ $(git status -s deps.edn) ]]
88
then
9-
clojure -Spom
9+
clojure -Atest -Spom
1010
fi

script/update_dep.clj

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
(ns update-dep
2-
(:require [clojure.pprint :as pp]))
2+
(:require [clojure.pprint :as pp]
3+
[clojure.tools.deps.alpha.gen.pom :as pom]
4+
[clojure.tools.deps.alpha.util.io :refer [printerrln]]
5+
[clojure.tools.deps.alpha.script.generate-manifest :as gen]))
6+
7+
(defn- to-dep
8+
[[lib {:keys [mvn/version classifier exclusions scope] :as coord}]]
9+
(prn "MEME")
10+
(if version
11+
(cond->
12+
[::pom/dependency
13+
[::pom/groupId (or (namespace lib) (name lib))]
14+
[::pom/artifactId (name lib)]
15+
[::pom/version version]]
16+
17+
classifier
18+
(conj [::pom/classifier classifier])
19+
20+
scope
21+
(conj [::pom/scope scope])
22+
23+
(seq exclusions)
24+
(conj [::pom/exclusions
25+
(map (fn [excl]
26+
[::pom/exclusion
27+
[::pom/groupId (or (namespace excl) (name excl))]
28+
[::pom/artifactId (name excl)]])
29+
exclusions)]))
30+
(printerrln "Skipping coordinate:" coord)))
331

432
(defn -main [coord version]
533
(let [coord (symbol coord)
@@ -11,4 +39,7 @@
1139
(binding [*print-namespace-maps* false]
1240
(with-out-str
1341
(pp/pprint
14-
(assoc-in dedn [:deps coord :mvn/version] version))))))))
42+
(assoc-in dedn [:deps coord :mvn/version] version)))))
43+
(with-redefs-fn {#'pom/to-dep to-dep}
44+
(gen/-main "--config-files" "deps.edn"
45+
"--gen" "pom")))))

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy