Skip to content

Commit

Permalink
Merge pull request #156 from liquidz/dev
Browse files Browse the repository at this point in the history
1.6.1
  • Loading branch information
liquidz authored Apr 8, 2022
2 parents e2c680d + cc4970a commit ac1f009
Show file tree
Hide file tree
Showing 13 changed files with 61 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -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"}
Expand All @@ -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}
Expand All @@ -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
Expand All @@ -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}

Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.liquidz</groupId>
<artifactId>antq</artifactId>
<version>1.6.0</version>
<version>1.6.1</version>
<name>antq</name>
<description>Point out your outdated dependencies</description>
<url>https://github.com/liquidz/antq</url>
Expand All @@ -27,7 +27,7 @@
<dependency>
<groupId>org.clojure</groupId>
<artifactId>clojure</artifactId>
<version>1.10.3</version>
<version>1.11.1</version>
</dependency>
<dependency>
<groupId>org.clojure</groupId>
Expand All @@ -42,7 +42,7 @@
<dependency>
<groupId>rewrite-clj</groupId>
<artifactId>rewrite-clj</artifactId>
<version>1.0.699-alpha</version>
<version>1.0.767-alpha</version>
</dependency>
<dependency>
<groupId>org.clojure</groupId>
Expand Down
24 changes: 16 additions & 8 deletions src/antq/util/maven.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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)))]
Expand Down Expand Up @@ -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]
Expand All @@ -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))

Expand Down Expand Up @@ -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 []
Expand Down
1 change: 1 addition & 0 deletions test/antq/dep/clojure_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 12 additions & 0 deletions test/antq/upgrade/clojure_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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)))))
3 changes: 2 additions & 1 deletion test/resources/dep/deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -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"}}}}

Expand Down
2 changes: 1 addition & 1 deletion test/resources/integration-testing/green/project.clj
Original file line number Diff line number Diff line change
@@ -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"]]
Expand Down

0 comments on commit ac1f009

Please sign in to comment.