Wende Build Template an - OP#238

This commit is contained in:
2022-08-21 01:44:15 +00:00
parent 86cd6f96b8
commit 0732a8c1bb
15 changed files with 429 additions and 548 deletions
+20 -134
View File
@@ -1,174 +1,60 @@
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'
id 'maven-publish'
}
repositories {
jcenter()
ruby.gems()
mavenLocal()
mavenCentral()
maven {
url "https://gitlab.thpeetz.de/api/v4/packages/maven"
name "GitLab"
}
id 'jacoco-report-aggregation'
alias(versions.plugins.asciidoctorConvention)
alias(versions.plugins.javaConvention)
alias(versions.plugins.sonarqube)
}
dependencies {
asciidoctorGems 'rubygems:rouge:3.15.0'
implementation 'org.slf4j:slf4j-api:1.7.30'
testImplementation 'org.mockito:mockito-all:1.9.5'
testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
implementation 'ch.qos.logback:logback-core:1.2.6'
implementation 'ch.qos.logback:logback-classic:1.2.6'
implementation versions.slf4j
implementation versions.commonscli
testImplementation versions.junit
implementation versions.bundles.logback
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.12.0'
}
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'
publishing {
publications {
mavenEntwicklung(MavenPublication) {
artifactId = "Entwicklungshandbuch"
artifact pdfArtifactEntwicklung
}
mavenProjekt(MavenPublication) {
artifactId = "Projekthandbuch"
artifact pdfArtifactProjekt
}
mavenPflichtenheft(MavenPublication) {
artifactId = "Pflichtenheft"
artifact pdfArtifactPflichtenheft
}
application(MavenPublication) {
groupId = group
from components.java
}
}
repositories {
maven {
url "https://gitlab.thpeetz.de/api/v4/projects/${projectId}/packages/maven"
credentials(HttpHeaderCredentials) {
name = "Private-Token"
value = gitLabPrivateToken
}
authentication {
header(HttpHeaderAuthentication)
}
}
}
}
application {
mainClassName = MAIN_CLASS_NAME
}
final BUILD_DATE = new Date().format('dd.MM.yyyy').toString()
final MAIN_CLASS_NAME = 'de.thpeetz.generations.App'
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
application {
mainClass = MAIN_CLASS_NAME
}
jar {
manifest {
attributes('Implementation-Title': 'Versabundus Application', 'Implementation-Version': version, 'Main-Class': MAIN_CLASS_NAME)
}
}
tasks.named('test') {
useJUnitPlatform()
}
jacocoTestReport {
reports {
xml.enabled true
attributes 'Implementation-Title': 'Generations Application', 'Implementation-Version': archiveVersion, 'Main-Class': MAIN_CLASS_NAME
}
}
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", "tpeetz_generations_AYB--ei2Uw4Nr911AV3u"
property "sonar.qualitygate.wait", true
property "sonar.host.url", "https://sonar.thpeetz.de"
property "sonar.login", "92ff8e7c02747a905df2c49de874ce3db001bd37"
property "sonar.qualitygate.wait", true
property "sonar.sourceEncoding", "UTF-8"
}
}
tasks.named('sonarqube').configure {
dependsOn test
}
asciidoctorPdf {
dependsOn asciidoctorGemsPrepare
baseDirFollowsSourceFile()
asciidoctorj {
requires 'rouge'
attributes 'build-gradle': file('build.gradle'),
'endpoint-url': 'https://www.thpeetz.de',
'source-highlighter': 'rouge',
'imagesdir': './images',
'toc': 'left',
'toc-title': 'Inhaltsverzeichnis',
'revdate': BUILD_DATE,
'revnumber': { project.version.toString() },
'revremark': 'Entwurf',
'chapter-label': '',
'icons': 'font',
'idprefix': 'id_',
'idseparator': '-',
'docinfo1': ''
}
}
build.dependsOn(['asciidoctorPdf'])
wrapper {
gradleVersion = "6.3"
gradleVersion = "7.5"
}