New Upstream Snapshot - libdynapath-clojure

Ready changes

Summary

Merged new upstream version: 1.1.0+git20191125.1.e82106d+ds (was: 1.0.0).

Resulting package

Built on 2022-07-20T17:17 (took 16m8s)

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-snapshots libdynapath-clojure

Lintian Result

Diff

diff --git a/.travis.yml b/.travis.yml
index f0bfe7e..e29027d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,2 +1,6 @@
 language: clojure
 script: lein test-all
+jdk:
+ - openjdk8
+ - openjdk11
+ - openjdk-ea
diff --git a/Changelog.md b/Changelog.md
index a3c59c7..0f6dcce 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -1,3 +1,19 @@
+# 1.1.0 - 2019-11-25
+
+* Fall back to parsing the `java.class.path` sysprop if the base
+  loader doesn't have a dynapath implementation. This allows for some
+  classpath value to be returned when on Java 9+.
+  
+# 1.0.0 - 2017-10-25
+
+* BREAKING - Don't allow URLClassLoader to be modified. See the README
+  for more details.
+
+# 0.2.5 - 2016-12-09
+
+* Fix URLClassLoader extension to work with Java 9 nightly builds
+* Resolve classes at runtime instead of compile time to resolve AOT issues with Java 9
+
 # 0.2.4 - 2016-05-27
 
 * Update default extension to work with Java 9
diff --git a/README.md b/README.md
index 1f6ffa3..6e396df 100644
--- a/README.md
+++ b/README.md
@@ -35,14 +35,14 @@ Add it as a dependency:
 
 For a Leiningen/Boot project:
 
-    [org.tcrawley/dynapath "1.0.0"]
+    [org.tcrawley/dynapath "1.1.0"]
 
 For a maven project:
 
     <dependency>
       <groupId>org.tcrawley</groupId>
       <artifactId>dynapath</artifactId>
-      <version>0.2.4</version>
+      <version>1.1.0</version>
     </dependency>
 
 If you need to access or modify the effective classpath:
@@ -100,6 +100,7 @@ to do this.
 * [tair-repl](https://github.com/xumingming/tair-repl)
 * [pomegranate](https://github.com/cemerick/pomegranate)
 * [boot](http://boot-clj.com/)
+* [metabase](https://github.com/metabase/metabase)
 
 Are you using it? If so, add yourself to this list and send me a PR.
 
diff --git a/debian/changelog b/debian/changelog
index c08df64..50ebecc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,12 @@
-libdynapath-clojure (1.0.0-4) UNRELEASED; urgency=normal
+libdynapath-clojure (1.1.0+git20191125.1.e82106d+ds-1) UNRELEASED; urgency=normal
 
   [ Louis-Philippe Véronneau ]
   * d/control: New email for the Clojure Team.
 
- -- Louis-Philippe Véronneau <pollo@debian.org>  Sat, 08 Jan 2022 18:32:18 -0500
+  [ Debian Janitor ]
+  * New upstream snapshot.
+
+ -- Louis-Philippe Véronneau <pollo@debian.org>  Wed, 20 Jul 2022 17:06:24 -0000
 
 libdynapath-clojure (1.0.0-3) unstable; urgency=medium
 
diff --git a/project.clj b/project.clj
index 70a5b46..dc48944 100644
--- a/project.clj
+++ b/project.clj
@@ -1,4 +1,4 @@
-(defproject org.tcrawley/dynapath "1.0.0"
+(defproject org.tcrawley/dynapath "1.1.1-SNAPSHOT"
   :description "An abstraction for modifiable/readable class loaders."
   :url "https://github.com/tobias/dynapath"
   :license {:name "Eclipse Public License"
@@ -15,7 +15,7 @@
                               [:url "https://github.com/tobias/"]
                               [:email "toby@tcrawley.org"]
                               [:timezone "-5"]]]
-  :aliases {"test-all" ["with-profile" "+1.4:+1.5:+1.6:+1.7:+1.8:+1.9" "test"]}
+  :aliases {"test-all" ["with-profile" "+1.4:+1.5:+1.6:+1.7:+1.8:+1.9:+1.10" "test"]}
   :profiles {:dev
              {:dependencies [[org.clojure/clojure "1.8.0"]]}
              :1.4
@@ -29,4 +29,6 @@
              :1.8
              {:dependencies [[org.clojure/clojure "1.8.0"]]}
              :1.9
-             {:dependencies [[org.clojure/clojure "1.9.0-beta2"]]}})
+             {:dependencies [[org.clojure/clojure "1.9.0"]]}
+             :1.10
+             {:dependencies [[org.clojure/clojure "1.10.1"]]}})
diff --git a/src/dynapath/util.clj b/src/dynapath/util.clj
index 21c57eb..a83786e 100644
--- a/src/dynapath/util.clj
+++ b/src/dynapath/util.clj
@@ -1,7 +1,8 @@
 (ns dynapath.util
   "Abstracts the getURLs and addURL functionality of URLClassLoader to a protocol."
   (:require [dynapath.dynamic-classpath :as dc]
-            dynapath.defaults)) ;; trigger the default implementations
+            dynapath.defaults) ;; trigger the default implementations
+  (:import [java.io File]))
 
 (defn addable-classpath?
   "Returns true if the given ClassLoader provides add-claspath-url."
@@ -21,11 +22,21 @@
   (if (readable-classpath? cl)
     (dc/classpath-urls cl)))
 
