plugins { id 'java-library' id 'jacoco' id "org.sonarqube" version "3.3" id 'org.asciidoctor.jvm.pdf' version '3.3.2' id 'org.asciidoctor.jvm.convert' version '3.3.2' id 'org.asciidoctor.jvm.gems' version '3.3.2' id 'maven-publish' } repositories { jcenter() ruby.gems() } dependencies { asciidoctorGems 'rubygems:rouge:3.15.0' asciidoctorGems 'rubygems:asciidoctor-diagram:2.2.2' testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' } final BUILD_DATE = new Date().format('dd.MM.yyyy').toString() def pdfFile = layout.buildDirectory.file("docs/asciidocPdf/" + project.name + ".pdf") def pdfArtifact = artifacts.add('archives', pdfFile.get().asFile) { type 'pdf' builtBy asciidoctorPdf } sourceCompatibility = 1.8 publishing { publications { maven(MavenPublication) { group = group + '.docs' artifactId = project.name artifact pdfArtifact } } publications { osistacklibrary(MavenPublication) { 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) } } } } test { useJUnitPlatform() testLogging { events "passed", "skipped", "failed" } } jacocoTestReport { reports { xml.enabled true } } test.finalizedBy jacocoTestReport sonarqube { properties { property "sonar.projectKey", "github_osi-stack_AYBw4khXuGIZKMqU5_ed" property "sonar.host.url", "https://sonar.thpeetz.de" property "sonar.login", "71bff82090aff3503c20d5070949c3bba548c51e" property "sonar.qualitygate.wait", true property "sonar.sourceEncoding", "UTF-8" } } tasks.named('sonarqube').configure { dependsOn test } asciidoctorPdf { dependsOn asciidoctorGemsPrepare baseDirFollowsSourceFile() asciidoctorj { requires 'rouge', 'asciidoctor-diagram' 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': '' } } wrapper { gradleVersion = "6.3" }