77 lines
1.6 KiB
Groovy
77 lines
1.6 KiB
Groovy
apply plugin: 'java'
|
|
|
|
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"
|
|
}
|
|
|
|
task packageSources(type: Jar) {
|
|
classifier = 'sources'
|
|
from sourceSets.main.allSource
|
|
}
|
|
artifacts.archives packageSources
|
|
repositories {
|
|
mavenLocal()
|
|
|
|
maven { url "http://repo.maven.apache.org/maven2" }
|
|
}
|
|
|
|
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
|
|
}
|
|
}
|
|
|
|
apply from: "$rootDir/gradle/checkstyle.gradle"
|
|
apply from: "$rootDir/gradle/codenarc.gradle"
|