I am trying to evaluate gradle as a build tool. For my own education, I am trying to translate an ant script that compiles clojure source, using a flat directory for dependencies, explicitly not using an external repo. I will look into clojuresque plugin later.
What is a gradle-like way to compile java then compile clojure in the same build script. My ant script looks like:
In Gradle, you’d use the Java plugin along with either a third-party Clojure plugin, or a Clojure compiler Ant task, or a ‘JavaExec’ task that executes the Clojure compiler very similar to your Ant script. You’d typically use the regular ‘dependencies {}’ block to declare dependencies and would pass them on to the Clojure compiler (a Clojure plugin would typically do this for you). The buildscript class path is only needed for bringing in third-party plugins or classes that are used by the build itself.
So, how do I add the clojure source directory to the classpath for JavaExec task type?
Compiling clojure isn’t my goal here. I will look at clojuresque later, after understanding more about gradle. I am thinking of things that I do with a different build tool and using them as examples to see how I would put together general solutions to general problems, using gradle.
So, how do I add the clojure source directory to the classpath for JavaExec task type?
Not sure what you mean by that. You’d simply pass the source directory as a command line argument, in whatever form the Clojure compiler expects it. Something like: