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:

  1. create new project with:

    lein new app javafoo 
  2. add project.clj

    :aot :all :java-source-paths ["src/java"] 
  3. put src/javafoo/core.clj:

    (ns javafoo.core) (deftype ppoint [x y]) 
  4. 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");     } } 
  5. try compile

    lein compile 

it fails package javafoo.core doesn't exist. have to

  1. comment out :java-source-paths
  2. compile
  3. uncomment :java-source-paths
  4. compile

it works. there way make work start?

add line project.clj:

:prep-tasks [["compile" "javafoo.core"] "javac"] 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -