preparing for Java 9

This commit is contained in:
Jörg Prante 2018-02-15 11:56:38 +01:00
parent 871287dc4e
commit 8499915b3a
4 changed files with 29 additions and 19 deletions

View file

@ -1,11 +1,15 @@
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
plugins { plugins {
id "org.sonarqube" version "2.6.1" id "org.sonarqube" version "2.6.1"
id "io.codearte.nexus-staging" version "0.11.0" id "io.codearte.nexus-staging" version "0.11.0"
id "org.xbib.gradle.plugin.asciidoctor" version "1.5.6.0.1" id "org.xbib.gradle.plugin.asciidoctor" version "1.6.0.0"
} }
printf "Host: %s\nOS: %s %s %s\nJVM: %s %s %s %s\nGroovy: %s\nGradle: %s\n" + printf "Date: %s\nHost: %s\nOS: %s %s %s\nJVM: %s %s %s %s\nGradle: %s Groovy: %s Java: %s\n" +
"Build: group: ${project.group} name: ${project.name} version: ${project.version}\n", "Build: group: ${project.group} name: ${project.name} version: ${project.version}\n",
ZonedDateTime.now().format(DateTimeFormatter.ISO_DATE_TIME),
InetAddress.getLocalHost(), InetAddress.getLocalHost(),
System.getProperty("os.name"), System.getProperty("os.name"),
System.getProperty("os.arch"), System.getProperty("os.arch"),
@ -14,16 +18,11 @@ printf "Host: %s\nOS: %s %s %s\nJVM: %s %s %s %s\nGroovy: %s\nGradle: %s\n" +
System.getProperty("java.vm.version"), System.getProperty("java.vm.version"),
System.getProperty("java.vm.vendor"), System.getProperty("java.vm.vendor"),
System.getProperty("java.vm.name"), System.getProperty("java.vm.name"),
GroovySystem.getVersion(), gradle.gradleVersion, GroovySystem.getVersion(), JavaVersion.current()
gradle.gradleVersion
apply plugin: 'java' apply plugin: 'java'
apply plugin: 'maven' apply plugin: 'maven'
apply plugin: 'signing' apply plugin: 'signing'
apply plugin: 'findbugs'
apply plugin: 'pmd'
apply plugin: 'checkstyle'
apply plugin: "jacoco"
apply plugin: "io.codearte.nexus-staging" apply plugin: "io.codearte.nexus-staging"
apply plugin: 'org.xbib.gradle.plugin.asciidoctor' apply plugin: 'org.xbib.gradle.plugin.asciidoctor'
@ -43,16 +42,19 @@ dependencies {
testCompile "xalan:xalan:${project.property('xalan.version')}" testCompile "xalan:xalan:${project.property('xalan.version')}"
testCompile "org.xmlunit:xmlunit-matchers:${project.property('xmlunit-matchers.version')}" testCompile "org.xmlunit:xmlunit-matchers:${project.property('xmlunit-matchers.version')}"
testCompile "com.github.stefanbirkner:system-rules:${project.property('system-rules.version')}" testCompile "com.github.stefanbirkner:system-rules:${project.property('system-rules.version')}"
asciidoclet "org.asciidoctor:asciidoclet:${project.property('asciidoclet.version')}" asciidoclet "org.xbib:asciidoclet:${project.property('asciidoclet.version')}"
wagon "org.apache.maven.wagon:wagon-ssh:${project.property('wagon.version')}" wagon "org.apache.maven.wagon:wagon-ssh:${project.property('wagon.version')}"
} }
sourceCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_1_9
targetCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8' [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
tasks.withType(JavaCompile) { tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:all" << "-profile" << "compact2" options.compilerArgs << "-Xlint:all" // << "-profile" << "compact2"
if (JavaVersion.current().java9Compatible) {
options.compilerArgs << '--release' << JavaVersion.toVersion(targetCompatibility).majorVersion
}
} }
test { test {
@ -78,7 +80,7 @@ asciidoctor {
javadoc { javadoc {
options.docletpath = configurations.asciidoclet.files.asType(List) options.docletpath = configurations.asciidoclet.files.asType(List)
options.doclet = 'org.asciidoctor.Asciidoclet' options.doclet = 'org.xbib.asciidoclet.Asciidoclet'
options.overview = "src/docs/asciidoclet/overview.adoc" options.overview = "src/docs/asciidoclet/overview.adoc"
options.addStringOption "-base-dir", "${projectDir}" options.addStringOption "-base-dir", "${projectDir}"
options.addStringOption "-attribute", options.addStringOption "-attribute",
@ -113,4 +115,4 @@ if (project.hasProperty('signing.keyId')) {
apply from: 'gradle/ext.gradle' apply from: 'gradle/ext.gradle'
apply from: 'gradle/publish.gradle' apply from: 'gradle/publish.gradle'
apply from: 'gradle/sonarqube.gradle' apply from: 'gradle/sourcequality.gradle'

View file

@ -1,12 +1,12 @@
group = org.xbib group = org.xbib
name = marc name = marc
version = 1.1.0 version = 1.2.0
xbib-content.version = 1.3.0 xbib-content.version = 1.3.0
xbib-bibliographic-character-sets.version = 1.0.0 xbib-bibliographic-character-sets.version = 1.0.0
xalan.version = 2.7.2 xalan.version = 2.7.2
xmlunit-matchers.version = 2.3.0 xmlunit-matchers.version = 2.3.0
system-rules.version = 1.16.0 system-rules.version = 1.16.0
asciidoclet.version = 1.5.4 asciidoclet.version = 1.6.0.0
junit.version = 4.12 junit.version = 4.12
wagon.version = 3.0.0 wagon.version = 3.0.0

View file

@ -1,12 +1,13 @@
task xbibUpload(type: Upload) { task xbibUpload(type: Upload) {
group = 'publish'
configuration = configurations.archives configuration = configurations.archives
uploadDescriptor = true uploadDescriptor = true
repositories { repositories {
if (project.hasProperty('xbibUsername')) { if (project.hasProperty('xbibUsername')) {
mavenDeployer { mavenDeployer {
configuration = configurations.wagon configuration = configurations.wagon
repository(url: uri('sftp://xbib.org/repository')) { repository(url: uri(project.property('xbibUrl'))) {
authentication(userName: xbibUsername, privateKey: xbibPrivateKey) authentication(userName: xbibUsername, privateKey: xbibPrivateKey)
} }
} }
@ -15,6 +16,7 @@ task xbibUpload(type: Upload) {
} }
task sonatypeUpload(type: Upload) { task sonatypeUpload(type: Upload) {
group = 'publish'
configuration = configurations.archives configuration = configurations.archives
uploadDescriptor = true uploadDescriptor = true
repositories { repositories {

View file

@ -1,10 +1,16 @@
tasks.withType(FindBugs) { /*spotbugs {
ignoreFailures = true ignoreFailures = false
sourceSets = [sourceSets.main]
effort = "max"
reportLevel = "high"
}
tasks.withType(com.github.spotbugs.SpotBugsTask) {
reports { reports {
xml.enabled = false xml.enabled = false
html.enabled = true html.enabled = true
} }
} }
tasks.withType(Pmd) { tasks.withType(Pmd) {
ignoreFailures = true ignoreFailures = true
reports { reports {
@ -26,7 +32,7 @@ jacocoTestReport {
csv.enabled = false csv.enabled = false
} }
} }
*/
sonarqube { sonarqube {
properties { properties {
property "sonar.projectName", "${project.group} ${project.name}" property "sonar.projectName", "${project.group} ${project.name}"