whoas/build.gradle

141 lines
4.1 KiB
Groovy

plugins {
id 'com.jfrog.bintray' version '1.0'
id 'org.asciidoctor.gradle.asciidoctor' version '1.5.1'
id 'com.github.johnrengelman.shadow' version '1.2.0'
}
apply plugin: 'maven'
apply plugin: 'groovy'
apply plugin: 'eclipse'
group = 'com.github.lookout'
version = '0.1.2'
description = 'A server-side webhook publishing library'
sourceCompatibility = '1.6'
targetCompatibility = '1.6'
////////////////////////////////////////////////////////////////////////////////
// DEPENDENCY CONFIGURATION
////////////////////////////////////////////////////////////////////////////////
repositories {
jcenter()
mavenCentral()
}
////////////////////////////////////////////////////////////////////////////////
// DEPENDENCY MANAGEMENT
////////////////////////////////////////////////////////////////////////////////
configurations {
localJavadocs
}
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.3.9+'
compile 'org.glassfish.jersey.core:jersey-client:2.6+'
/* Needed for serializing requests to JSON and back */
compile 'com.fasterxml.jackson.core:jackson-databind:2.3.3+'
/* Needed for better time management/sanity */
compile 'joda-time:joda-time:2.6+'
testCompile 'org.spockframework:spock-core:0.7-groovy-2.0'
testCompile 'cglib:cglib-nodep:2.2.+'
[
'dropwizard-core',
'dropwizard-configuration',
'dropwizard-hibernate',
].each {
compile withSources("io.dropwizard:${it}:0.8.0-rc1")
}
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// TESTING TASKS
////////////////////////////////////////////////////////////////////////////////
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"
}
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// DOCUMENTATION TASKS
////////////////////////////////////////////////////////////////////////////////
asciidoctor {
sourceDir 'src/asciidoc'
outputDir 'docs'
attributes 'toc': 'right',
'source-highlighter': 'coderay',
'toc-title': 'Table of Contents'
shouldRunAfter test
}
check.dependsOn asciidoctor
groovydoc {
destinationDir file('docs/html5/groovydoc')
shouldRunAfter test
}
def withSources(String dependency) {
['sources'].each {
def sourceDependency = dependencies.create("${dependency}:${it}")
configurations.localJavadocs.dependencies.add(sourceDependency)
}
return dependency
}
check.dependsOn groovydoc
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// PUBLISHING TASKS
////////////////////////////////////////////////////////////////////////////////
task publishDocs(type: Exec) {
/* If for whatever reason you need to force-push the gh-pages branch this
* command will work:
* % git push origin `git subtree split --prefix docs/html5 master`:gh-pages --force
*/
group 'Publishing'
description 'Publish the Asciidoctor docs to gh-pages'
commandLine 'git'
args 'subtree', 'push', '--prefix', 'docs/html5', 'origin', 'gh-pages'
dependsOn asciidoctor
}
bintray {
user = project.bintrayUser
key = project.bintrayKey
publish = true
dryRun = false
configurations = ['archives']
pkg {
userOrg = 'lookout'
repo = 'systems'
name = 'whoas'
labels = []
version {
name = project.version
vcsTag = "v${project.version}"
desc = project.description
}
}
}
bintrayUpload.dependsOn assemble
////////////////////////////////////////////////////////////////////////////////