diff --git a/Makefile b/Makefile index 82cc1d8e..5e4d6be2 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ cljfmt: lein with-profile +$(VERSION),+cljfmt cljfmt check kondo: - lein with-profile -dev,+clj-kondo run -m clj-kondo.main --lint src test + lein with-profile -dev,+clj-kondo run -m clj-kondo.main --lint src test src-jdk8 src-newer-jdks # When releasing, the BUMP variable controls which field in the # version string will be incremented in the *next* snapshot diff --git a/dev/user.clj b/dev/user.clj new file mode 100644 index 00000000..4306148c --- /dev/null +++ b/dev/user.clj @@ -0,0 +1,18 @@ +(ns user + (:require + [clojure.java.javadoc :refer [javadoc]] + [clojure.pprint :refer [pprint]] + [clojure.reflect :refer [reflect]] + [clojure.repl :refer [apropos dir doc find-doc pst source]] + [clojure.set :as set] + [clojure.string :as string] + [clojure.test :as test] + [clojure.tools.namespace.repl :refer [refresh refresh-all clear refresh-dirs set-refresh-dirs]])) + +(def jdk8? + (->> "java.version" System/getProperty (re-find #"^1.8."))) + +(cond->> ["dev" "src" "test"] + jdk8? (into ["src-jdk8"]) + (not jdk8?) (into ["src-newer-jdks"]) + true (apply set-refresh-dirs)) diff --git a/project.clj b/project.clj index 4e82d914..85866978 100644 --- a/project.clj +++ b/project.clj @@ -86,6 +86,8 @@ :jvm-opts ["-Dorchard.use-dynapath=true" "-Dclojure.main.report=stderr"] + :source-paths ["src" "src-jdk8" "src-newer-jdks"] + :profiles { ;; Clojure versions matrix :provided {:dependencies [[org.clojure/clojure "1.10.1"] @@ -116,7 +118,9 @@ [])} ;; Development tools - :dev {:dependencies [[pjstadig/humane-test-output "0.10.0"]] + :dev {:dependencies [[org.clojure/tools.namespace "1.1.0"] + [pjstadig/humane-test-output "0.10.0"]] + :source-paths ["dev"] :resource-paths ["test-resources"] :plugins [[com.jakemccrary/lein-test-refresh "0.23.0"]] :injections [(require 'pjstadig.humane-test-output) diff --git a/src/orchard/java/legacy_parser.clj b/src-jdk8/orchard/java/legacy_parser.clj similarity index 100% rename from src/orchard/java/legacy_parser.clj rename to src-jdk8/orchard/java/legacy_parser.clj diff --git a/src/orchard/java/parser.clj b/src-newer-jdks/orchard/java/parser.clj similarity index 100% rename from src/orchard/java/parser.clj rename to src-newer-jdks/orchard/java/parser.clj