-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
356 lines (313 loc) · 13.6 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
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
/*
* Copyright (C) 2019, Scott Dial, All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
buildscript {
repositories {
gradlePluginPortal()
mavenCentral()
mavenLocal()
}
dependencyLocking {
lockMode = LockMode.STRICT
lockAllConfigurations()
}
dependencies {
classpath group: 'ca.cutterslade.gradle', name: 'gradle-dependency-analyze', version: gradleDependencyAnalyzeVersion
classpath group: 'com.adarshr', name: 'gradle-test-logger-plugin', version: gradleTestLoggerPluginVersion
classpath group: 'com.benjaminsproule.license', name: 'com.benjaminsproule.license.gradle.plugin', version: licenseGradlePluginVersion
classpath group: 'com.google.protobuf', name: 'protobuf-gradle-plugin', version: protobufGradlePluginVersion
classpath group: 'io.spring.gradle', name: 'dependency-management-plugin', version: springDependencyManagementPluginVersion
classpath group: 'net.ltgt.gradle', name: 'gradle-errorprone-plugin', version: errorpronePluginVersion
classpath group: 'org.asciidoctor.jvm.convert', name: 'org.asciidoctor.jvm.convert.gradle.plugin', version: asciidoctorGradlePluginVersion
classpath group: 'org.jsonschema2pojo', name: 'jsonschema2pojo-gradle-plugin', version: js2pPluginVersion
classpath group: 'org.springframework.boot', name: 'spring-boot-gradle-plugin', version: springBootVersion
classpath group: 'pl.allegro.tech.build', name: 'axion-release-plugin', version: axionReleasePluginVersion
classpath group: 'ru.vyarus', name: 'gradle-quality-plugin', version: gradleQualityPluginVersion
}
}
apply from: file('gradle/base.gradle')
apply from: file('gradle/asciidoc.gradle')
apply from: file('gradle/java.gradle')
apply from: file('gradle/license.gradle')
apply from: file('gradle/publish.gradle')
apply from: file('gradle/repository.gradle')
allprojects {
apply plugin: 'io.spring.dependency-management'
// Ensure that our transitive dependencies are sane.
dependencyManagement {
imports {
mavenBom "io.grpc:grpc-bom:${grpcVersion}"
mavenBom "com.linecorp.armeria:armeria-bom:${armeriaVersion}"
mavenBom "org.glassfish.jaxb:jaxb-bom:${jaxbVersion}"
mavenBom "org.hipparchus:hipparchus:${hipparchusVersion}"
mavenBom "org.springframework:spring-framework-bom:${springVersion}"
mavenBom "org.springframework.boot:spring-boot-dependencies:${springBootVersion}"
}
dependencies {
dependency group: 'com.github.spotbugs', name: 'spotbugs-annotations', version: spotbugsVersion
dependency group: 'com.google.code.findbugs', name: 'jsr305', version: jsr305Version
dependency group: 'com.google.guava', name: 'guava', version: guavaVersion
dependency group: 'com.google.protobuf', name: 'protoc', version: protocVersion
dependency group: 'io.spring.javaformat', name: 'spring-javaformat-checkstyle', version: springJavaformatCheckstyleVersion
dependency group: 'org.jvnet.ogc', name: 'kml-v_2_2_0', version: kmlVersion
dependency group: 'org.orekit', name: 'orekit', version: orekitVersion
}
}
afterEvaluate {
if (configurations.findByName('spotbugs')) {
// Spotbugs relies on a newer version of slf4j, so we need to override the BOM
dependencyManagement {
configurations(spotbugs) {
imports {
mavenBom "org.slf4j:slf4j-parent:${spotbugsSlf4jVersion}"
}
}
}
}
if (configurations.findByName('checkstyle')) {
dependencies {
checkstyle group: 'io.spring.javaformat', name: 'spring-javaformat-checkstyle'
}
}
}
}
project(':posed-core') {
dependencies {
implementation group: 'com.github.spotbugs', name: 'spotbugs-annotations'
implementation group: 'com.google.code.findbugs', name: 'jsr305'
implementation group: 'com.google.guava', name: 'guava'
implementation group: 'io.projectreactor', name: 'reactor-core'
implementation group: 'org.hipparchus', name: 'hipparchus-core'
implementation group: 'org.hipparchus', name: 'hipparchus-geometry'
implementation group: 'org.orekit', name: 'orekit'
implementation group: 'org.reactivestreams', name: 'reactive-streams'
implementation group: 'org.springframework', name: 'spring-beans'
implementation group: 'org.springframework', name: 'spring-context'
permitUnusedDeclared group: 'com.github.spotbugs', name: 'spotbugs-annotations'
testImplementation group: 'io.projectreactor', name: 'reactor-test'
testImplementation group: 'junit', name: 'junit'
testImplementation group: 'org.hamcrest', name: 'hamcrest'
testImplementation group: 'org.reactivestreams', name: 'reactive-streams'
testImplementation group: 'org.springframework', name: 'spring-core'
testImplementation group: 'org.springframework', name: 'spring-beans'
testImplementation group: 'org.springframework', name: 'spring-test'
permitTestUnusedDeclared group: 'com.github.spotbugs', name: 'spotbugs-annotations'
}
}
project(':posed-grpc') {
dependencies {
implementation project(':posed-core')
implementation project(':posed-protos')
implementation group: 'com.github.spotbugs', name: 'spotbugs-annotations'
implementation group: 'com.google.guava', name: 'guava'
implementation group: 'com.linecorp.armeria', name: 'armeria-spring-boot2-webflux-starter'
implementation group: 'com.linecorp.armeria', name: 'armeria-spring-boot2-webflux-autoconfigure'
implementation group: 'com.linecorp.armeria', name: 'armeria-grpc'
implementation group: 'com.linecorp.armeria', name: 'armeria'
implementation group: 'io.grpc', name: 'grpc-api'
implementation group: 'io.grpc', name: 'grpc-services'
implementation group: 'io.grpc', name: 'grpc-stub'
implementation group: 'io.projectreactor', name: 'reactor-core'
implementation group: 'org.hipparchus', name: 'hipparchus-core'
implementation group: 'org.hipparchus', name: 'hipparchus-geometry'
implementation group: 'org.orekit', name: 'orekit'
implementation group: 'org.springframework', name: 'spring-beans'
implementation group: 'org.springframework', name: 'spring-context'
permitUnusedDeclared group: 'com.linecorp.armeria', name: 'armeria-spring-boot2-webflux-starter'
testImplementation project(path: ':posed-core', configuration: 'test')
testImplementation group: 'junit', name: 'junit'
testImplementation group: 'org.hamcrest', name: 'hamcrest'
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test'
testImplementation group: 'org.springframework', name: 'spring-beans'
testImplementation group: 'org.springframework', name: 'spring-test'
permitTestUnusedDeclared group: 'org.springframework.boot', name: 'spring-boot-starter-test'
}
}
project(':posed-protos') {
apply plugin: 'com.google.protobuf'
dependencies {
implementation group: 'com.google.guava', name: 'guava'
implementation group: 'com.google.protobuf', name: 'protobuf-java'
implementation group: 'io.grpc', name: 'grpc-api'
implementation group: 'io.grpc', name: 'grpc-protobuf'
implementation group: 'io.grpc', name: 'grpc-stub'
}
protobuf {
generatedFilesBaseDir = "${buildDir}/grpc"
clean {
delete generatedFilesBaseDir
}
protoc {
artifact = 'com.google.protobuf:protoc'
}
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java"
}
}
generateProtoTasks {
all()*.plugins {
grpc {}
}
all().each { task ->
sourcesJar.dependsOn task
}
}
}
quality {
checkstyle = false
pmd = false
spotbugs = false
}
licenseMain.enabled = false
tasks.withType(JavaCompile) {
options.errorprone.enabled = false
options.compilerArgs.remove('-Xlint:all')
options.compilerArgs.remove('-Werror')
options.compilerArgs << '-Xlint:none' << '-Xlint:-unchecked'
}
}
project(':posed-service') {
dependencies {
implementation project(':posed-core')
implementation project(':posed-grpc')
implementation project(':posed-web')
implementation group: 'com.github.spotbugs', name: 'spotbugs-annotations'
implementation group: 'com.google.guava', name: 'guava'
implementation group: 'com.linecorp.armeria', name: 'armeria-spring-boot2-webflux-starter'
implementation group: 'org.hipparchus', name: 'hipparchus-core'
implementation group: 'org.hipparchus', name: 'hipparchus-geometry'
implementation group: 'org.orekit', name: 'orekit'
implementation group: 'org.slf4j', name: 'slf4j-api'
implementation group: 'org.springframework.boot', name: 'spring-boot'
implementation group: 'org.springframework.boot', name: 'spring-boot-autoconfigure'
implementation group: 'org.springframework', name: 'spring-beans'
implementation group: 'org.springframework', name: 'spring-context'
implementation group: 'org.yaml', name: 'snakeyaml'
permitUnusedDeclared group: 'com.linecorp.armeria', name: 'armeria-spring-boot2-webflux-starter'
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test'
permitTestUnusedDeclared group: 'org.springframework.boot', name: 'spring-boot-starter-test'
}
}
project(':posed-czml') {
apply plugin: 'jsonschema2pojo'
jsonSchema2Pojo {
classNamePrefix = 'Czml';
generateBuilders = true;
inclusionLevel = 'NON_EMPTY';
removeOldOutput = true;
source = files('src/main/json')
targetPackage = 'posed.czml';
}
dependencies {
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations'
}
quality {
checkstyle = false
pmd = false
spotbugs = false
}
licenseMain.enabled = false
tasks.withType(JavaCompile) {
options.errorprone.enabled = false
options.compilerArgs.remove('-Xlint:all')
options.compilerArgs.remove('-Werror')
options.compilerArgs << '-Xlint:none' << '-Xlint:-unchecked'
}
}
project(':posed-web') {
def generatedResourcesDir = "${buildDir}/generated/resources"
sourceSets {
generated {
resources.srcDir generatedResourcesDir
}
}
jar {
from sourceSets.generated.output
}
sourcesJar.from {
sourceSets.generated.allSource
}
dependencies {
implementation project(':posed-core')
implementation project(':posed-czml')
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind'
implementation group: 'com.github.spotbugs', name: 'spotbugs-annotations'
implementation group: 'com.google.guava', name: 'guava'
implementation group: 'com.linecorp.armeria', name: 'armeria-spring-boot2-webflux-autoconfigure'
implementation group: 'com.linecorp.armeria', name: 'armeria-spring-boot2-webflux-starter'
implementation group: 'com.linecorp.armeria', name: 'armeria'
implementation group: 'com.sun.xml.bind', name: 'jaxb-impl'
implementation group: 'io.projectreactor', name: 'reactor-core'
implementation group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api'
implementation group: 'org.hipparchus', name: 'hipparchus-core'
implementation group: 'org.hipparchus', name: 'hipparchus-geometry'
implementation group: 'org.jvnet.ogc', name: 'kml-v_2_2_0'
implementation group: 'org.orekit', name: 'orekit'
implementation group: 'org.springframework', name: 'spring-context'
implementation group: 'org.springframework', name: 'spring-core'
implementation group: 'org.springframework', name: 'spring-web'
implementation group: 'org.springframework', name: 'spring-beans'
permitUnusedDeclared group: 'com.github.spotbugs', name: 'spotbugs-annotations'
permitUnusedDeclared group: 'com.linecorp.armeria', name: 'armeria-spring-boot2-webflux-starter'
runtimeOnly group: 'org.glassfish.jaxb', name: 'jaxb-runtime'
}
licenseGenerated.enabled = false
licenseMain.exclude "/static/Cesium/**"
licenseMain.exclude "/static/CesiumViewer/viewerCesiumNavigationMixin.js"
task copyProtoFiles(dependsOn: [project(':posed-protos').extractProto]) {
project(':posed-protos').sourceSets.main.proto.srcDirs.each {
inputs.dir it
}
outputs.dir "${generatedResourcesDir}/static"
doLast {
mkdir file("${generatedResourcesDir}/static")
copy {
from project(':posed-protos').sourceSets.main.proto.srcDirs
into file("${generatedResourcesDir}/static")
}
}
}
task copyAsciidocFiles(type: Copy, dependsOn: rootProject.asciidoctor) {
into("${generatedResourcesDir}/static/doc")
from("${rootProject.buildDir}/docs/asciidoc") {
exclude '.asciidoctor'
}
}
task generateResources(dependsOn: [copyProtoFiles, copyAsciidocFiles]) {}
processGeneratedResources.dependsOn generateResources
sourcesJar.dependsOn generateResources
}
apply plugin: 'application'
apply plugin: 'org.springframework.boot'
application {
applicationName = 'posed'
mainClass = 'posed.service.Main'
}
dependencies {
runtimeOnly project(':posed-service')
}
bootJar {
baseName = 'posed'
}
task runBootJar(type: JavaExec) {
classpath = files(tasks.bootJar)
}
task distBootJar(type: Copy, dependsOn: bootJar) {
into file("${distDir}")
from bootJar.archiveFile
}
dist.dependsOn distBootJar