Skip to content

Commit a7abd85

Browse files
Use orchard for classpath information
Orchard has encapsulated the boot information already, so that code can go. Orchard has already upgraded to support Java9+ too. Additionally, orchard will receive more long-term maintenance of this code.
1 parent 9b11375 commit a7abd85

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

project.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
^:source-dep [org.clojure/tools.analyzer.jvm "0.7.1"]
1111
^:source-dep [org.clojure/tools.namespace "0.3.0-alpha3"]
1212
^:source-dep [org.clojure/tools.reader "1.1.1"]
13-
^:source-dep [org.clojure/java.classpath "0.2.3"]
13+
^:source-dep [cider/orchard "0.2.0"]
1414
^:source-dep [lein-cljfmt "0.3.0"]
1515
^:source-dep [me.raynes/fs "1.4.6"]
1616
^:source-dep [rewrite-clj "0.6.0"]

src/refactor_nrepl/core.clj

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
(ns refactor-nrepl.core
2-
(:require [clojure.java.classpath :as cp]
3-
[clojure.java.io :as io]
2+
(:require [clojure.java.io :as io]
43
[clojure.string :as str]
54
[clojure.tools.namespace.parse :as parse]
65
[clojure.tools.reader.reader-types :as readers]
6+
[orchard.classpath]
77
[me.raynes.fs :as fs]
88
[refactor-nrepl.util :refer [normalize-to-unix-path]]
99
[refactor-nrepl.s-expressions :as sexp]
@@ -41,22 +41,13 @@
4141
false
4242
(:ignore-paths config/*config*))))
4343

44-
(defn boot-project? []
45-
;; fake.class.path under boot contains the original directories with source
46-
;; files, see https://github.com/boot-clj/boot/issues/249
47-
(not (nil? (System/getProperty "fake.class.path"))))
48-
4944
(defn dirs-on-classpath
5045
"Return all dirs on classpath, filtering out our inlined deps
5146
directory and paths matching :ignore-paths specified in config.
52-
For boot it considers `fake.class.path` rather than real classpath."
47+
Follows the semantics of orchard classpath."
5348
[]
54-
(let [files-on-cp (if (boot-project?)
55-
(map io/file (str/split (System/getProperty "fake.class.path") #":"))
56-
(cp/classpath))]
57-
(->> files-on-cp
58-
(filter fs/directory?)
59-
(remove #(-> % str normalize-to-unix-path ignore-dir-on-classpath?)))))
49+
(->> (orchard.classpath/classpath-directories)
50+
(remove #(-> % str normalize-to-unix-path (.endsWith "target/srcdeps")))))
6051

6152
(defn project-root
6253
"Return the project root directory.

src/refactor_nrepl/ns/slam/hound/search.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
;;;; Distributed under the Eclipse Public License, the same as Clojure.
44
(ns refactor-nrepl.ns.slam.hound.search
55
"Search the classpath for vars and classes."
6-
(:require [clojure.java.classpath :as cp]
6+
(:require [orchard.classpath]
77
[clojure.java.io :refer [file]]
88
[clojure.string :as string])
99
(:import
@@ -111,7 +111,7 @@
111111
(into (map #(System/getProperty %) ["sun.boot.class.path"
112112
"java.ext.dirs"
113113
"java.class.path"])
114-
(map #(.getName %) (cp/classpath-jarfiles))))
114+
(map #(.getName %) (orchard.classpath/classpath-jarfiles))))
115115

116116
(defn- get-available-classes []
117117
(into ()

0 commit comments

Comments
 (0)