Permalink
Fetching contributors…
Cannot retrieve contributors at this time
79 lines (68 sloc) 2.29 KB
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'signing'
apply plugin: 'maven-publish'
group = 'com.gmongo'
version = '1.5'
project.ext {
group = 'com.gmongo'
artifact = 'gmongo'
bundleDir = "$buildDir/bundle"
groovyVersion = "2.4.1"
}
repositories {
mavenCentral()
}
dependencies {
compile group: 'org.codehaus.groovy', name: 'groovy', version: project.ext.groovyVersion
compile group: 'org.codehaus.groovy', name: 'groovy-ant', version: project.ext.groovyVersion
compile group: 'org.mongodb', name: 'mongo-java-driver', version: '2.13.0'
testCompile group: 'org.codehaus.groovy', name: 'groovy-test', version: project.ext.groovyVersion
testCompile group: 'junit', name: 'junit', version: '4.10'
}
task source << {
ant.jar(destfile: "$buildDir/${project.ext.artifact}-${version}-sources.jar") {
fileset (dir: 'src/main/groovy', includes: '**/*.groovy')
}
}
task prepareBundle(dependsOn: [ 'build', 'source', 'groovydoc', 'pom' ]) << {
ant.copy(file: "$buildDir/libs/${project.ext.artifact}-${version}.jar", todir: project.ext.bundleDir)
ant.copy(file: "$buildDir/${project.ext.artifact}-${version}-sources.jar", todir: project.ext.bundleDir)
ant.copy(file: "$buildDir/pom.xml", todir: project.ext.bundleDir)
ant.jar(destfile: "${project.ext.bundleDir}/${project.ext.artifact}-${version}-javadoc.jar") {
fileset (dir: "$buildDir/docs/groovydoc")
}
signing.sign(new File(project.ext.bundleDir).listFiles())
}
task packBundle << {
ant.jar(destfile: "${project.ext.bundleDir}/${project.ext.artifact}-${version}-bundle.jar", basedir: new File(project.ext.bundleDir))
}
task pom << {
pom {
project {
groupId project.ext.group
artifactId project.ext.artifact
name 'gmongo'
description 'Mongodb for Groovy'
url 'https://github.com/poiati/gmongo'
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
scm {
url 'http://github.com/poiati/gmongo'
}
developers {
developer {
name 'Paulo Poiati'
email 'paulogpoiati@gmail.com'
url 'http://blog.paulopoiati.com'
}
}
}
}.writeTo("$buildDir/pom.xml")
}