File tree Expand file tree Collapse file tree 2 files changed +35
-4
lines changed Expand file tree Collapse file tree 2 files changed +35
-4
lines changed Original file line number Diff line number Diff line change 2
2
3
3
set -e
4
4
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
6
6
7
7
if [[ $( git status -s deps.edn) ]]
8
8
then
9
- clojure -Spom
9
+ clojure -Atest - Spom
10
10
fi
Original file line number Diff line number Diff line change 1
1
(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)))
3
31
4
32
(defn -main [coord version]
5
33
(let [coord (symbol coord)
11
39
(binding [*print-namespace-maps* false ]
12
40
(with-out-str
13
41
(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" )))))
You can’t perform that action at this time.
0 commit comments