-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
65 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -210,6 +210,10 @@ NOTE: You must specify `groupId/artifactId` for Java dependencies. | |
|
||
WARNING: `focus` option is prefer than `exclude` option. | ||
|
||
If you want to focus the upgrade on specific version of dependency, you can use --focus=ARTIFACT_NAME[@VERSION] | ||
E.g. `--focus=com.github.liquidz/[email protected]` | ||
Will set antq dep to version 50.2.0, even if that version doesn't exist | ||
|
||
=== --skip=PROJECT_TYPE | ||
Skip to search specified project files. | ||
Must be one of `boot`, `clojure-cli`, `github-action`, `pom`, `shadow-cljs` and `leiningen`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,6 +112,14 @@ | |
false "foo" | ||
true "foo/bar")) | ||
|
||
(t/testing "focus works with specified version `@`" | ||
(t/are [expected in] (= expected (sut/skip-artifacts? (r/map->Dependency {:name in}) | ||
{:focus ["org.clojure/clojure" "[email protected]"]})) | ||
false "org.clojure/clojure" | ||
true "org.clojure/foo" | ||
true "foo/clojure" | ||
false "foo" | ||
true "foo/bar")) | ||
(t/testing "`focus` shoud be prefer than `exclude`" | ||
(t/is (false? (sut/skip-artifacts? (r/map->Dependency {:name "org.clojure/clojure"}) | ||
{:exclude ["org.clojure/clojure"] | ||
|
@@ -184,7 +192,13 @@ | |
(t/testing "[email protected] should be excluded" | ||
(t/is (= [(test-dep {:name "alice" :version "1.0.0" :latest-version "2.0.0"}) | ||
(test-dep {:name "bob" :version "2.0.0" :latest-version "3.0.0"})] | ||
(sut/outdated-deps deps {:exclude ["[email protected]"]})))))) | ||
(sut/outdated-deps deps {:exclude ["[email protected]"]})))) | ||
(t/testing "alice is focused so only this dep should be kept" | ||
(t/is (= [(test-dep {:name "alice" :version "1.0.0" :latest-version "3.0.0"})] | ||
(sut/outdated-deps deps {:focus ["alice"]})))) | ||
(t/testing "focus containing specific version, should force it (0.5.0) even when newer exists (3.0.0)" | ||
(t/is (= [(test-dep {:name "alice" :version "1.0.0" :latest-version "0.5.0" :forced? true})] | ||
(sut/outdated-deps deps {:focus ["[email protected]"]})))))) | ||
|
||
(t/deftest assoc-changes-url-test | ||
(let [dummy-dep {:type :java :name "foo/bar" :version "1" :latest-version "2"}] | ||
|
@@ -309,3 +323,10 @@ | |
(str/trim | ||
(with-out-str | ||
(sut/latest {:type :test :name 'foo/bar})))))) | ||
|
||
(t/deftest forced-artifacts-test | ||
(t/testing "default" | ||
(t/is [] (sut/forced-artifacts {:focus ["foo"]})) | ||
(t/is [{:name "foo" :latest-version "2.0.0"}] (sut/forced-artifacts {:focus ["[email protected]"]})) | ||
(t/is [{:name "foo" :latest-version "2.0.0"} | ||
{:name "foo/zbar2" :latest-version "2"}] (sut/forced-artifacts {:focus ["[email protected]" "foo" "foo/bar" "foo/zbar2@2"]})))) |