Use Convention Plugin - OP#241
This commit is contained in:
+22
-125
@@ -1,89 +1,38 @@
|
||||
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.22'
|
||||
testImplementation 'org.mockito:mockito-all:1.9.5'
|
||||
testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
|
||||
implementation 'ch.qos.logback:logback-core:1.1.2'
|
||||
implementation 'ch.qos.logback:logback-classic:1.1.2'
|
||||
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'
|
||||
sourceCompatibility = 1.8
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final BUILD_DATE = new Date().format('dd.MM.yyyy').toString()
|
||||
|
||||
final MAIN_CLASS_NAME = 'com.thpeetz.versabundus.VersabundusApp'
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
application {
|
||||
mainClassName = MAIN_CLASS_NAME
|
||||
mainClass = MAIN_CLASS_NAME
|
||||
}
|
||||
|
||||
jar {
|
||||
@@ -92,39 +41,10 @@ jar {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.named('test') {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
jacocoTestReport {
|
||||
reports {
|
||||
xml.enabled true
|
||||
}
|
||||
}
|
||||
|
||||
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_versabundus_AYB03YW5uGIZKMqU5_es"
|
||||
@@ -135,36 +55,13 @@ sonarqube {
|
||||
}
|
||||
}
|
||||
|
||||
test.finalizedBy jacocoTestReport
|
||||
|
||||
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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user