Skip to content

Commit

Permalink
update tools.deps to latest. now :project is :dir
Browse files Browse the repository at this point in the history
  • Loading branch information
namenu committed Mar 9, 2024
1 parent 1ae7d0c commit a58e383
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 17 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ This workflow will comment on your PR as shown below.
clojure -Ttools install-latest :lib io.github.namenu/deps-diff :as deps-diff`

# resolve deps before changes
clojure -X:deps tree :project '"base/deps.edn"' > __before.edn
clojure -X:deps tree :dir '"./before"' > __before.edn
# resolve deps after changes
clojure -X:deps tree :project '"after/deps.edn"' > __after.edn
clojure -X:deps tree :dir '"./after"' > __after.edn

# then compare
clojure -Tdeps-diff diff :base '"__before.edn"' :target '"__after.edn"' :format :cli
Expand Down
16 changes: 8 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ inputs:
required: true
description: git/sha of base commit
default: ${{ github.event.pull_request.base.sha }}
project:
dir:
required: false
description: path of the target deps.edn
default: "deps.edn"
description: root directory of deps.edn
default: "."
aliases:
required: false
description: aliases to create basis
Expand Down Expand Up @@ -42,7 +42,7 @@ runs:
- name: Install clojure tools
uses: DeLaGuardo/setup-clojure@12.5
with:
cli: 1.11.1.1413
cli: 1.11.2.1446

- name: Cache maven
uses: actions/cache@v4
Expand All @@ -64,8 +64,8 @@ runs:
- name: Resolve base
shell: bash
run: |
PROJECT=${{ inputs.project }}
clojure -X:deps tree :project '"'$PROJECT'"' :aliases '${{ inputs.aliases }}' :format :edn > __base.edn
DIR=${{ inputs.dir }}
clojure -X:deps tree :dir '"'$DIR'"' :aliases '${{ inputs.aliases }}' :format :edn > __base.edn
- name: Checkout target
uses: actions/checkout@v4
Expand All @@ -75,8 +75,8 @@ runs:
- name: Resolve target
shell: bash
run: |
PROJECT=${{ inputs.project }}
clojure -X:deps tree :project '"'$PROJECT'"' :aliases '${{ inputs.aliases }}' :format :edn > __target.edn
DIR=${{ inputs.dir }}
clojure -X:deps tree :dir '"'$DIR'"' :aliases '${{ inputs.aliases }}' :format :edn > __target.edn
- name: Install deps-diff
shell: bash
Expand Down
9 changes: 5 additions & 4 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{:paths ["src"]
:deps {org.clj-commons/pretty {:mvn/version "2.2.1"}
org.clojure/tools.deps {:mvn/version "0.18.1398"}
:deps {org.clojure/clojure {:mvn/version "1.11.2"}
org.clj-commons/pretty {:mvn/version "2.2.1"}
org.clojure/tools.deps {:mvn/version "0.19.1417"}
org.slf4j/slf4j-nop {:mvn/version "2.0.10"}}
:tools/usage {:ns-default namenu.tools.deps-diff}
:aliases {:dev {:extra-paths ["dev"]
:extra-deps {org.clojure/tools.deps.cli {:local/root "./tools.deps.cli"}}
:extra-deps {org.clojure/tools.deps.cli {:mvn/version "0.10.55"}}
:ns-default clojure.tools.deps.cli.api}
:test {:extra-paths ["test" "test-resources"]
:extra-deps {org.clojure/test.check {:mvn/version "1.1.1"}}}}}
:extra-deps {org.clojure/test.check {:mvn/version "1.1.1"}}}}}
10 changes: 7 additions & 3 deletions dev/user.clj
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
(ns user
(:require [clojure.tools.deps.cli.api :as cli]))


(comment
(cli/tree {:project "./test-resources/base/deps.edn"
:aliases [:dev]}))
(= (with-out-str
(cli/tree {:project "./test-resources/base/deps.edn"
:aliases [:dev]}))
(with-out-str
(cli/tree {:dir "./test-resources/base"
:aliases [:dev]})))
)

0 comments on commit a58e383

Please sign in to comment.