Skip to content

Commit

Permalink
Set up refresh-dirs for Orchard development
Browse files Browse the repository at this point in the history
Splits `java.parser` / `java.legacy-parser` into distinct `:source-paths`.

This way, we can conditionally set the `refresh-dirs` for those of us using `tools.namespace` / `cider-refresh`, without it being broken
because either of these namespaces couldn't be loaded under one's JDK.
  • Loading branch information
vemv authored and bbatsov committed Sep 27, 2021
1 parent 97e6538 commit ffb71cd
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions dev/user.clj
Original file line number Diff line number Diff line change
@@ -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))
6 changes: 5 additions & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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)
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit ffb71cd

Please sign in to comment.