From 19682d6155a2f2f057733bed6bfb1bbd4f944a52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rg=20Prante?= Date: Sat, 29 Oct 2016 20:00:22 +0200 Subject: [PATCH] fixing artifact creation --- build.gradle | 60 +++++++++----------------------------- content-core/build.gradle | 2 +- content-json/build.gradle | 2 +- content-smile/build.gradle | 2 +- content-xml/build.gradle | 2 +- content-yaml/build.gradle | 2 +- gradle.properties | 3 -- gradle/ext.gradle | 10 +++---- gradle/publish.gradle | 15 +++------- gradle/sonarqube.gradle | 41 ++++++++++++++++++++++++++ 10 files changed, 68 insertions(+), 71 deletions(-) delete mode 100644 gradle.properties create mode 100644 gradle/sonarqube.gradle diff --git a/build.gradle b/build.gradle index cd93c44..aba0c6a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,15 +1,22 @@ plugins { - id "org.sonarqube" version "2.1-rc1" + id "org.sonarqube" version "2.2" id "org.ajoberstar.github-pages" version "1.6.0-rc.1" id "org.xbib.gradle.plugin.jbake" version "1.1.0" } -println "Host: " + java.net.InetAddress.getLocalHost() -println "Gradle: " + gradle.gradleVersion + " JVM: " + org.gradle.internal.jvm.Jvm.current() + " Groovy: " + GroovySystem.getVersion() -println "Build: group: '${project.group}', name: '${project.name}', version: '${project.version}'" + + +ext { + versions = [ + 'jackson' : '2.8.3' + ] +} allprojects { + group = 'org.xbib' + version = '1.0.1' + apply plugin: 'java' apply plugin: 'maven' apply plugin: 'signing' @@ -25,8 +32,6 @@ allprojects { configurations { wagon - provided - testCompile.extendsFrom(provided) } dependencies { @@ -41,53 +46,13 @@ allprojects { tasks.withType(JavaCompile) { options.compilerArgs << "-Xlint:all" << "-profile" << "compact2" } + test { - classpath += configurations.provided testLogging { showStandardStreams = false exceptionFormat = 'full' } } - tasks.withType(FindBugs) { - ignoreFailures = true - reports { - xml.enabled = true - html.enabled = false - } - } - tasks.withType(Pmd) { - ignoreFailures = true - reports { - xml.enabled = true - html.enabled = true - } - } - tasks.withType(Checkstyle) { - ignoreFailures = true - reports { - xml.enabled = true - html.enabled = true - } - } - jacocoTestReport { - reports { - xml.enabled true - csv.enabled false - xml.destination "${buildDir}/reports/jacoco-xml" - html.destination "${buildDir}/reports/jacoco-html" - } - } - - sonarqube { - properties { - property "sonar.projectName", "xbib content" - 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/" - } - } task sourcesJar(type: Jar, dependsOn: classes) { classifier 'sources' @@ -107,5 +72,6 @@ allprojects { apply from: "${rootProject.projectDir}/gradle/ext.gradle" apply from: "${rootProject.projectDir}/gradle/publish.gradle" + apply from: "${rootProject.projectDir}/gradle/sonarqube.gradle" } diff --git a/content-core/build.gradle b/content-core/build.gradle index 0a8fb93..e45e07a 100644 --- a/content-core/build.gradle +++ b/content-core/build.gradle @@ -1,3 +1,3 @@ dependencies { - compile "com.fasterxml.jackson.core:jackson-core:2.8.3" + compile "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" } diff --git a/content-json/build.gradle b/content-json/build.gradle index d1a1b69..3006b13 100644 --- a/content-json/build.gradle +++ b/content-json/build.gradle @@ -1,5 +1,5 @@ dependencies { - compile "com.fasterxml.jackson.core:jackson-databind:2.8.3" + compile "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}" testCompile('junit:junit:4.12') { exclude group: 'org.hamcrest' } diff --git a/content-smile/build.gradle b/content-smile/build.gradle index b1df4d2..4dadf7a 100644 --- a/content-smile/build.gradle +++ b/content-smile/build.gradle @@ -1,4 +1,4 @@ dependencies { compile project(':content-core') - compile "com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.8.3" + compile "com.fasterxml.jackson.dataformat:jackson-dataformat-smile:${versions.jackson}" } \ No newline at end of file diff --git a/content-xml/build.gradle b/content-xml/build.gradle index 690099b..ded0a1a 100644 --- a/content-xml/build.gradle +++ b/content-xml/build.gradle @@ -1,5 +1,5 @@ dependencies { compile project(':content-core') compile project(':content-resource') - compile "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.8.3" + compile "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${versions.jackson}" } diff --git a/content-yaml/build.gradle b/content-yaml/build.gradle index a085a9f..34d412f 100644 --- a/content-yaml/build.gradle +++ b/content-yaml/build.gradle @@ -1,4 +1,4 @@ dependencies { compile project(':content-core') - compile "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.8.3" + compile "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${versions.jackson}" } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties deleted file mode 100644 index e26553b..0000000 --- a/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -group = org.xbib -version = 1.0.1 -org.gradle.daemon = true diff --git a/gradle/ext.gradle b/gradle/ext.gradle index ca2a643..6d3ed1f 100644 --- a/gradle/ext.gradle +++ b/gradle/ext.gradle @@ -1,8 +1,8 @@ ext { user = 'xbib' - projectName = 'marc' - projectDescription = 'MARC bibliographic data processing library for Java' - scmUrl = 'https://github.com/xbib/marc' - scmConnection = 'scm:git:git://github.com/xbib/marc.git' - scmDeveloperConnection = 'scm:git:git://github.com/xbib/marc.git' + projectName = 'content' + projectDescription = 'Content processing library for Java' + scmUrl = 'https://github.com/xbib/content' + scmConnection = 'scm:git:git://github.com/xbib/content.git' + scmDeveloperConnection = 'scm:git:git://github.com/xbib/content.git' } diff --git a/gradle/publish.gradle b/gradle/publish.gradle index 663c405..9d43d7b 100644 --- a/gradle/publish.gradle +++ b/gradle/publish.gradle @@ -28,7 +28,10 @@ task sonatypeUpload(type: Upload) { authentication(userName: ossrhUsername, password: ossrhPassword) } pom.project { - name projectName + groupId project.group + artifactId project.name + version project.version + name project.name description projectDescription packaging 'jar' inceptionYear '2016' @@ -61,13 +64,3 @@ task sonatypeUpload(type: Upload) { } } } - -githubPages { - repoUri = 'git@github.com:xbib/marc.git' - targetBranch = "gh-pages" - pages { - from(file('build/jbake')) { - into '.' - } - } -} diff --git a/gradle/sonarqube.gradle b/gradle/sonarqube.gradle new file mode 100644 index 0000000..6d4c3fa --- /dev/null +++ b/gradle/sonarqube.gradle @@ -0,0 +1,41 @@ +tasks.withType(FindBugs) { + ignoreFailures = true + reports { + xml.enabled = true + html.enabled = false + } +} +tasks.withType(Pmd) { + ignoreFailures = true + reports { + xml.enabled = true + html.enabled = true + } +} +tasks.withType(Checkstyle) { + ignoreFailures = true + reports { + xml.enabled = true + html.enabled = true + } +} + +jacocoTestReport { + reports { + xml.enabled true + csv.enabled false + xml.destination "${buildDir}/reports/jacoco-xml" + html.destination "${buildDir}/reports/jacoco-html" + } +} + +sonarqube { + properties { + property "sonar.projectName", "${project.group} ${project.name}" + 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/" + } +}