timofreiberg / bultitude Goto Github PK
View Code? Open in Web Editor NEWThis project forked from raynes/bultitude
A namespace finder library.
License: Eclipse Public License 1.0
This project forked from raynes/bultitude
A namespace finder library.
License: Eclipse Public License 1.0
Files starting with (in-ns ...)
instead of (ns ...)
are not found since the in-ns
form is ignored.
Since in-ns
can create namespaces, bultitude should return those forms as well.
Created in response to #3
Using bultitude on Java 11 gives back nothing when looking for namespaces on the classpath. Tried to look into it, but my java chops are a bit too weak to even know where to begin as RT/baseLoader is what is used as loader for dynapath.
user => (require '[bultitude.core :as b])
nil
user => (take 10 (b/namespaces-on-classpath))
()
Creating multiple namespaces in one file is unidiomatic, but I'd like to support it properly anyway.
Naively reading the entire file and returning all ns
and in-ns
forms is a bad idea because reading namespace aliased keywords without having evaluated the namespace aliases will crash (see the bug described here: #3).
The current plan is to build on the good work from the kibit project and use https://github.com/TimoFreiberg/total-reader to read the entire file.
See technomancy/leiningen#2133
One way would be to add a :tell-me-if-its-unreadable-but-dont-crash
option.
The optional :prefix
argument filters entries that don't start with the given prefix.
bultitude searches both JAR files and directories in the classpath though, and the two implementations handle the prefix differently.
Directory
For directories, :prefix
is used as the full name of a subdirectory. If such a subdirectory doesn't exist, nothing will be found.
JAR file
For JAR files, :prefix
is used to filter namespaces whose name starts with the given prefix. The docstring also describes this behaviour.
Examples:
;; JAR
(def jar-path (io/file "/home/timo/.m2/repository/org/clojure/tools.reader/1.3.0-alpha3/tools.reader-1.3.0-alpha3.jar"))
(file->namespaces nil jar-path)
;; => (cljs.tools.reader.reader-types clojure.tools.reader clojure.tools.reader.edn ...)
(file->namespaces "clj" jar-path)
;; => (cljs.tools.reader.reader-types)
(file->namespaces "cljs.tools.re" jar-path)
;; => (cljs.tools.reader.reader-types)
;; Directory
(def dir-path (io/file "/home/timo/projects/clj/bultitude/src"))
(file->namespaces nil dir-path)
;; => (bultitude.core bulti-tude.cond)
(file->namespaces "bult" dir-path)
;; => ()
(file->namespaces "bultitude" dir-path)
;; => (bultitude.core)
I think the prefix argument should be changed to match substrings for directories as well.
I’m revisiting an old Leiningen ticket about dependency auditing technomancy/leiningen#1608, and noticed that you haven’t published your PGP public key to public key servers (gpg --send-keys E530F3B60F8C007EA9C76951C1877D95FC999246
). That makes it impossible to verify the signature of Bultitude 0.3.0.
(I know that this ticket is a bit of a nuisance, so feel free to close if you can’t be bothered.)
The test-all
target didn't work for Clojure 1.6 and all older versions
It failed with a
java.io.FileNotFoundException: Could not locate bulti_tude/cond__init.class or bulti_tude/cond.clj on classpath:
See https://travis-ci.org/TimoFreiberg/bultitude/builds/406565601
This worked three years ago: https://travis-ci.org/Raynes/bultitude/builds/71455962
The only thing that changed was the lein version (the exact travis script didn't even work, I changed it in 9974c0b)
I assume that something changed in leiningen which caused test/bulti_tude/cond.cljc to not be added to the classpath for older Clojure versions.
I added src/bulti_tude/cond.clj and this fixed the issue.
Since I barely understand how this library works, I'm not sure whether this is a sensible fix.
Can someone help me out? Maybe @technomancy?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.