lynaghk / cljx

Write a portable codebase targeting Clojure/ClojureScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

0.5.0 fails to run cljx in sequence of prep tasks

sritchie opened this issue · comments

I run my builds with the following in my uberjar profile:

:prep-tasks ^:replace [["clean"]
                                              ["cljx" "once"]
                                              ["cljsbuild" "clean"]
                                              ["cljsbuild" "once" "prod"]
                                              ["javac"]
                                              ["compile" ":all"]]

With cljx 0.4.0 and Leiningen 2.5.0, this works great. When I upgrade to cljx 0.5.0, the cljsbuild task starts running before cljx, causing a compilation failure and crashing the process. Moving cljx after cljsbuild doesn't help.

If I remove all tasks except for cljx, it works.

Any ideas on what might have changed here?

Sorry, submitted without a description. Adding now.

No, no idea, that's bizarre. 0.5.0 was a very incremental release over 0.4.0; the only thing related to :prep-tasks was the elimination of cljx's hooks in 5a6feb7 because due to their semi-deprecation given :prep-tasks.

Haven't tried to repro yet, will do so.

I believe that I'm experiencing the same issue (though I'm new to Clojure in general so I may be way off base).

With version 0.4.0 :prep-tasks [["cljx" "once"] "javac" "compile"] works perfectly fine. With 0.5.0 cljx seems to not run because I get a "java.io.FileNotFoundException: target/generated/cljs" (which is my output dir for cljx ClojureScript).

I ran into this too, here's some debug:

0% lein clean && DEBUG=1 lein uberjar && java -jar target/lupapiste-toj.jar
Leiningen's classpath: /Users/kimmoko/.lein/self-installs/leiningen-2.5.1-standalone.jar
Applying task uberjar to []
(true and target/cljs/public/main.js.map have a type mismatch merging profiles.)
Applying task clean to nil
Applying task cljx to (once)
Applying task clean to nil
Applying task cljsbuild to (once)
Compiling ClojureScript.

It's interesting that cljx task seems to get called (Applying task cljx to (once) in the log above) but somehow it doesn't do anything.

Still running into this one. Any thoughts, @cemerick?

I'm seeing this on Leiningen 2.5.1.

I got around this for now by moving the clean and cljx tasks out of the prep-tasks vector and making an alias:

:aliases {"uberjar" ["do" "clean," "cljx" "once," "uberjar"]}

Thanks Chas. This one was a pain for me too.

I've drastically simplified cljx's "lifecycle" w.r.t. leiningen task execution (no more eval-in-project). This means that anyone that was crazy enough to have their own transformation functions and rulesets (!) needs to now make sure they're added as a :plugin dependency. I'm not aware of anyone that's actually doing this, but this is technically a breaking change.

Available in [org.clojars.cemerick/cljx "0.6.0-SNAPSHOT"] until the final 0.6.0 release is cut. Confirmations of the fix are appreciated.

Works for me, thanks

Fixed for me too.