-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
214 lines (182 loc) · 5.43 KB
/
build.gradle
File metadata and controls
214 lines (182 loc) · 5.43 KB
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
plugins {
id 'war'
id 'checkstyle'
id 'eclipse'
id 'org.springframework.boot' version '3.4.5'
}
apply plugin: 'war'
apply plugin: 'checkstyle'
apply plugin: 'io.spring.dependency-management'
dependencyManagement {
imports {
mavenBom org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES
}
}
description = 'SolarSSH Server'
version = "${version}"
base {
archivesName = 'solarssh'
}
group = "net.solarnetwork.central"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
repositories {
mavenLocal()
mavenCentral()
}
ext {
bouncyCastleVersion = '1.80'
checkstyleVersion = '10.23.1'
sshdVersion = '2.15.0'
libraries = [
// Test dependencies.
mockito: 'org.mockito:mockito-core',
mockitoJupiter: 'org.mockito:mockito-junit-jupiter'
]
}
configurations {
all*.exclude group: 'commons-logging'
all*.exclude group: 'io.netty'
all*.exclude group: 'log4j', module: 'log4j'
all*.exclude group: 'net.sf.supercsv'
all*.exclude group: 'net.solarnetwork.common', module: 'net.solarnetwork.common.mqtt'
all*.exclude group: 'org.apache.tomcat', module: 'tomcat-jdbc'
all*.exclude group: 'org.mybatis'
all*.exclude group: 'org.mybatis.spring.boot'
all*.exclude group: 'org.osgi'
all*.exclude group: 'org.springframework', module: 'spring-messaging'
all*.exclude group: 'org.springframework.security'
all*.exclude group: 'org.slf4j', module: 'slf4j-log4j12'
all*.exclude group: 'software.amazon.awssdk'
}
dependencies {
// WAR
providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
// Spring
implementation 'org.springframework.boot:spring-boot-starter-cache'
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf';
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-websocket'
// JSON
implementation "com.fasterxml.jackson.core:jackson-annotations"
implementation "com.fasterxml.jackson.core:jackson-core"
implementation "com.fasterxml.jackson.core:jackson-databind"
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-cbor'
// DB
implementation "org.postgresql:postgresql"
// SSH
implementation "org.apache.sshd:sshd-mina:${sshdVersion}"
implementation "org.bouncycastle:bcpg-jdk18on:${bouncyCastleVersion}"
implementation "org.bouncycastle:bcpkix-jdk18on:${bouncyCastleVersion}"
implementation 'net.i2p.crypto:eddsa:0.3.0'
// SolarNetwork
implementation 'net.solarnetwork.common:net.solarnetwork.common:3.31+'
implementation 'net.solarnetwork.common:net.solarnetwork.common.web.jakarta:2.0+'
implementation 'net.solarnetwork.central:solarnet-common:2.16+'
// JCache
implementation 'javax.cache:cache-api'
implementation 'org.ehcache:ehcache'
// HTTP
implementation 'org.mitre.dsmiley.httpproxy:smiley-http-proxy-servlet:2.0'
// Testing
testImplementation libraries.mockito,
libraries.mockitoJupiter
testImplementation 'ch.qos.logback:logback-classic:1.5.18'
}
jar {
manifest {
attributes 'Implementation-Version': version
}
}
[
compileJava,
compileTestJava
].each() {
it.options.release = 21
it.options.compilerArgs += [
"-Xlint:all",
"-Xlint:-options",
"-Xlint:-path",
"-Xlint:-serial",
"-Xlint:-this-escape",
"-Xlint:-try",
"-parameters"
]
it.options.encoding = "UTF-8"
if (rootProject.hasProperty('failOnWarnings') && rootProject.failOnWarnings.toBoolean()) {
it.options.compilerArgs += ["-Werror"]
}
}
compileTestJava {
options.compilerArgs += [
"-Xlint:-serial",
"-Xlint:-static",
"-Xlint:-this-escape"
]
}
jar.manifest {
attributes('Implementation-Title': name,
'Implementation-Version': version,
'Built-By': System.getProperty('user.name'),
'Built-JDK': System.getProperty('java.version'))
}
javadoc.options {
encoding = 'UTF-8'
use = true
links 'https://docs.oracle.com/en/java/javase/21/docs/api/'
source = "21"
}
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
options.addBooleanOption('html5', true)
}
}
task javadocJar(type: Jar) {
from javadoc
archiveClassifier = 'javadoc'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
archiveClassifier = 'sources'
}
eclipse {
jdt {
javaRuntimeName 'JavaSE-21'
file {
withProperties { properties ->
// set properties for the file org.eclipse.jdt.core.prefs to enable -parameters for Spring 6
properties['org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode'] = 'enabled'
properties['org.eclipse.jdt.core.compiler.codegen.methodParameters'] = 'generate'
}
}
}
}
checkstyle {
toolVersion = "${checkstyleVersion}"
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
ignoreFailures = false
if (rootProject.hasProperty("checkstyle.ignoreFailures")) {
ignoreFailures = rootProject.properties["checkstyle.ignoreFailures"].toBoolean()
}
}
checkstyleMain {
source = fileTree(dir: "src/main", include: "**/*.java")
}
checkstyleTest {
source = fileTree(dir: "src/test", include: "**/*.java")
}
test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
showExceptions true
showCauses true
showStackTraces true
}
maxHeapSize = '1500m'
}