2017-05-02 00:52:09 +02:00
|
|
|
plugins {
|
2019-11-07 15:55:00 +01:00
|
|
|
id "com.github.spotbugs" version "2.0.1"
|
|
|
|
id "io.codearte.nexus-staging" version "0.21.1"
|
2018-07-12 14:47:09 +02:00
|
|
|
id "org.xbib.gradle.plugin.asciidoctor" version "1.5.6.0.1"
|
2017-05-02 00:52:09 +02:00
|
|
|
}
|
|
|
|
|
2018-08-17 11:46:18 +02:00
|
|
|
apply plugin: 'org.xbib.gradle.plugin.asciidoctor'
|
2017-05-02 00:52:09 +02:00
|
|
|
apply plugin: "io.codearte.nexus-staging"
|
|
|
|
|
2018-03-12 11:22:40 +01:00
|
|
|
subprojects {
|
|
|
|
apply plugin: 'java'
|
|
|
|
apply plugin: "com.github.spotbugs"
|
2017-05-02 00:52:09 +02:00
|
|
|
|
2018-03-12 11:22:40 +01:00
|
|
|
dependencies {
|
2019-07-17 22:53:14 +02:00
|
|
|
testCompile "org.junit.jupiter:junit-jupiter-api:${project.property('junit.version')}"
|
|
|
|
testCompile "org.junit.jupiter:junit-jupiter-params:${project.property('junit.version')}"
|
|
|
|
testCompile "org.junit.jupiter:junit-jupiter-engine:${project.property('junit.version')}"
|
|
|
|
testCompile "org.junit.vintage:junit-vintage-engine:${project.property('junit.version')}"
|
|
|
|
testCompile "junit:junit:${project.property('junit4.version')}"
|
2018-03-12 11:22:40 +01:00
|
|
|
}
|
2017-05-02 00:52:09 +02:00
|
|
|
|
2018-08-17 11:46:18 +02:00
|
|
|
compileJava {
|
2019-08-08 15:48:09 +02:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_11
|
|
|
|
targetCompatibility = JavaVersion.VERSION_11
|
2018-08-17 11:46:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
compileTestJava {
|
2019-08-08 15:48:09 +02:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_11
|
|
|
|
targetCompatibility = JavaVersion.VERSION_11
|
2018-08-17 11:46:18 +02:00
|
|
|
}
|
2017-05-02 00:52:09 +02:00
|
|
|
|
2018-03-12 11:22:40 +01:00
|
|
|
tasks.withType(JavaCompile) {
|
2019-04-30 16:35:45 +02:00
|
|
|
options.compilerArgs << "-Xlint:all,-fallthrough"
|
|
|
|
if (!options.compilerArgs.contains("-processor")) {
|
|
|
|
options.compilerArgs << '-proc:none'
|
|
|
|
}
|
2018-03-12 11:22:40 +01:00
|
|
|
}
|
2017-05-02 00:52:09 +02:00
|
|
|
|
2018-03-12 11:22:40 +01:00
|
|
|
jar {
|
|
|
|
manifest {
|
2019-12-22 02:03:19 +01:00
|
|
|
attributes('Implementation-Title': project.name)
|
2018-03-12 11:22:40 +01:00
|
|
|
attributes('Implementation-Version': project.version)
|
2019-12-22 02:03:19 +01:00
|
|
|
attributes('Implementation-Vendor': 'Jörg Prante')
|
2018-03-12 11:22:40 +01:00
|
|
|
}
|
2017-05-02 00:52:09 +02:00
|
|
|
}
|
|
|
|
|
2018-03-12 11:22:40 +01:00
|
|
|
test {
|
2019-04-30 16:35:45 +02:00
|
|
|
useJUnitPlatform()
|
|
|
|
failFast = false
|
2018-03-12 11:22:40 +01:00
|
|
|
testLogging {
|
2019-08-06 21:00:02 +02:00
|
|
|
events 'STARTED', 'PASSED', 'FAILED', 'SKIPPED'
|
2019-08-25 23:26:13 +02:00
|
|
|
showStandardStreams = false
|
2019-04-30 16:35:45 +02:00
|
|
|
}
|
|
|
|
afterSuite { desc, result ->
|
|
|
|
if (!desc.parent) {
|
|
|
|
println "\nTest result: ${result.resultType}"
|
|
|
|
println "Test summary: ${result.testCount} tests, " +
|
|
|
|
"${result.successfulTestCount} succeeded, " +
|
|
|
|
"${result.failedTestCount} failed, " +
|
|
|
|
"${result.skippedTestCount} skipped"
|
|
|
|
}
|
2018-03-12 11:22:40 +01:00
|
|
|
}
|
2018-02-28 12:23:52 +01:00
|
|
|
}
|
2018-03-12 11:22:40 +01:00
|
|
|
|
|
|
|
clean {
|
|
|
|
delete 'out'
|
2017-05-02 00:52:09 +02:00
|
|
|
}
|
|
|
|
|
2018-03-12 11:22:40 +01:00
|
|
|
asciidoctor {
|
|
|
|
attributes toc: 'left',
|
|
|
|
doctype: 'book',
|
|
|
|
icons: 'font',
|
|
|
|
encoding: 'utf-8',
|
|
|
|
sectlink: true,
|
|
|
|
sectanchors: true,
|
|
|
|
linkattrs: true,
|
|
|
|
imagesdir: 'img',
|
|
|
|
'source-highlighter': 'coderay'
|
|
|
|
}
|
2018-03-04 23:14:26 +01:00
|
|
|
|
2019-08-25 23:26:13 +02:00
|
|
|
spotbugs {
|
|
|
|
toolVersion = '3.1.12'
|
|
|
|
sourceSets = [sourceSets.main]
|
|
|
|
ignoreFailures = true
|
|
|
|
effort = "max"
|
|
|
|
reportLevel = "high"
|
|
|
|
// includeFilter = file("config/findbugs/findbugs-include.xml")
|
|
|
|
// excludeFilter = file("config/findbugs/findbugs-excludes.xml")
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType(com.github.spotbugs.SpotBugsTask) {
|
|
|
|
reports.xml.enabled = false
|
|
|
|
reports.html.enabled = true
|
|
|
|
}
|
|
|
|
|
2018-05-04 11:32:53 +02:00
|
|
|
/*javadoc {
|
2018-03-12 11:22:40 +01:00
|
|
|
options.docletpath = configurations.asciidoclet.files.asType(List)
|
|
|
|
options.doclet = "org.xbib.asciidoclet.Asciidoclet"
|
|
|
|
options.overview = "src/docs/asciidoclet/overview.adoc"
|
|
|
|
options.addStringOption "-base-dir", "${projectDir}"
|
|
|
|
options.addStringOption "-attribute",
|
|
|
|
"name=${project.name},version=${project.version},title-link=https://github.com/jprante/${project.name}"
|
|
|
|
configure(options) {
|
|
|
|
noTimestamp = true
|
|
|
|
}
|
2018-05-04 11:32:53 +02:00
|
|
|
}*/
|
2017-05-02 00:52:09 +02:00
|
|
|
|
2018-03-12 11:22:40 +01:00
|
|
|
task javadocJar(type: Jar, dependsOn: classes) {
|
|
|
|
from javadoc
|
|
|
|
into "build/tmp"
|
2019-04-30 16:35:45 +02:00
|
|
|
archiveClassifier.set('javadoc')
|
2017-05-02 00:52:09 +02:00
|
|
|
}
|
|
|
|
|
2018-03-12 11:22:40 +01:00
|
|
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
|
|
|
from sourceSets.main.allSource
|
|
|
|
into "build/tmp"
|
2019-04-30 16:35:45 +02:00
|
|
|
archiveClassifier.set('sources')
|
2018-03-12 11:22:40 +01:00
|
|
|
}
|
2017-05-02 00:52:09 +02:00
|
|
|
|
2018-03-12 11:22:40 +01:00
|
|
|
artifacts {
|
|
|
|
archives javadocJar, sourcesJar
|
|
|
|
}
|
|
|
|
|
|
|
|
ext {
|
|
|
|
user = 'jprante'
|
2019-02-11 09:20:21 +01:00
|
|
|
name = 'netty-http'
|
2019-08-25 23:26:13 +02:00
|
|
|
projectDescription = 'HTTP client and server for Netty'
|
|
|
|
scmUrl = 'https://github.com/jprante/netty-http'
|
|
|
|
scmConnection = 'scm:git:git://github.com/jprante/netty-http.git'
|
|
|
|
scmDeveloperConnection = 'scm:git:git://github.com/jprante/netty-http.git'
|
|
|
|
inceptionDate = '2012'
|
|
|
|
organizationName = 'xbib'
|
|
|
|
organizationUrl = 'http://xbib.org'
|
|
|
|
licenseName = 'The Apache License, Version 2.0'
|
|
|
|
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
|
|
|
|
}
|
|
|
|
|
|
|
|
/*publishing {
|
|
|
|
publications {
|
|
|
|
mavenJava(MavenPublication) {
|
|
|
|
from components.java
|
|
|
|
groupId project.group
|
|
|
|
artifactId project.name
|
|
|
|
version project.version
|
|
|
|
artifact sourcesJar
|
|
|
|
artifact javadocJar
|
|
|
|
pom {
|
|
|
|
name = project.name
|
|
|
|
description = projectDescription
|
|
|
|
inceptionYear = inceptionDate
|
|
|
|
url = scmUrl
|
|
|
|
organization {
|
|
|
|
name = organizationName
|
|
|
|
url = organizationUrl
|
|
|
|
}
|
|
|
|
scm {
|
|
|
|
url = scmUrl
|
|
|
|
connection = scmConnection
|
|
|
|
developerConnection = scmDeveloperConnection
|
|
|
|
}
|
|
|
|
licenses {
|
|
|
|
license {
|
|
|
|
name = licenseName
|
|
|
|
url = licenseUrl
|
|
|
|
}
|
|
|
|
}
|
|
|
|
developers {
|
|
|
|
developer {
|
|
|
|
id = user
|
|
|
|
name = 'Jörg Prante'
|
|
|
|
email = 'joergprante@gmail.com'
|
|
|
|
url = 'https://github.com/jprante'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
repositories {
|
|
|
|
maven {
|
|
|
|
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
|
|
|
|
credentials {
|
|
|
|
username ossrhUsername
|
|
|
|
password ossrhPassword
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-05-02 00:52:09 +02:00
|
|
|
}
|
2019-08-25 23:26:13 +02:00
|
|
|
|
|
|
|
signing {
|
|
|
|
sign publishing.publications.mavenJava
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
2018-03-12 11:22:40 +01:00
|
|
|
task sonaTypeUpload(type: Upload) {
|
|
|
|
group = 'publish'
|
|
|
|
configuration = configurations.archives
|
|
|
|
uploadDescriptor = true
|
|
|
|
repositories {
|
|
|
|
if (project.hasProperty('ossrhUsername')) {
|
|
|
|
mavenDeployer {
|
|
|
|
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
|
|
|
|
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2') {
|
|
|
|
authentication(userName: ossrhUsername, password: ossrhPassword)
|
|
|
|
}
|
|
|
|
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots') {
|
|
|
|
authentication(userName: ossrhUsername, password: ossrhPassword)
|
|
|
|
}
|
|
|
|
pom.project {
|
|
|
|
groupId project.group
|
|
|
|
artifactId project.name
|
|
|
|
version project.version
|
|
|
|
name project.name
|
|
|
|
description description
|
|
|
|
packaging 'jar'
|
2019-08-25 23:26:13 +02:00
|
|
|
inceptionYear inceptionDate
|
2018-03-12 11:22:40 +01:00
|
|
|
url scmUrl
|
|
|
|
organization {
|
2019-08-25 23:26:13 +02:00
|
|
|
name organizationName
|
|
|
|
url organizationUrl
|
2018-03-12 11:22:40 +01:00
|
|
|
}
|
|
|
|
developers {
|
|
|
|
developer {
|
|
|
|
id user
|
|
|
|
name 'Jörg Prante'
|
|
|
|
email 'joergprante@gmail.com'
|
|
|
|
url 'https://github.com/jprante'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
scm {
|
|
|
|
url scmUrl
|
|
|
|
connection scmConnection
|
|
|
|
developerConnection scmDeveloperConnection
|
|
|
|
}
|
|
|
|
licenses {
|
|
|
|
license {
|
2019-08-25 23:26:13 +02:00
|
|
|
name licenseName
|
|
|
|
url licenseUrl
|
2018-03-12 11:22:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-08-25 23:26:13 +02:00
|
|
|
nexusStaging {
|
|
|
|
packageGroup = "org.xbib"
|
2018-03-08 15:57:17 +01:00
|
|
|
}
|
|
|
|
}
|