It sounds like you have everything setup correctly---nothing stands out to
me as being a problem.
I can't tell for sure without the project source code, though.
Take a look at Prismatic Schema's project.clj:
https://github.com/Prismatic/schema/blob/master/project.clj
they have the same use case as you do (using cljx in a clj and cljs
library), so perhaps you can glean a magic config option from their
project.clj.
best,
Kevin
On Thursday, February 13, 2014 3:22:25 AM UTC-8, Karsten Schmidt wrote:
>
> I've been busy working on a few libraries targetting both Clojure &
> ClojureScript, however so far have only tested the CLJ side and now that it
> comes to addressing CLJS am running in circles (and on fumes)
> unsuccessfully trying to tweak my project settings to make things work.
>
> All my source is using CLJX stored in the the "src-cljx" folder. My rules
> then trigger generated sources into "src-clj" (for all Clojure and shared
> macros) and "src-cljs" for CLJS parts only.
>
> My project.clj is as follows:
>
> (defproject foo "0.1.0-SNAPSHOT"
> :dependencies [[org.clojure/clojure "1.5.1"]
> [org.clojure/clojurescript "0.0-2156"]]
>
> :jar-exclusions [#"\.cljx|\.DS_Store|\.js|\.html"]
>
> :cljx {:builds [{:source-paths ["src-cljx"]
> :output-path "src-clj"
> :rules :clj}
> {:source-paths ["src-cljx"]
> :output-path "src-cljs"
> :rules :cljs}]}
>
> :cljsbuild {:builds
> [{:id "dev"
> :source-paths ["src-clj" "src-cljs"]
> :compiler
> {:pretty-print true
> :output-to "foo-0.1.0-SNAPSHOT.js"
> :optimizations :simple}
> :jar true}]}
>
> :plugins [[com.keminglabs/cljx "0.3.2"]
> [lein-cljsbuild "1.0.2"]]
> :hooks [cljx.hooks leiningen.cljsbuild])
>
> I can successfully create a JAR from this with `lein install`, however if
> I try to use this library as dependency in another CLJS project, none of
> the namespaces of this dependency seem to be found, even though I verified
> that they're present in the JAR (contains both .clj & .cljs versions).
>
> So I then assumed the reasons for this are the non-standard names for the
> source folders. But adding this line at the root level of project.clj will
> not work either and makes `lein install` fail with a
> "java.util.zip.ZipException: duplicate entry":
>
> :source-paths ["src-clj" "src-cljs"]
>
> Therefore can someone please explain or point me to a correct project
> setup to make this work? I've been trying to find answers on SO & Google,
> but it seems this (strangely?) isn't a popular use case and I couldn't find
> any helpful answers.
>
> Once this is solved am happy to write up a short tutorial or create a lein
> template for future reference.
>
> Thank you!
> K.
>
--
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.