+(defn- system-classpath
+  "Starting with Java 9, the default class loader is no longer an
+  instance of URLClassLoader, so `classpath` returned an empty sequence.
+  See more in clojure/java.classpath"
+  []
+  (map #(-> (File. ^String %) .toURI .toURL)
+       (.split (System/getProperty "java.class.path")
+               (System/getProperty "path.separator"))))
+
 (defn all-classpath-urls
   "Walks up the parentage chain for a ClassLoader, concatenating any URLs it retrieves.
 If no ClassLoader is provided, RT/baseLoader is assumed."
   ([]
-     (all-classpath-urls (clojure.lang.RT/baseLoader)))
+   (or (seq (all-classpath-urls (clojure.lang.RT/baseLoader)))
+       (system-classpath)))
   ([cl]
      (->> (iterate #(.getParent ^ClassLoader %) cl)
           (take-while identity)
diff --git a/test/dynapath/util_test.clj b/test/dynapath/util_test.clj
index fe8fe42..4e26a90 100644
--- a/test/dynapath/util_test.clj
+++ b/test/dynapath/util_test.clj
@@ -37,8 +37,11 @@
 
   (deftest all-classpath-urls-should-use-the-baseLoader-when-called-with-a-zero-arity
     (add-classpath-url (clojure.lang.RT/baseLoader) (first urls))
-    (= (first urls) (last (all-classpath-urls))))
-  
+    (is (= (first urls) (last (all-classpath-urls)))))
+
+  (deftest all-classpath-urls-always-returns-something-when-called-with-a-zero-arity
+    (is (seq (all-classpath-urls))))
+
   (deftest add-classpath-url-should-work-for-an-addable-classpath
     (is (add-classpath-url *dynamic-cl* (last all-urls)))
     (is (= [(last all-urls)] (classpath-urls *dynamic-cl*))))

Debdiff

[The following lists of changes regard files as different if they have different names, permissions or owners.]

Files in second set of .debs but not in first

-rw-r--r--  root/root   /usr/share/java/dynapath-1.1.0+git20191125.1.e82106d.jar
lrwxrwxrwx  root/root   /usr/share/java/dynapath.jar -> dynapath-1.1.0+git20191125.1.e82106d.jar

Files in first set of .debs but not in second

-rw-r--r--  root/root   /usr/share/java/dynapath-1.0.0.jar
lrwxrwxrwx  root/root   /usr/share/java/dynapath.jar -> dynapath-1.0.0.jar

No differences were encountered in the control files

More details

Full run details