Skip to content

Commit fb9f246

Browse files
Add JDK 22 to build matrix
1 parent b5c133d commit fb9f246

2 files changed

Lines changed: 18 additions & 18 deletions

File tree

src/docker_clojure/config.clj

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
(s/nilable (s/and ::non-blank-string #(re-matches #"[\d\.]+" %))))
2929
(s/def ::build-tools (s/map-of ::build-tool ::build-tool-version))
3030

31-
(s/def ::exclusions
32-
(s/keys :opt-un [::jdk-version ::distro ::build-tool ::build-tool-version]))
33-
3431
(s/def ::maintainers
3532
(s/coll-of ::non-blank-string :distinct true :into #{}))
3633

@@ -39,7 +36,7 @@
3936

4037
(def git-repo "https://github.com/Quantisan/docker-clojure.git")
4138

42-
(def jdk-versions #{8 11 17 21})
39+
(def jdk-versions #{8 11 17 21 22})
4340

4441
(def base-images
4542
"Map of JDK version to base image name(s) with :default as a fallback"
@@ -95,14 +92,13 @@
9592
; issue like this.
9693

9794
; no more focal builds for JDK 20+
98-
; TODO: Add ability to specify version >= 20 for these
99-
{:jdk-version 21
95+
{:jdk-version #(>= % 20)
10096
:distro :ubuntu/focal}
97+
; boot is breaking on Alpine
10198
{:build-tool "boot"
102-
:distro :alpine/alpine} ; boot is breaking on Alpine
99+
:distro :alpine/alpine}
103100
; we're no longer building boot variants for JDK 20+
104-
; TODO: Add ability to specify version >= 20 for these
105-
{:jdk-version 21
101+
{:jdk-version #(>= % 20)
106102
:build-tool "boot"}
107103
;; commented out example
108104
#_{:jdk-version 8

src/docker_clojure/core.clj

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,19 @@
1414
[docker-clojure.log :refer [log] :as logger]
1515
[clojure.edn :as edn]))
1616

17-
(defn contains-every-key-value?
18-
"Returns true if the map `haystack` contains every key-value pair in the map
19-
`needles`. `haystack` may contain additional keys that are not in `needles`.
20-
Returns false if any of the keys in `needles` are missing from `haystack` or
21-
have different values."
22-
[haystack needles]
17+
(defn exclude-variant?
18+
"Returns true if the map `variant` contains every key-value pair in the map
19+
`exclusion`. `variant` may contain additional keys that are not in
20+
`exclusion`. Some values of `exclusion` can also be a predicate of one
21+
argument which is then tested against the respective value from `variant`.
22+
Returns false if any of the keys in `exclusions` are missing from `variant` or
23+
have different values, or the predicate value returned false."
24+
[variant exclusion]
2325
(every? (fn [[k v]]
24-
(= v (get haystack k)))
25-
needles))
26+
(if (fn? v)
27+
(v (get variant k))
28+
(= v (get variant k))))
29+
exclusion))
2630

2731
(defn base-image-tag
2832
[base-image jdk-version distro]
@@ -37,7 +41,7 @@
3741
"Returns true if `variant` matches one of `exclusions` elements (meaning
3842
`(contains-every-key-value? variant exclusion)` returns true)."
3943
[exclusions variant]
40-
(some (partial contains-every-key-value? variant) exclusions))
44+
(some (partial exclude-variant? variant) exclusions))
4145

4246
(s/def ::variant
4347
(s/keys :req-un [::cfg/jdk-version ::cfg/base-image ::cfg/base-image-tag

0 commit comments

Comments
 (0)