I'm having troubles compiling a mixture of clojure and java files into a single package. The files have dependencies between each other and if they were all just java files the java compiler could handle all of this. Just to make this concrete I want to create a package called pkg with 4 files, A.java, b.clj, c.clj, and D.java. A.java contains main and creates an object declared in b.clj, b.clj calls functions in c.clj and uses objects of class D. How do I write the project file?
If I use
:prep-tasks ["javac" "compile"]
in the project file then I get a complaint while compiling A.java that something in pkg.b or pkg.c is undefined. If I use
:prep-tasks ["compile" "javac"]
I get a complaint that class pkg.D does not exist. If I try
:prep-tasks [["javac" "pkg/D.java"] "compile" "javac"]
it can't find pkg/D.java, even though I set java-source-paths correctly.
One way to handle this would be to create 3 packages, one that contains A.java, one that contains b.clj and c.clj, and one that contains D.java. Then build a jar for D.java, a jar for b and c, that uses D.jar, and a jar for A that uses bc.jar and D.jar. Ugly, though.