diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 488a620e..5c878340 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -8,11 +8,11 @@ jobs: - uses: DeLaGuardo/setup-clojure@master with: tools-deps: latest - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: path: ~/.m2 key: coverage-m2-${{ hashFiles('deps.edn') }}-v1 - name: Run cloverage run: make coverage - name: Upload reports - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 34b40c34..5bbfffd6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -20,7 +20,7 @@ jobs: with: tools-deps: latest lein: latest - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: path: ~/.m2 key: test-m2-${{ hashFiles('deps.edn') }}-v1 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c7bd8dbb..ed951660 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -7,7 +7,7 @@ jobs: - uses: actions/checkout@v3 - uses: DeLaGuardo/setup-clj-kondo@master with: - version: '2022.03.04' + version: '2022.04.08' - run: clj-kondo --lint src:test --config '{:output {:pattern "::{{level}} file={{filename}},line={{row}},col={{col}}::{{message}}"}}' cljstyle: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5f5517cb..71119e5f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: with: tools-deps: latest lein: latest - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: path: ~/.m2 key: test-m2-${{ hashFiles('deps.edn') }}-v1 diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index afff1508..512b5d68 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -2,6 +2,19 @@ All notable changes to this project will be documented in this file. This change == Unreleased (dev) +== 1.6.1 (2022-04-09) +// {{{ +=== Changed +* Bumped clojure to 1.11.1. +* Bumped rewrite-clj to 1.0.767-alpha. +* Bumped kaocha to 1.64.1010. +* Bumped tools.build to v0.8.1. + +=== Fixed +* https://github.com/liquidz/antq/pull/155[#155]: Fixed `deps.edn` extractor to handle `:default-deps` key. +* https://github.com/liquidz/antq/pull/155[#155]: Fixed `deps.edn` upgrader to handle `:default-deps` key. +// }}} + == 1.6.0 (2022-03-05) // {{{ === Added diff --git a/README.adoc b/README.adoc index 8bc7c7b7..8cd6c6d5 100644 --- a/README.adoc +++ b/README.adoc @@ -88,7 +88,7 @@ From Clojure CLI ver `1.10.3.933`, https://clojure.org/reference/deps_and_cli#to [source,sh] ---- # install -clojure -Ttools install com.github.liquidz/antq '{:git/tag "1.6.0"}' :as antq +clojure -Ttools install com.github.liquidz/antq '{:git/tag "1.6.1"}' :as antq # uninstall clojure -Ttools remove :tool antq # execute diff --git a/deps.edn b/deps.edn index 6f8d84f1..adf47774 100644 --- a/deps.edn +++ b/deps.edn @@ -1,6 +1,6 @@ {:paths ["src"] :deps - {org.clojure/clojure {:mvn/version "1.10.3"} + {org.clojure/clojure {:mvn/version "1.11.1"} org.clojure/data.xml {:mvn/version "0.2.0-alpha6"} org.clojure/data.zip {:mvn/version "1.0.0"} org.clojure/tools.cli {:mvn/version "1.0.206"} @@ -9,7 +9,7 @@ org.clojure/data.json {:mvn/version "2.4.0"} clj-commons/clj-yaml {:mvn/version "0.7.108"} version-clj/version-clj {:mvn/version "2.0.2"} - rewrite-clj/rewrite-clj {:mvn/version "1.0.699-alpha"}} + rewrite-clj/rewrite-clj {:mvn/version "1.0.767-alpha"}} :tools/usage {:ns-default antq.tool} @@ -18,10 +18,13 @@ {:1.9 {:override-deps {org.clojure/clojure {:mvn/version "1.9.0"}}} + :1.10 + {:override-deps {org.clojure/clojure {:mvn/version "1.10.3"}}} + :dev {:extra-paths ["test" "test/resources"] - :extra-deps {lambdaisland/kaocha {:mvn/version "1.63.998"} + :extra-deps {lambdaisland/kaocha {:mvn/version "1.64.1010"} lambdaisland/deep-diff2 {:mvn/version "2.0.108"}}} :nop @@ -38,7 +41,7 @@ :main-opts ["-m" "cloverage.coverage" "--ns-exclude-regex" "leiningen.antq"]} :build - {:deps {io.github.clojure/tools.build {:git/tag "v0.8.0" :git/sha "e3e3532"} + {:deps {io.github.clojure/tools.build {:git/tag "v0.8.1" :git/sha "7d40500"} slipset/deps-deploy {:mvn/version "0.2.0"}} :ns-default build} diff --git a/pom.xml b/pom.xml index f43bf88a..2c2978b3 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.github.liquidz antq - 1.6.0 + 1.6.1 antq Point out your outdated dependencies https://github.com/liquidz/antq @@ -27,7 +27,7 @@ org.clojure clojure - 1.10.3 + 1.11.1 org.clojure @@ -42,7 +42,7 @@ rewrite-clj rewrite-clj - 1.0.699-alpha + 1.0.767-alpha org.clojure diff --git a/src/antq/util/maven.clj b/src/antq/util/maven.clj index 9d672694..a2e128ba 100644 --- a/src/antq/util/maven.clj +++ b/src/antq/util/maven.clj @@ -66,14 +66,16 @@ (or (u.lein/env x) (str x)))) -(defn- ^Server new-repository-server +(defn- new-repository-server + ^Server [{:keys [id username password]}] (doto (Server.) (.setId id) (.setUsername (ensure-username-or-password username)) (.setPassword (ensure-username-or-password password)))) -(defn ^Settings get-maven-settings +(defn get-maven-settings + ^Settings [opts] (let [settings ^Settings (deps.util.maven/get-settings) server-ids (set (map #(.getId %) (.getServers settings)))] @@ -119,12 +121,14 @@ :artifact artifact :remote-repos remote-repos})) -(defn- ^Model read-pom* +(defn- read-pom* + ^Model [^String url] (with-open [reader (io/reader url)] (.read (MavenXpp3Reader.) reader))) -(defn ^Model read-pom +(defn read-pom + ^Model [^String url] (when-not (str/includes? url "s3://") ; can't do diff's on s3:// repos, https://github.com/liquidz/antq/issues/133. (loop [i 0] @@ -139,15 +143,18 @@ (log/warning (str "Fetching pom from " url " failed because of the following error: " (.getMessage e))))) (recur (inc i))))))) -(defn ^String get-url +(defn get-url + ^String [^Model model] (.getUrl model)) -(defn ^Scm get-scm +(defn get-scm + ^Scm [^Model model] (.getScm model)) -(defn ^String get-scm-url +(defn get-scm-url + ^String [^Scm scm] (.getUrl scm)) @@ -177,7 +184,8 @@ (def get-local-versions (memoize get-local-versions*)) -(defn ^Authenticator authenticator +(defn authenticator + ^Authenticator [^String username ^String password] (proxy [Authenticator] [] (getPasswordAuthentication [] diff --git a/test/antq/dep/clojure_test.clj b/test/antq/dep/clojure_test.clj index 2dc6c1e7..b863e514 100644 --- a/test/antq/dep/clojure_test.clj +++ b/test/antq/dep/clojure_test.clj @@ -45,6 +45,7 @@ (java-dependency {:name "baz/baz" :version "3.0.0"}) (java-dependency {:name "rep/rep" :version "4.0.0"}) (java-dependency {:name "ovr/ovr" :version "5.0.0"}) + (java-dependency {:name "dft/dft" :version "6.0.0"}) (git-sha-dependency {:name "sha/sha" :version "dummy-sha" :extra {:url "https://github.com/example/sha.git"}}) (git-sha-dependency {:name "git-sha/git-sha" :version "dummy-git-sha" diff --git a/test/antq/upgrade/clojure_test.clj b/test/antq/upgrade/clojure_test.clj index cba2cad5..1e19a5fd 100644 --- a/test/antq/upgrade/clojure_test.clj +++ b/test/antq/upgrade/clojure_test.clj @@ -156,3 +156,15 @@ (dep.clj/extract-deps ""))] (t/is (= #{{:name "ovr/ovr" :version {:- "5.0.0" :+ "9.0.0"}}} (h/diff-deps from-deps to-deps))))) + +(t/deftest upgrade-dep-default-deps-test + (let [dummy-dep (assoc dummy-java-dep :name "dft") + from-deps (->> dummy-dep + :file + (slurp) + (dep.clj/extract-deps "")) + to-deps (->> dummy-dep + (upgrade/upgrader) + (dep.clj/extract-deps ""))] + (t/is (= #{{:name "dft/dft" :version {:- "6.0.0" :+ "9.0.0"}}} + (h/diff-deps from-deps to-deps))))) diff --git a/test/resources/dep/deps.edn b/test/resources/dep/deps.edn index 4deb4a75..1fef5f50 100644 --- a/test/resources/dep/deps.edn +++ b/test/resources/dep/deps.edn @@ -31,7 +31,8 @@ :aliases {:foo {:extra-deps {baz {:mvn/version "3.0.0"}} :replace-deps {rep {:mvn/version "4.0.0"}} - :override-deps {ovr {:mvn/version "5.0.0"}}} + :override-deps {ovr {:mvn/version "5.0.0"}} + :default-deps {dft {:mvn/version "6.0.0"}}} :bar {;; same artifact name, but different version number :extra-deps {foo/core {:mvn/version "1.1.0"}}}} diff --git a/test/resources/integration-testing/green/project.clj b/test/resources/integration-testing/green/project.clj index c3b1e91c..a74f6ef2 100644 --- a/test/resources/integration-testing/green/project.clj +++ b/test/resources/integration-testing/green/project.clj @@ -1,7 +1,7 @@ (defproject green "n/a" :description "Please keep me updated - `lein antq` should pass for this project" :managed-dependencies [[com.stuartsierra/dependency "1.0.0"]] - :dependencies [[org.clojure/clojure "1.10.3"] + :dependencies [[org.clojure/clojure "1.11.1"] [com.stuartsierra/dependency]] :plugins [[lein-pprint "1.3.2"] [com.github.liquidz/antq "RELEASE"]]