Skip to content

Commit

Permalink
Remove Dynapath, accomodate enrich-classpath
Browse files Browse the repository at this point in the history
Fixes #122
Fixes #120
Fixes #105
Fixes #103
Fixes #50
  • Loading branch information
vemv committed Dec 13, 2021
1 parent d92e748 commit b01859d
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .clj-kondo/config.edn
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{:output {:progress true
:exclude-files ["analysis.cljc" "meta.cljc" "inspect_test.clj"]}
:linters {:unused-private-var {:level :warning
:exclude [orchard.query-test/a-private orchard.query-test/docd-fn]}}}
:exclude [orchard.query-test/a-private orchard.query-test/docd-fn]}
;; Enable this opt-in linter:
:unsorted-required-namespaces
{:level :warning}}}
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

## master (unreleased)

### Changes

* Remove `dynapath` dependency
* With it, defns related with mutable classloader are now deprecated and are no-ops
* `-Dorchard.use-dynapath=false` has no effect now either.
* Accomodate [`enrich-classpath`](https://github.com/clojure-emacs/enrich-classpath)
* Now, if you intend to use Orchard for its Java functionality, it is expected that you use enrich-classpath also.
* If not present, Java-related features won't work (but at least won't throw a compile-time error).

### Bugs Fixed

* [#135](https://github.com/clojure-emacs/orchard/issues/135): Fix problematic double var lookup in `orchard.xref/fn-refs`.
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ Just add `orchard` as a dependency and start hacking.
Consult the [API documentation](https://cljdoc.org/d/cider/orchard/CURRENT) to get a better idea about the
functionality that's provided.

#### Using `enrich-classpath` for best results

There are features that Orchard intends to provide (especially, those related to Java interaction) which need to assume a pre-existing initial classpath that already has various desirable items, such as the JDK sources, third-party sources, special jars such as `tools` (for JDK8), a given project's own Java sources... all that is a domain in itself, which is why our [enrich-classpath](https://github.com/clojure-emacs/enrich-classpath) project does it.

For getting the most out of Orchard, it is therefore recommended/necessary to use `enrich-classpath`. Please refer to its installation/usage instructions.

## Configuration options

So far, Orchard follows these options, which can be specified as Java system properties
Expand Down
4 changes: 2 additions & 2 deletions src/orchard/apropos.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
{:author "Jeff Valk"}
(:require
[orchard.meta :refer [var-name var-doc] :as m]
[orchard.query :as query]
[orchard.misc :as misc])
[orchard.misc :as misc]
[orchard.query :as query])
(:import
[clojure.lang MultiFn]))

Expand Down
2 changes: 1 addition & 1 deletion src/orchard/meta.clj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
[clojure.string :as str]
[clojure.walk :as walk]
[orchard.clojuredocs :as cljdocs]
[orchard.namespace :as ns]
[orchard.misc :as misc]
[orchard.namespace :as ns]
[orchard.spec :as spec])
(:import
[clojure.lang LineNumberingPushbackReader]))
Expand Down
2 changes: 1 addition & 1 deletion test-newer-jdks/orchard/java/parser_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(:require
[clojure.test :refer [deftest is testing]]
[orchard.java.parser :as parser]
[orchard.util :as util])
[orchard.test.util :as util])
(:import
(orchard.java DummyClass)))

Expand Down
2 changes: 1 addition & 1 deletion test/orchard/info_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[orchard.java :as java]
[orchard.misc :as misc]
[orchard.test-ns]
[orchard.util :as util]))
[orchard.test.util :as util]))

@java/cache-initializer ;; make tests more deterministic

Expand Down
4 changes: 2 additions & 2 deletions test/orchard/java/classpath_test/third_party_compat_test.clj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(ns orchard.java.classpath-test.third-party-compat-test
(:require
[orchard.java]
[clojure.java.classpath]
[clojure.test :refer [deftest is]]))
[clojure.test :refer [deftest is]]
[orchard.java]))

;; make this namespace's tests deterministic:
@orchard.java/cache-initializer
Expand Down
2 changes: 1 addition & 1 deletion test/orchard/java_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[clojure.test :refer [are deftest is testing]]
[orchard.java :refer [cache class-info class-info* javadoc-url jdk-tools member-info resolve-class resolve-javadoc-path resolve-member resolve-symbol resolve-type source-info]]
[orchard.misc :as misc]
[orchard.util :as util]))
[orchard.test.util :as util]))

(def jdk-parser? (or (>= misc/java-api-version 9) jdk-tools))

Expand Down
2 changes: 1 addition & 1 deletion test/orchard/util.clj → test/orchard/test/util.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns orchard.util)
(ns orchard.test.util)

(def has-enriched-classpath?
(let [v (System/getProperty "orchard.internal.has-enriched-classpath")]
Expand Down

0 comments on commit b01859d

Please sign in to comment.