plugins { id 'application' id 'jacoco' 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" } } 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' } publishing { publications { library(MavenPublication) { from components.java } } repositories { maven { url "https://gitlab.thpeetz.de/api/v4/projects/27/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' group = 'de.thpeetz.versabundus' sourceCompatibility = 1.8 application { mainClassName = 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 } } test.finalizedBy jacocoTestReport sonarqube { properties { // property "sonar.projectKey", "kontor_kontor-java_AX-dd-w3rXuu6JVRvr_g" property "sonar.host.url", "https://sonar.thpeetz.de" // property "sonar.login", "d39622f640a91f501b1e8a73d7d78c4fc412fc98" property "sonar.qualitygate.wait", true property "sonar.sourceEncoding", "UTF-8" } } 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 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': '1.0.0', 'revremark': 'Entwurf', 'chapter-label': '', 'icons': 'font', 'idprefix': 'id_', 'idseparator': '-', 'docinfo1': '' } } task asciidoctor(dependsOn: asciidoctorPdf) build.dependsOn(['asciidoctor']) wrapper { gradleVersion = "6.3" }