mirror of https://github.com/reiseburo/whoas
152 lines
4.4 KiB
Groovy
152 lines
4.4 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: 'java'
|
|
apply plugin: 'eclipse'
|
|
|
|
group = 'com.github.lookout'
|
|
version = '0.3.0'
|
|
description = 'A server-side webhook publishing library'
|
|
|
|
sourceCompatibility = '1.7'
|
|
targetCompatibility = '1.7'
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
// DEPENDENCY CONFIGURATION
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
repositories {
|
|
jcenter()
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
// DEPENDENCY MANAGEMENT
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
dependencies {
|
|
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+'
|
|
/* Needed for redis client */
|
|
compile 'redis.clients:jedis:2.6+'
|
|
/* Needed for logback */
|
|
compile 'org.slf4j:slf4j-api:1.7.10'
|
|
compile 'ch.qos.logback:logback-classic:1.1.2'
|
|
|
|
testCompile 'org.codehaus.groovy:groovy-all:2.4.0+'
|
|
testCompile 'org.spockframework:spock-core:0.7-groovy-2.0'
|
|
testCompile 'cglib:cglib-nodep:2.2.+'
|
|
/* Redis-support testing code */
|
|
testCompile 'com.fiftyonred:mock-jedis:0.4.0'
|
|
|
|
[
|
|
'dropwizard-core',
|
|
'dropwizard-configuration',
|
|
].each {
|
|
compile "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"
|
|
}
|
|
}
|
|
assemble.dependsOn check
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
// DOCUMENTATION TASKS
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
asciidoctor {
|
|
sourceDir 'src/asciidoc'
|
|
outputDir 'docs'
|
|
attributes 'toc': 'right',
|
|
'source-highlighter': 'coderay',
|
|
'toc-title': 'Table of Contents'
|
|
shouldRunAfter test
|
|
}
|
|
check.dependsOn asciidoctor
|
|
|
|
javadoc {
|
|
destinationDir file('docs/html5/javadoc')
|
|
shouldRunAfter test
|
|
}
|
|
|
|
check.dependsOn javadoc
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
// PUBLISHING TASKS
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
/* Add the sources jar to the list of artifacts to publish */
|
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
|
classifier = 'sources'
|
|
from sourceSets.main.allSource
|
|
}
|
|
|
|
task javadocJar(type: Jar) {
|
|
dependsOn javadoc
|
|
classifier = 'javadoc'
|
|
from javadoc.destinationDir
|
|
}
|
|
|
|
artifacts {
|
|
archives sourcesJar
|
|
archives javadocJar
|
|
}
|
|
|
|
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
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|