From bcc0df1bb06b0f86054681ca2630c256f8ba65fd Mon Sep 17 00:00:00 2001 From: Mark Wardle Date: Thu, 14 Nov 2024 20:30:52 +0000 Subject: [PATCH] Add warning to build when using jdk>=21 for backwards compatibility --- build.clj | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build.clj b/build.clj index dce23b33..fb9c9945 100644 --- a/build.clj +++ b/build.clj @@ -81,9 +81,18 @@ (jar nil) (dd/deploy {:installer :remote, :artifact jar-file :pom-file (b/pom-path {:lib lib, :class-dir class-dir})})) + +(defn- check-jvm + [] + (let [jvm-version (-> (System/getProperty "java.specification.version") Integer/parseInt)] + (when (>= jvm-version 21) + (throw (ex-info "Not building with jdk >= 21 because of the SequencedCollection issue." {}))) + (println "Building with jdk" jvm-version))) + (defn uber "Build an executable uberjar file for HTTP server and CLI tooling." [{:keys [out] :or {out uber-file}}] + (check-jvm) (println "Building uberjar:" out) (update-citation nil) (clean nil) @@ -112,4 +121,4 @@ :repo "hermes" :tag (str "v" version) :file uber-file - :sha256 true})) \ No newline at end of file + :sha256 true}))