Skip to content

Instantly share code, notes, and snippets.

@pintowar
Last active April 22, 2016 14:47
Show Gist options
  • Save pintowar/ec155089a8e3f89d260782004cc06601 to your computer and use it in GitHub Desktop.
Save pintowar/ec155089a8e3f89d260782004cc06601 to your computer and use it in GitHub Desktop.
Gradle script to run a clojure project
plugins {
id "de.kotka.clojuresque.nrepl" version "2.0.0"
}
apply plugin: 'application'
clojure {
warnOnReflection = true
aotCompile = true
}
//To execute src/main/clojure/poc/core.clj file
mainClassName = "poc.core"
repositories {
jcenter()
}
// In this section you declare the dependencies for your production and test code
dependencies {
compile 'org.slf4j:slf4j-api:1.7.14'
compile 'org.clojure:clojure:1.8.0'
compile 'org.clojure:tools.nrepl:0.2.12'
testCompile 'junit:junit:4.12'
}
task repl(type: JavaExec) {
classpath project.sourceSets.main.clojure.srcDirs,
project.sourceSets.test.clojure.srcDirs,
sourceSets.test.runtimeClasspath,
sourceSets.main.runtimeClasspath
main = "clojure.main"
standardInput = System.in
}
(ns poc.core
(:gen-class))
(defn -main []
"I can say 'Hello World'."
(println "Hello, World!"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment