Setup Code Analysis
This commit is contained in:
+64
-34
@@ -1,6 +1,9 @@
|
||||
plugins {
|
||||
id 'application'
|
||||
id 'jacoco'
|
||||
id 'checkstyle'
|
||||
id 'pmd'
|
||||
id "com.github.spotbugs" version "4.8.0"
|
||||
id "org.sonarqube" version "3.3"
|
||||
id 'org.asciidoctor.jvm.pdf' version '3.3.0'
|
||||
id 'org.asciidoctor.jvm.gems' version '3.3.0'
|
||||
@@ -27,15 +30,47 @@ dependencies {
|
||||
implementation 'ch.qos.logback:logback-classic:1.1.2'
|
||||
}
|
||||
|
||||
final BUILD_DATE = new Date().format('dd.MM.yyyy').toString()
|
||||
def pdfFileEntwicklung = layout.buildDirectory.file("docs/asciidocPdf/Entwicklungshandbuch.pdf")
|
||||
def pdfArtifactEntwicklung = artifacts.add('archives', pdfFileEntwicklung.get().asFile) {
|
||||
type 'pdf'
|
||||
builtBy asciidoctorPdf
|
||||
}
|
||||
def pdfFileProjekt = layout.buildDirectory.file("docs/asciidocPdf/Projekthandbuch.pdf")
|
||||
def pdfArtifactProjekt = artifacts.add('archives', pdfFileProjekt.get().asFile) {
|
||||
type 'pdf'
|
||||
builtBy asciidoctorPdf
|
||||
}
|
||||
def pdfFilePflichtenheft = layout.buildDirectory.file("docs/asciidocPdf/Pflichtenheft.pdf")
|
||||
def pdfArtifactPflichtenheft = artifacts.add('archives', pdfFilePflichtenheft.get().asFile) {
|
||||
type 'pdf'
|
||||
builtBy asciidoctorPdf
|
||||
}
|
||||
|
||||
final MAIN_CLASS_NAME = 'com.thpeetz.versabundus.VersabundusApp'
|
||||
sourceCompatibility = 1.8
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
library(MavenPublication) {
|
||||
mavenEntwicklung(MavenPublication) {
|
||||
artifactId = "Entwicklungshandbuch"
|
||||
artifact pdfArtifactEntwicklung
|
||||
}
|
||||
mavenProjekt(MavenPublication) {
|
||||
artifactId = "Projekthandbuch"
|
||||
artifact pdfArtifactProjekt
|
||||
}
|
||||
mavenPflichtenheft(MavenPublication) {
|
||||
artifactId = "Pflichtenheft"
|
||||
artifact pdfArtifactPflichtenheft
|
||||
}
|
||||
application(MavenPublication) {
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
maven {
|
||||
url "https://gitlab.thpeetz.de/api/v4/projects/27/packages/maven"
|
||||
url "https://gitlab.thpeetz.de/api/v4/projects/${projectId}/packages/maven"
|
||||
credentials(HttpHeaderCredentials) {
|
||||
name = "Private-Token"
|
||||
value = gitLabPrivateToken
|
||||
@@ -47,11 +82,6 @@ publishing {
|
||||
}
|
||||
}
|
||||
|
||||
final BUILD_DATE = new Date().format('dd.MM.yyyy').toString()
|
||||
final MAIN_CLASS_NAME = 'com.thpeetz.versabundus.VersabundusApp'
|
||||
group = 'de.thpeetz.versabundus'
|
||||
sourceCompatibility = 1.8
|
||||
|
||||
application {
|
||||
mainClassName = MAIN_CLASS_NAME
|
||||
}
|
||||
@@ -63,7 +93,7 @@ jar {
|
||||
}
|
||||
|
||||
tasks.named('test') {
|
||||
useJUnitPlatform()
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
jacocoTestReport {
|
||||
@@ -72,13 +102,34 @@ jacocoTestReport {
|
||||
}
|
||||
}
|
||||
|
||||
spotbugs {
|
||||
ignoreFailures = false
|
||||
showStackTraces = true
|
||||
showProgress = true
|
||||
effort = 'default'
|
||||
reportLevel = 'default'
|
||||
}
|
||||
|
||||
tasks.withType(Checkstyle) {
|
||||
ignoreFailures = true
|
||||
showViolations = false
|
||||
reports {
|
||||
xml.enabled true
|
||||
}
|
||||
}
|
||||
|
||||
pmd {
|
||||
ignoreFailures = true
|
||||
}
|
||||
|
||||
|
||||
test.finalizedBy jacocoTestReport
|
||||
|
||||
sonarqube {
|
||||
properties {
|
||||
// property "sonar.projectKey", "kontor_kontor-java_AX-dd-w3rXuu6JVRvr_g"
|
||||
property "sonar.projectKey", "tpeetz_versabundus_AYB03YW5uGIZKMqU5_es"
|
||||
property "sonar.host.url", "https://sonar.thpeetz.de"
|
||||
// property "sonar.login", "d39622f640a91f501b1e8a73d7d78c4fc412fc98"
|
||||
property "sonar.login", "2703febc0e07fc850e5494125c8774a1fe65a90a"
|
||||
property "sonar.qualitygate.wait", true
|
||||
property "sonar.sourceEncoding", "UTF-8"
|
||||
}
|
||||
@@ -88,26 +139,6 @@ tasks.named('sonarqube').configure {
|
||||
dependsOn test
|
||||
}
|
||||
|
||||
//tasks.withType(Checkstyle) {
|
||||
// ignoreFailures = true
|
||||
// showViolations = false
|
||||
// configFile = rootProject.file("config/checkstyle/checkstyle.xml")
|
||||
// reports {
|
||||
// xml.enabled true
|
||||
// }
|
||||
//}
|
||||
|
||||
//tasks.withType(FindBugs) {
|
||||
// ignoreFailures = true
|
||||
// reports {
|
||||
// xml.enabled true
|
||||
// }
|
||||
//}
|
||||
|
||||
//pmd {
|
||||
// ignoreFailures = true
|
||||
//}
|
||||
|
||||
asciidoctorPdf {
|
||||
dependsOn asciidoctorGemsPrepare
|
||||
|
||||
@@ -122,18 +153,17 @@ asciidoctorPdf {
|
||||
'toc': 'left',
|
||||
'toc-title': 'Inhaltsverzeichnis',
|
||||
'revdate': BUILD_DATE,
|
||||
'revnumber': '1.0.0',
|
||||
'revnumber': { project.version.toString() },
|
||||
'revremark': 'Entwurf',
|
||||
'chapter-label': '',
|
||||
'icons': 'font',
|
||||
'idprefix': 'id_',
|
||||
'idseparator': '-',
|
||||
'docinfo1': ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task asciidoctor(dependsOn: asciidoctorPdf)
|
||||
build.dependsOn(['asciidoctor'])
|
||||
build.dependsOn(['asciidoctorPdf'])
|
||||
|
||||
wrapper {
|
||||
gradleVersion = "6.3"
|
||||
|
||||
Reference in New Issue
Block a user