Closed arichiardi closed 8 years ago
The Leiningen core library is on the classpath and several templates rely on that and work just fine.
The problem with leiningen-version
and some others functions is that they reach out to environment variables (set by the lein
shell script) or the project.clj
file itself or the non-core Leiningen files -- which boot-new
cannot provide.
Specifically leiningen-version
checks an environment variable (which Java code cannot set) and reads the pom.properties
file out of Leiningen's META-INF
folder tree (which is not part of the Leiningen core).
Oh that explains why I have this error:
clojure.lang.ExceptionInfo: No implementation of method: :make-reader of protocol: #'clojure.java.io/IOFactory found for class: nil
data: {:file "/tmp/boot.user2705218119118993821.clj", :line 15}
The reader in is of course nil
at that point...I wonder if I can detect if I am running boot-new
and skip the call somehow.
I have updated the issue, can still be useful to know a workaround I guess.
As a hack, I could include a fake pom.properties
for Leiningen in boot-new
's JAR that should allow leiningen.core.main/leiningen-version
to be satisfied.
Yes I was thinking about that, but are you going to return a real lein version or like boot-new
as string? This poses the issue of which lein
version boot-new
support I guess.
Yes, boot-new
would "lock" the version of Leiningen it supported so if templates started requiring new features in Leiningen, I'd have to review them anyway and see if boot-new
needed to be updated to support them (and bump the "supported Leiningen version" either way).
Yeah definitely true, it would be great if you could be 100% lein
compatible.
Fixed in release 0.4.3 which just dropped on Clojars. I tested that I can generate a Luminus template.
Great! Thanks super quick ;)
Hello Sean, I know this might or might not be a
boot-new
concern but I am going to report it here for discussion.Sometimes templates use Leiningen-specific functions, like:
[leiningen.core.main :as main :refer [leiningen-version]]
This function is very useful and big templates likeluminus
take advantage or that. Maybe a solution could be to include Leiningen classes on the classpath inboot-new
? Otherwiseboot-new
cannot generate those "popular" templates.When I call it, I get:
I was wondering if there is a way to identify that I am creating the template with
boot-new
and avoid the function call.