verspaetung/build.gradle

163 lines
4.4 KiB
Groovy

plugins {
id "com.jfrog.bintray" version "1.0"
id 'com.github.johnrengelman.shadow' version '1.2.0'
id "org.ajoberstar.github-pages" version "1.2.0"
id "org.asciidoctor.gradle.asciidoctor" version "1.5.1"
id 'codenarc'
id 'groovy'
id 'application'
}
group = "com.github.lookout"
description = "A utility for monitoring the delay of Kafka consumers"
version = '0.4.0'
mainClassName = 'com.github.lookout.verspaetung.Main'
defaultTasks 'check', 'assemble'
////////////////////////////////////////////////////////////////////////////////
// TESTING
test {
testLogging {
/* we want more test failure information, see:
* <http://mrhaki.blogspot.com/2013/05/gradle-goodness-show-more-information.html>
*/
exceptionFormat = 'full'
events "passed", "skipped", "failed", "standardOut", "standardError"
}
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// DEPENDENCY MANAGEMENT
repositories {
jcenter()
/* needed for forked metrics library */
maven { url 'https://dl.bintray.com/lookout/systems' }
}
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.4.3+'
[
'curator-framework',
'curator-recipes',
].each { artifactName ->
compile("org.apache.curator:${artifactName}:2.7.0")
}
/* We need the Kafka client libraries so we can fetch broker metadata
* directly from the cluster
*/
compile 'org.apache.kafka:kafka_2.10:0.8.1.+'
/* Needed for command line options parsing */
compile 'commons-cli:commons-cli:1.2+'
compile 'com.github.lookout:metrics-datadog:0.1.3'
['metrics-core', 'metrics-graphite'].each { artifactName ->
compile "io.dropwizard.metrics:${artifactName}:3.1.0"
}
/* Logback is to be used for logging through the app */
compile 'ch.qos.logback:logback-classic:1.1.2+'
codenarc "org.codenarc:CodeNarc:0.24"
testCompile 'org.spockframework:spock-core:0.7-groovy-2.0'
testCompile 'cglib:cglib-nodep:2.2.+'
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// PUBLISHING/DOCUMENTATION
assemble.dependsOn groovydoc
asciidoctor {
/* Using a single backend, so skipping the html5/ output dir */
separateOutputDirs false
}
assemble.dependsOn asciidoctor
githubPages {
repoUri = 'git@github.com:lookout/verspaetung.git'
pages {
into('groovydoc') { from groovydoc }
from asciidoctor
}
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
codenarc {
configFile file("${projectDir}/gradle/codenarc.rules")
sourceSets = [sourceSets.main]
}
codenarcMain {
exclude '**/Main.groovy'
}
shadowJar {
exclude 'META-INF/*.RSA', 'META-INF/*.DSA'
manifest {
attributes 'Main-Class' : mainClassName
}
dependsOn check
}
assemble.dependsOn shadowJar
artifacts {
archives shadowJar
}
/*
* https://github.com/lookout/verspaetung/issues/28
*
* disable the distZip and distTar tasks since we only need the shadow jar
*/
distZip.enabled = false
distTar.enabled = false
/* We're not building a library jar so we'll disable this default jar task */
jar.enabled = false
/* Remove the "library" jar from the archives configuration so it's not
* published
*/
configurations.archives.artifacts.removeAll { it.archiveTask.is jar }
bintray {
user = project.bintrayUser
key = project.bintrayKey
publish = true
/*
* Only only publish when we're tagging a release and if we've executed on
* the JDK7 build. This is to prevent multiple attempts by the build matrix
* to publish the artifacts
*/
dryRun = !((System.env.TRAVIS_TAG as boolean) && (System.env.TRAVIS_JDK_VERSION == 'oraclejdk7'))
configurations = ['archives']
pkg {
userOrg = 'lookout'
repo = 'systems'
name = 'verspaetung'
labels = []
version {
name = project.version
vcsTag = "v${project.version}"
desc = project.description
}
}
}
bintrayUpload.dependsOn assemble
////////////////////////////////////////////////////////////////////////////////