Skip to content

Instantly share code, notes, and snippets.

@djKianoosh
Forked from kellyrob99/build.gradle
Created December 5, 2011 16:49
Show Gist options
  • Save djKianoosh/1434270 to your computer and use it in GitHub Desktop.
Save djKianoosh/1434270 to your computer and use it in GitHub Desktop.
build.gradle for setting up a new gradle-based project for use with clojure & clojuresque
apply plugin:'groovy'
apply plugin:'project-report'
buildscript {
repositories {
maven {
name 'clojars'
url 'http://clojars.org/repo'
}
}
dependencies {
classpath 'clojuresque:clojuresque:1.4.4'
}
}
apply plugin:'clojure'
warnOnReflection = true
aotCompile = true
repositories {
mavenLocal()
clojarsRepo()
mavenCentral()
}
dependencies {
groovy 'org.codehaus.groovy:groovy-all:1.8.4'
compile 'org.clojure:clojure:1.3.0'
}
task makeDirs(description:'make all dirs for project setup') << {
def sources = [sourceSets.main, sourceSets.test]
sources*.allSource*.srcDirs.flatten().each { File srcDir ->
println "making $srcDir"
srcDir.mkdirs()
}
}
task wrap(type:Wrapper, description:"create a gradlew") {
gradleVersion = '1.0-milestone-6'
}
@djKianoosh
Copy link
Author

Note: not tested with actual clojure code (yet!).. But 'gradle makeDirs' does create the initial project tree structure, though there are some warnings from gradle with the makeDirs task itself:

The SourceSet.getClassesDir() method is deprecated and will be removed in the next version of Gradle. You should use the getOutput().getClassesDir() method instead.
The 'urls' property of the RepositoryHandler.mavenRepo() method is deprecated and will be removed in a future version of Gradle. You should use the 'url' property to define the core maven repository & the 'artifactUrls' property to define any additional artifact locations.

@djKianoosh
Copy link
Author

Latest version has no deprecation warnings, with clojuresque 1.4.4 (was using 1.4.2 before)... still would like to test it out with some real(ish) clojure code..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment