Skip to content

Commit

Permalink
figwheel.main: fix java 10 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruce Hauman committed Jun 12, 2018
1 parent 772c0bb commit 7c423b7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,5 @@ figwheel-main/figwheel.log.lck
figwheel-main/output.log.lck

figwheel-main/.ruby-version

figwheel-main/.java-version
9 changes: 8 additions & 1 deletion figwheel-main/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,15 @@ clean-m2:
install: clean
pushd ../figwheel-core; lein install; popd; pushd ../figwheel-repl; lein install; popd; lein install

test10: clean
jenv local 10.0
lein test
jenv local 1.8

testit: clean
lein test

deploy: clean install docs helper testit
testall: testit test10

deploy: clean install docs helper testall
pushd ../figwheel-core; lein deploy clojars; popd; pushd ../figwheel-repl; lein deploy clojars; popd; lein deploy clojars
17 changes: 11 additions & 6 deletions figwheel-main/src/figwheel/main/util.clj
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@
(java.util.regex.Pattern/compile (System/getProperty "path.separator")))))

(defn dynamic-classpath []
(mapv
#(.getCanonicalPath (io/file (.getFile %)))
(mapcat
#(seq (.getURLs %))
(take-while some? (iterate #(.getParent %) (.getContextClassLoader (Thread/currentThread)))))))
(mapv
#(.getCanonicalPath (io/file (.getFile %)))
(mapcat
#(try (.getURLs %)
(catch Throwable t
nil))
(take-while some? (iterate #(.getParent %) (.getContextClassLoader (Thread/currentThread)))))))

#_((set (dynamic-classpath)) (.getCanonicalPath (io/file "src")))
#_(add-classpath! (.toURL (io/file "src")))
Expand All @@ -65,7 +67,10 @@
((set (static-classpath)) (.getCanonicalPath (io/file dir))))

(defn dir-on-current-classpath? [dir]
((set (dynamic-classpath)) (.getCanonicalPath (io/file dir))))
((into #{}
(concat
(static-classpath)
(dynamic-classpath))) (.getCanonicalPath (io/file dir))))

(defn root-dynclass-loader []
(last
Expand Down

0 comments on commit 7c423b7

Please sign in to comment.