clojure - Leiningen compilation order? -
i'm learning how lein
, , i'd use java source class created deftype
in clojure source. wasn't covered in basic tutorial , can't work properly.
the problem java source can't import clojure class, since hasn't been compiled yet. , clojure class isn't compiled, since compilation aborted java source.
i give minimal example:
create new project with:
lein new app javafoo
add
project.clj
:aot :all :java-source-paths ["src/java"]
put
src/javafoo/core.clj
:(ns javafoo.core) (deftype ppoint [x y])
put
src/java/javafoo.java
:package foo.java; import javafoo.core.ppoint; public class javafoo { public static void main(string[] args) { system.out.println("javafoo"); } }
try compile
lein compile
it fails package javafoo.core doesn't exist
. have to
- comment out
:java-source-paths
- compile
- uncomment
:java-source-paths
- compile
it works. there way make work start?
add line project.clj
:
:prep-tasks [["compile" "javafoo.core"] "javac"]
Comments
Post a Comment