From fb6fe8522c3e60326e1d55b3bfa89874dee0a7b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rg=20Prante?= Date: Tue, 10 Jul 2018 14:46:31 +0200 Subject: [PATCH] fix boradcasthost, update to gradle 4.8.1 --- build.gradle | 19 +- gradle.properties | 8 +- gradle/ext.gradle | 8 - gradle/publish.gradle | 9 +- gradle/{sonarqube.gradle => qa.gradle} | 24 +- net-url/config/checkstyle/checkstyle.xml | 323 ------------------ .../src/test/java/org/xbib/net/URLTest.java | 9 +- net-url/src/test/resources/urltestdata.json | 2 +- 8 files changed, 37 insertions(+), 365 deletions(-) delete mode 100644 gradle/ext.gradle rename gradle/{sonarqube.gradle => qa.gradle} (82%) delete mode 100644 net-url/config/checkstyle/checkstyle.xml diff --git a/build.gradle b/build.gradle index e752fec..6d6d928 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,11 @@ plugins { id "org.sonarqube" version "2.6.1" - id "org.xbib.gradle.plugin.asciidoctor" version "1.5.4.1.0" id "io.codearte.nexus-staging" version "0.11.0" + id "org.xbib.gradle.plugin.asciidoctor" version "1.5.6.0.1" } -printf "Host: %s\nOS: %s %s %s\nJVM: %s %s %s %s\nGroovy: %s\nGradle: %s\n" + +printf "Host: %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", InetAddress.getLocalHost(), System.getProperty("os.name"), @@ -15,18 +15,18 @@ 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.vendor"), System.getProperty("java.vm.name"), + gradle.gradleVersion, GroovySystem.getVersion(), - gradle.gradleVersion + JavaVersion.current() subprojects { apply plugin: 'java' apply plugin: 'maven' apply plugin: 'signing' + apply plugin: 'checkstyle' apply plugin: 'findbugs' apply plugin: 'pmd' - apply plugin: 'checkstyle' - apply plugin: "jacoco" apply plugin: 'org.xbib.gradle.plugin.asciidoctor' repositories { @@ -45,12 +45,6 @@ subprojects { wagon "org.apache.maven.wagon:wagon-ssh:${project.property('wagon.version')}" } - checkstyle { - configFile = rootProject.file('config/checkstyle/checkstyle.xml') - ignoreFailures = true - showViolations = true - } - sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 @@ -121,9 +115,8 @@ subprojects { } } - apply from: "${rootProject.projectDir}/gradle/ext.gradle" apply from: "${rootProject.projectDir}/gradle/publish.gradle" - apply from: "${rootProject.projectDir}/gradle/sonarqube.gradle" + apply from: "${rootProject.projectDir}/gradle/qa.gradle" } nexusStaging { diff --git a/gradle.properties b/gradle.properties index 140eabc..7e861e7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,8 @@ group = org.xbib name = net -version = 1.1.0 +version = 1.1.1 -junit.version = 4.12 -asciidoclet.version = 1.5.4 -wagon.version = 3.0.0 jackson.version = 2.8.11 +junit.version = 4.12 +wagon.version = 3.0.0 +asciidoclet.version = 1.5.4 diff --git a/gradle/ext.gradle b/gradle/ext.gradle deleted file mode 100644 index cc55927..0000000 --- a/gradle/ext.gradle +++ /dev/null @@ -1,8 +0,0 @@ -ext { - user = 'xbib' - projectName = 'net' - projectDescription = 'Network classes for Java' - scmUrl = 'https://github.com/xbib/net' - scmConnection = 'scm:git:git://github.com/xbib/net.git' - scmDeveloperConnection = 'scm:git:git://github.com/xbib/net.git' -} diff --git a/gradle/publish.gradle b/gradle/publish.gradle index 9e532b0..de4b86f 100644 --- a/gradle/publish.gradle +++ b/gradle/publish.gradle @@ -1,4 +1,11 @@ +ext { + projectDescription = 'Network classes for Java' + scmUrl = 'https://github.com/xbib/net' + scmConnection = 'scm:git:git://github.com/xbib/net.git' + scmDeveloperConnection = 'scm:git:git://github.com/xbib/net.git' +} + task xbibUpload(type: Upload) { group = 'publish' configuration = configurations.archives @@ -44,7 +51,7 @@ task sonatypeUpload(type: Upload, dependsOn: build) { } developers { developer { - id user + id 'xbib' name 'Jörg Prante' email 'joergprante@gmail.com' url 'https://github.com/xbib' diff --git a/gradle/sonarqube.gradle b/gradle/qa.gradle similarity index 82% rename from gradle/sonarqube.gradle rename to gradle/qa.gradle index 3985a4f..98fed8d 100644 --- a/gradle/sonarqube.gradle +++ b/gradle/qa.gradle @@ -1,3 +1,10 @@ +tasks.withType(Checkstyle) { + ignoreFailures = true + reports { + xml.enabled = true + html.enabled = true + } +} tasks.withType(FindBugs) { ignoreFailures = true reports { @@ -12,19 +19,11 @@ tasks.withType(Pmd) { html.enabled = true } } -tasks.withType(Checkstyle) { - ignoreFailures = true - reports { - xml.enabled = true - html.enabled = true - } -} -jacocoTestReport { - reports { - xml.enabled = true - csv.enabled = false - } +checkstyle { + configFile = rootProject.file('config/checkstyle/checkstyle.xml') + ignoreFailures = true + showViolations = true } sonarqube { @@ -33,7 +32,6 @@ sonarqube { property "sonar.sourceEncoding", "UTF-8" property "sonar.tests", "src/test/java" property "sonar.scm.provider", "git" - property "sonar.java.coveragePlugin", "jacoco" property "sonar.junit.reportsPath", "build/test-results/test/" } } diff --git a/net-url/config/checkstyle/checkstyle.xml b/net-url/config/checkstyle/checkstyle.xml deleted file mode 100644 index 3dc3e16..0000000 --- a/net-url/config/checkstyle/checkstyle.xml +++ /dev/null @@ -1,323 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/net-url/src/test/java/org/xbib/net/URLTest.java b/net-url/src/test/java/org/xbib/net/URLTest.java index 5b4ab2c..be4f7ba 100644 --- a/net-url/src/test/java/org/xbib/net/URLTest.java +++ b/net-url/src/test/java/org/xbib/net/URLTest.java @@ -44,10 +44,15 @@ public class URLTest { assertEquals(test.protocol, url.getScheme() + ":"); } if (test.hostname != null) { - assertEquals(test.hostname, url.getHost()); + // default in Mac OS + String host = url.getHost(); + if ("broadcasthost".equals(host)) { + host = "255.255.255.255"; + } + assertEquals(test.hostname, host); } if (test.port != null && !test.port.isEmpty() && url.getPort() != null) { - assertTrue(Integer.parseInt(test.port) == url.getPort()); + assertEquals(Integer.parseInt(test.port), (int) url.getPort()); } // TODO(jprante) //if (test.pathname != null && !test.pathname.isEmpty() && url.getPath() != null) { diff --git a/net-url/src/test/resources/urltestdata.json b/net-url/src/test/resources/urltestdata.json index c0a0742..8a5af47 100644 --- a/net-url/src/test/resources/urltestdata.json +++ b/net-url/src/test/resources/urltestdata.json @@ -4930,7 +4930,7 @@ "username": "", "password": "", "host": "255.255.255.255", - "hostname": "broadcasthost", + "hostname": "255.255.255.255", "port": "", "pathname": "/", "search": "",