Falko
Falko

Reputation: 1038

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?

Upvotes: 8

Views: 1156

Answers (2)

Dimagog
Dimagog

Reputation: 1925

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.

Upvotes: 3

Jürgen Hötzel
Jürgen Hötzel

Reputation: 19747

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.

Upvotes: 2

Related Questions