Deraen / boot-cljx

Boot task to compile Cljx
MIT License
7 stars 3 forks source link

cljx namespaces not found by clojure or cljs #7

Closed triss closed 9 years ago

triss commented 9 years ago

Hi,

I'm experiencing issues whereby my .cljx namespaces can't be found in my Clojure or CLJS code.

I'm told No such namespace blah blah... upon issuing boot dev.

Could this be down to the following?

My build.boot can be found here: https://gist.github.com/triss/b6104c6be3df6e132fc0

Deraen commented 9 years ago

Works for me.

Could you provide more detailed errors? Looking at the target directory isn't too helpful as it doesn't necessarily contain everything that is in classpath and no boot task should ever read files from target dir.

For Clojure part you could check if you can require namespace defined in cljx file after doing "boot cljx repl".

triss commented 9 years ago

I can't require the namespace from the clojure repl:

boot.user=> (require '[rum-xox.css-helpers])

boot.user=> java.io.FileNotFoundException: Could not locate rum_xox/css_helpers__init.class or rum_xox/css_helpers.clj on classpath: 

Results of boot -vv dev when including namespace from Clojure here: https://gist.github.com/triss/d87c39163559552b0274

And from ClojureScript here: https://gist.github.com/triss/16df998b1230209d6d2a

Thanks for the prompt response!

Deraen commented 9 years ago

I released boot-cljx 0.2.2 which adds a debug print, could you run boot -vv dev with the new version.

triss commented 9 years ago

Here's the cljs error: https://gist.github.com/triss/5e6ea6885c1a92698c99 And here's the clojure one: https://gist.github.com/triss/52adf56989ce0123011d

Deraen commented 9 years ago

Ah, right! Try converting the hyphen in the directory name to underscore.

rum-xox -> rum_xox

triss commented 9 years ago

That's fixed it cheers man... sorry for not spotting that myself!

martinklepsch commented 9 years ago

would be kind of nice to have some sanity checks for directories with dashes in :source-paths, ran into this myself before... always tricky to see if you don't know what to look for.

Deraen commented 9 years ago

I guess that could be part of bootlaces or some other lib providing utility tasks.