Hi Mimmo, I can't speak to what practice is best, but I can explain the Javelin Leiningen and lein-cljsbuild configuration.
A ClojureScript library like Javelin usually has no compiled pieces to distribute the way a Clojure program that uses AOT or a Java program might. The only example I can think of is a ClojureScript library with Clojure macros that AOT. As such, it's possible (but silly, because you probably want to compile tests) to create and distribute a ClojureScript library that doesn't use lein-cljsbuild at all. One must ensure only that the ClojureScript sources are included in the jar's resource manifest, which is what Javelin does [1]. Javelin, though it includes Clojure code for ClojureScript macros, also has no explicit Clojure dependency. Javelin's macros depend on the presence of a Clojure provided by the lein-cljsbuild plugin that's used by the consumer to compile the program that depends on Javelin. One of Javelin's dependencies, cljs-priority-map [2], is configured similarly. As cljs-priority-map doesn't use any ClojureScript macros, its :source-paths specifies only "src/cljs". lein-cljsbuild's :source-paths option is less about packaging and more about building - it specifies where in the current project to look for sources. I don't know which, but either the ClojureScript compiler or lein-cljsbuild look also on the classpath for resources and resolve namespaces to files on it, which is how Javelin is able to depend on cljs-priority-map. I hope this clarifies things. Have fun with Javelin! Alan 1. https://github.com/tailrecursion/javelin/blob/master/project.clj#L9 2. https://github.com/tailrecursion/cljs-priority-map/blob/master/project.clj On Tuesday, February 19, 2013 3:13:13 PM UTC-5, Mimmo Cosenza wrote: > > Hi all, > as someone perhaps remember, few days ago I asked about the state of > feature expressions which appeared to be immutable ;-) from july 2012. > David Nolen gave us a hope to have them in the 1.6 version. > > I'm studying the javelin lib which has been recently release. I alway > start from project.clj (yes from lein) to understand a library which is new > to me (most of them actually) > > In javelin lib it seems to me that there is a third way to bypass the > CLJ/CLJS differences: the new :source-paths of lein-cljsbuild plugin. I'm > getting confused. > > If that impression is true, which is the best practice to bypass the > CLJ/CLJS differences in the meantime we'll have the feature expression? > > Hope to have understood correctely the javelin lib. If not, sorry about > that. > > Mimmo > > -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
