-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle
95 lines (81 loc) · 2.5 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
import java.nio.charset.StandardCharsets
plugins {
id 'org.owasp.dependencycheck' version "$owaspDependencyCheckGradlePluginVersion" apply false
id 'org.sonatype.gradle.plugins.scan' version "$sonatypeScanGradlePluginVersion" apply false
id 'com.github.spotbugs' version "$spotbugsGradlePluginVersion" apply false
}
boolean spotbugsEnabled = false
subprojects {
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
tasks.withType(JavaCompile) {
project.sourceCompatibility = JavaVersion.VERSION_17
project.targetCompatibility = JavaVersion.VERSION_17
options.encoding = StandardCharsets.UTF_8
options.incremental = true
}
apply plugin: 'checkstyle'
apply plugin: 'org.owasp.dependencycheck'
apply plugin: 'org.sonatype.gradle.plugins.scan'
apply plugin: 'java'
apply plugin: 'maven-publish'
if (spotbugsEnabled) {
apply plugin: 'com.github.spotbugs'
dependencies {
spotbugsPlugins "com.h3xstream.findsecbugs:findsecbugs-plugin:$findsecbugsVersion"
}
spotbugs {
toolVersion = spotbugsVersion
}
['spotbugsMain', 'spotbugsTest'].each { String spotbugsTaksName ->
tasks.named(spotbugsTaksName) {
it.reports {
html {
enabled = true
stylesheet = 'fancy-hist.xsl'
}
}
}
}
}
java {
withSourcesJar()
}
publishing {
publications {
maven(MavenPublication) {
groupId project.group
artifactId project.name
version projectVersion
from components.java
}
}
}
checkstyle {
toolVersion checkstyleVersion
}
dependencyCheck {
// failBuildOnCVSS = 0
}
afterEvaluate {
tasks.named('check') {
dependsOn 'dependencyCheckAnalyze'
}
}
}
wrapper {
distributionType = Wrapper.DistributionType.ALL
gradleVersion = "7.5.1"
}
final File privatePropertyFile = new File(project.rootDir, 'private/gradle.properties')
if (privatePropertyFile.exists()) {
final Properties privateProperties = new Properties()
privatePropertyFile.withReader { BufferedReader reader ->
privateProperties.load(reader)
privateProperties.stringPropertyNames().each {
project.ext[it] = privateProperties[it]
}
}
}