Skip to content

Commit 4c6a991

Browse files
committed
Revert use of java.util.HexFormat (not available in Babashka), and dependency on JDK 17
1 parent 063ebd7 commit 4c6a991

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

CHANGES.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
*BREAKING CHANGES*
44

5-
* JDK 17 is now required when using Clojure
65
* Groups are now defined in the options passed to `net.lewisship.cli-tools/dispatch`, not in
76
namespace metadata
87
* Command names are matched as prefixes (not substrings)

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ Documentation starts with [the overview](doc/overview.md).
5757
## Compatibility
5858

5959
`cli-tools` is compatible with Clojure 1.11 and above, and w/ Babashka.
60-
For Clojure, it requires JDK 17 or above.
6160

6261
## License
6362

src/net/lewisship/cli_tools/cache.cljc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
[clj-commons.ansi :refer [perr]]
1010
#?(:bb [babashka.classpath :as cp]))
1111
(:import (java.io File)
12-
(java.util HexFormat)
1312
(java.nio ByteBuffer)
1413
(java.security MessageDigest)))
1514

@@ -59,10 +58,10 @@
5958
;; Adding or removing a file (even if no other files are touched) will change the digest.
6059
(update-digest-recursively digest f))))
6160

62-
(defn- hex-string
63-
[^bytes input]
64-
(-> (HexFormat/of)
65-
(.formatHex input)))
61+
(defn- hex-string [^bytes input]
62+
(let [sb (StringBuilder.)]
63+
(run! #(.append sb (format "%X" %)) input)
64+
(str sb)))
6665

6766
(defn classpath-digest
6867
"Passed the tool options, return a hex string of the SHA-1 digest of the files from the classpath and

0 commit comments

Comments
 (0)