-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
112 lines (99 loc) · 2.73 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
plugins {
id 'jacoco'
id 'java'
id 'maven-publish'
id "org.owasp.dependencycheck" version "8.4.0"
id 'checkstyle'
id "org.sonarqube" version "4.3.1.3277"
}
group = 'com.docutools'
version = '2.0.0'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url "https://maven.pkg.github.com/dds-gmbh/poipath"
credentials {
username = project.findProperty("GITHUB_USERNAME") ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("GITHUB_TOKEN") ?: System.getenv("GITHUB_TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
from(components.java)
artifactId = 'poipath'
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
}
}
}
def apachePOIVersion = '5.2.3'
dependencies {
implementation("org.apache.poi:poi:$apachePOIVersion")
implementation("org.apache.poi:poi-ooxml:$apachePOIVersion")
implementation("org.apache.poi:poi-ooxml-lite:$apachePOIVersion")
testImplementation('org.junit.jupiter:junit-jupiter:5.10.0')
testImplementation("org.hamcrest:hamcrest:2.2")
}
java {
withSourcesJar()
withJavadocJar()
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
dependencyCheck {
format = 'ALL'
junitFailOnCVSS = 6.0
failBuildOnCVSS = 6.0
suppressionFile = 'config/dependency-check/suppression.xml'
}
tasks.withType(Checkstyle) {
ignoreFailures = false
maxWarnings = 0 // Maximum number of warnings allowed
reports {
html.outputLocation = rootProject.file("build/reports/checkstyle.html")
}
}
sonarqube {
properties {
property "sonar.projectKey", "poipath"
property "sonar.organization", "docu-tools"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.sourceEncoding", "UTF-8"
property "sonar.verbose", "true"
property "sonar.sources", "src/main/java/"
property "sonar.language", "java"
property "sonar.java.binaries", "."
property "sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco/test/jacocoTestReport.xml"
property "sonar.qualitygate.wait", "true"
property "sonar.qualitygate.timeout", "180"
}
}
jacocoTestReport {
reports {
xml.required = true
}
dependsOn test
}