-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.gradle
164 lines (139 loc) · 4.62 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
import com.github.spotbugs.snom.SpotBugsTask
import groovy.io.FileType
buildscript {
repositories {
mavenCentral()
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath group: 'org.zeroturnaround', name: 'zt-zip', version: ztZipVersion
classpath group: 'org.apache.commons', name: 'commons-lang3', version: commonsLangVersion
classpath "com.github.spotbugs.snom:spotbugs-gradle-plugin:5.0.14"
classpath group: 'org.apache.groovy', name: 'groovy', version: groovyVersion
}
}
plugins {
id 'java'
id 'io.freefair.lombok' version '8.0.1' apply false
id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
id "com.github.ben-manes.versions" version "0.46.0"
id "io.spring.dependency-management" version "1.1.0"
}
allprojects {
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'jacoco'
apply plugin: 'checkstyle'
apply plugin: 'codenarc'
apply plugin: 'com.github.spotbugs'
compileJava.options.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.withType(GroovyCompile) {
groovyOptions.encoding = 'UTF-8'
}
tasks.withType(SpotBugsTask) {
reports {
html {
required = true
outputLocation = file("$buildDir/reports/spotbugs/main/spotbugs.html")
stylesheet = 'fancy-hist.xsl'
}
}
}
repositories {
mavenCentral()
}
configurations.all {
resolutionStrategy {
// multiple versions
force 'ch.qos.logback:logback-core:1.4.5'
force 'ch.qos.logback:logback-classic:1.4.5'
// multiple versions
force "org.springframework.data:spring-data-jpa:$springDataVersion"
// multiple versions
force "net.bytebuddy:byte-buddy:$byteBuddyVersion"
}
}
dependencies {
implementation group: 'jakarta.platform', name: 'jakarta.jakartaee-web-api', version: '10.0.0'
// Utils
implementation group: 'org.json', name: 'json', version: '20230227'
implementation group: 'com.google.guava', name: 'guava', version: '31.1-jre'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: commonsLangVersion
implementation group: 'commons-validator', name: 'commons-validator', version: '1.7'
implementation group: 'commons-logging', name: 'commons-logging', version: '1.2'
implementation group: 'org.apache.commons', name: 'commons-text', version: '1.10.0'
implementation group: 'org.reflections', name: 'reflections', version: '0.10.2'
implementation group: 'com.github.spotbugs', name: 'spotbugs-annotations', version: '4.7.3'
// Testing
testImplementation group: 'commons-io', name: 'commons-io', version: '2.11.0'
testImplementation group: 'org.apache.groovy', name: 'groovy', version: groovyVersion
testImplementation group: 'org.spockframework', name: 'spock-core', version: '2.3-groovy-4.0'
testImplementation group: 'net.bytebuddy', name: 'byte-buddy', version: byteBuddyVersion
testImplementation group: 'com.github.javaparser', name: 'javaparser-core', version: '3.25.2'
testImplementation group: 'cglib', name: 'cglib-nodep', version: '3.3.0'
testImplementation group: 'org.objenesis', name: 'objenesis', version: '3.3'
}
test {
useJUnitPlatform()
maxParallelForks = 1
}
checkstyle {
toolVersion = '10.9.3'
}
codenarc {
configFile = "$rootDir/config/codenarc/codenarc.groovy" as File
toolVersion = '3.2.0'
}
checkstyleMain {
configProperties = [
'baseDir': "$rootDir"
]
}
spotbugs {
toolVersion = '4.7.3'
excludeFilter.set(file("$rootProject.projectDir/config/spotbugs/spotbugs-filter-exclude.xml"))
}
assemble.doFirst {
def customProperties = 'application-stapi-custom.properties'
File file = new File('server/src/main/resources/' + customProperties)
if (!file.exists()) {
logger.warn('Custom properties did not exists, empty file created.')
file.createNewFile()
}
}
}
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { stableKeyword -> version.containsIgnoreCase(stableKeyword) }
if (stableKeyword) {
return false
}
def unstableKeyword = ['-RC', '.CR', '-M', 'BETA', 'ALPHA'].any { unstableKeyword -> version.containsIgnoreCase(unstableKeyword) }
return unstableKeyword
}
tasks.named("dependencyUpdates").configure {
rejectVersionIf {
isNonStable(it.candidate.version)
}
}
dependencyUpdates.gradleReleaseChannel = "current"
nexusPublishing {
repositories {
sonatype {
stagingProfileId = "6bc753ca200e26"
username = project.findProperty("ossrhUsername") as String
password = project.findProperty("ossrhPassword") as String
}
}
}
apply from: 'testing.gradle'
group 'com.cezarykluczynski.stapi'
version "$stapiVersion"
sourceCompatibility = 17
targetCompatibility = 17