107 lines
2.3 KiB
Groovy
107 lines
2.3 KiB
Groovy
apply plugin: 'java'
|
|
apply plugin: 'groovy'
|
|
|
|
sourceCompatibility = 1.7
|
|
targetCompatibility = 1.7
|
|
|
|
apply plugin: "io.franzbecker.gradle-lombok"
|
|
|
|
lombok { // optional: values below are the defaults
|
|
version = "1.16.18"
|
|
sha256 = "9d957f572386b9e257093a45b148f9b411cff80d9efd55eaf6fca27002d2e4d9"
|
|
}
|
|
|
|
apply plugin: "eclipse"
|
|
eclipse {
|
|
classpath {
|
|
downloadSources = true
|
|
downloadJavadoc = true
|
|
}
|
|
}
|
|
if (configurations.find { it.name == 'jmh' }) {
|
|
eclipse.classpath.plusConfigurations += [ configurations.jmh ]
|
|
}
|
|
|
|
task packageSources(type: Jar) {
|
|
classifier = 'sources'
|
|
from sourceSets.main.allSource
|
|
}
|
|
artifacts.archives packageSources
|
|
|
|
repositories {
|
|
mavenLocal()
|
|
jcenter()
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
testCompile deps.junit
|
|
testCompile group: 'org.assertj', name: 'assertj-core', version: '3.6.2'
|
|
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.7.22'
|
|
|
|
testCompile deps.spock
|
|
testCompile deps.groovy
|
|
testCompile deps.testLogging
|
|
testCompile group: 'io.ratpack', name: 'ratpack-groovy-test', version: '1.4.6'
|
|
}
|
|
|
|
tasks.withType(Javadoc) {
|
|
options.encoding = "utf-8"
|
|
options.docEncoding = "utf-8"
|
|
options.charSet = "utf-8"
|
|
|
|
options.addStringOption('Xdoclint:none', '-quiet')
|
|
|
|
doFirst {
|
|
if (project.ext.has("apiLinks")) {
|
|
options.links(*project.apiLinks)
|
|
}
|
|
}
|
|
}
|
|
|
|
javadoc {
|
|
source = sourceSets.main.allJava
|
|
classpath = configurations.compileClasspath
|
|
|
|
options {
|
|
setMemberLevel JavadocMemberLevel.PUBLIC
|
|
setAuthor true
|
|
|
|
links "https://docs.oracle.com/javase/8/docs/api/"
|
|
}
|
|
}
|
|
|
|
task sourceJar(type: Jar) {
|
|
from sourceSets.main.allJava
|
|
classifier = 'sources'
|
|
}
|
|
|
|
task javaDocJar(type: Jar, dependsOn: javadoc) {
|
|
from javadoc.destinationDir
|
|
classifier = 'javadoc'
|
|
}
|
|
|
|
artifacts {
|
|
archives sourceJar
|
|
archives javaDocJar
|
|
}
|
|
|
|
if (project.plugins.hasPlugin('com.github.johnrengelman.shadow')) {
|
|
// Remove the no-deps jar from the archives to prevent publication
|
|
configurations.archives.with {
|
|
artifacts.remove artifacts.find { it.archiveTask.is jar }
|
|
}
|
|
artifacts {
|
|
archives shadowJar
|
|
}
|
|
}
|
|
|
|
if (project.hasProperty("removeJarVersionNumbers") && removeJarVersionNumbers) {
|
|
tasks.withType(AbstractArchiveTask) {
|
|
version = null
|
|
}
|
|
}
|
|
|
|
apply from: "$rootDir/gradle/checkstyle.gradle"
|
|
apply from: "$rootDir/gradle/codenarc.gradle"
|