Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Leiningen, :warn-on-reflection. Wanted for current project only

If I switch :warn-on-reflection on in Leiningen (Ver. 2), I get warnings not only for the current project, but for dependencies too. (And, e.g. even if I call "lein help", it will e.g. warn about reflections in clucy - a dependency of leiningen itself.)

As these projects are out of my current scope, I want a possibility to restrict the warnings to the current project only. Is this possible, and how?

like image 948
Falko Avatar asked Jun 10 '12 18:06

Falko


2 Answers

You can simply add

(set! *warn-on-reflection* true)

at the top of your "main" .clj file. Right after use and require statements for external code, but before require and/or load statements for your own code.

like image 51
Dimagog Avatar answered Nov 04 '22 10:11

Dimagog


Clojure namespace compilation is transitive. See: Transitive AOT Compilation

Workaround, checkout clucy and:

→ lein compile :all
→ lein install

so the Clojure compiler will skip the compilation of clucy, because the classfiles already exist.

like image 28
Jürgen Hötzel Avatar answered Nov 04 '22 12:11

Jürgen Hötzel