How do I set up the project.clj project so that Leiningen finds my sources in a non-standard directory structure?

The Leiningen compilation task seems to be looking for source packages to run immediately in the / src directory. I use both Java and Clojure in my project, so my / src directory looks like this:

/src/java/myapp /src/clojure/myapp 

Leiningen is currently looking for / src / myapp , and it does not work at compile time.

Related, I would like to know how to manually add directories to the class path for compiling and replicating Leiningen. For example, the Enlive deftemplate function will look for the class path for a file with a named template. Adding / templates to the classpath will be necessary to properly create and run my project.

+4
source share
2 answers

This will be fixed in Leiningen 1.0, which currently looks good for release next week or so. Hope someone writes a javac plugin for Leiningen; it should be easy to write, since Lein binds ant, so you can just reuse the ant javac task.

+2
source

Have you tried setting :root in the project file?

After looking at the source code of the compilation command, it will only process Clojure files anyway and will look for these files in the section (file (:root project) "src") , so you can set :root to point to "src / clojure /" but you still need a symlink so that "src / clojure / src /" exists ...

0
source

All Articles