-
Notifications
You must be signed in to change notification settings - Fork 56
/
build.gradle
221 lines (190 loc) · 7.87 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
ext.moduleName = 'stroom.proxy.app'
def fatJarName = 'stroom-proxy-app-all.jar'
def releaseBuildDir = 'build/release'
def configDefaultsFile = "${releaseBuildDir}/config/config-defaults.yml"
def configSchemaFile = "${releaseBuildDir}/config/config-schema.yml"
apply plugin: 'application'
apply plugin: 'com.github.johnrengelman.shadow'
mainClassName = 'stroom.proxy.app.App'
dependencies {
implementation project(':stroom-core-shared')
implementation project(':stroom-data:stroom-data-zip')
implementation project(':stroom-db-util')
implementation project(':stroom-dictionary:stroom-dictionary-api')
implementation project(':stroom-dictionary:stroom-dictionary-impl')
implementation project(':stroom-docref')
implementation project(':stroom-docstore:stroom-docstore-api')
implementation project(':stroom-docstore:stroom-docstore-impl')
implementation project(':stroom-docstore:stroom-docstore-impl-fs')
implementation project(':stroom-dropwizard-common')
implementation project(':stroom-event-logging-rs:stroom-event-logging-rs-api')
implementation project(':stroom-explorer:stroom-collection-api')
implementation project(':stroom-explorer:stroom-collection-mock')
implementation project(':stroom-explorer:stroom-explorer-api')
implementation project(':stroom-explorer:stroom-docrefinfo-api')
implementation project(':stroom-importexport:stroom-importexport-api')
implementation project(':stroom-meta:stroom-meta-api')
implementation project(':stroom-legacy:stroom-legacy-impex_6_1')
implementation project(':stroom-pipeline')
implementation project(':stroom-proxy:stroom-proxy-remote-api')
implementation project(':stroom-proxy:stroom-proxy-repo')
implementation project(':stroom-receive:stroom-receive-common')
implementation project(':stroom-receive:stroom-receive-rules-impl')
implementation project(':stroom-security:stroom-security-api')
implementation project(':stroom-security:stroom-security-common-impl')
implementation project(':stroom-security:stroom-security-mock')
implementation project(':stroom-security:stroom-security-openid-api')
implementation project(':stroom-task:stroom-task-api')
implementation project(':stroom-task:stroom-task-impl')
implementation project(':stroom-util')
implementation project(':stroom-util-shared')
implementation libs.aws_sqs
implementation libs.dropwizard_assets
implementation libs.dropwizard_core
implementation libs.dropwizard_client
implementation libs.dropwizard_jersey
implementation libs.dropwizard_jetty
implementation libs.dropwizard_metrics_healthchecks
implementation libs.dropwizard_servlets
implementation libs.dropwizard_metrics_core
implementation libs.dropwizard_metrics_annotation
implementation libs.dropwizard_configuration
implementation libs.eventLogging
implementation libs.guava
implementation libs.guice
implementation libs.jackson_annotations
implementation libs.jackson_core
implementation libs.jackson_databind
implementation libs.jakarta_servlet_api
implementation libs.jakarta_inject
implementation libs.jaxb_api
implementation libs.jetty_server
implementation libs.jose4j
implementation libs.kafka_clients
implementation libs.slf4j_api
implementation libs.swagger_annotations
testImplementation project(':stroom-test-common')
testImplementation libs.assertj_core
testImplementation libs.classgraph
testImplementation libs.commons_compress
testImplementation libs.dropwizard_testing
testImplementation libs.dropwizard_validation
testImplementation libs.guice_extension
testImplementation libs.guice_grapher
testImplementation libs.jinjava
testImplementation libs.jmh_core
testImplementation libs.jmh_generator_annprocess
testImplementation libs.junit_jupiter_api
testImplementation libs.junit_jupiter_api
testImplementation libs.mbknor_jackson_jsonSchema
testImplementation libs.mockito_junit_jupiter
testImplementation libs.wiremock
// The following logging libs are needed when running junits outside dropwizard
testRuntimeOnly libs.jakarta_activation
testRuntimeOnly libs.jaxb_impl
testRuntimeOnly libs.jcl_over_slf4j
testRuntimeOnly libs.jul_to_slf4j
testRuntimeOnly libs.junit_jupiter_engine
testRuntimeOnly libs.log4j_over_slf4j
testRuntimeOnly libs.logback_classic
testRuntimeOnly libs.logback_core
}
jar {
manifest {
attributes(
"Implementation-Title": "Stroom Proxy",
"Implementation-Version": versions.stroom,
"Main-Class": "stroom.proxy.app.App"
)
}
}
shadowJar {
// We want to run the tests before we build the fat jar.
dependsOn test
// Allows us to build fat jars with lots of files
zip64 true
// A transformer to merges files in META-INF/services
mergeServiceFiles()
archiveFileName = fatJarName
}
def proxyDockerBuildDir = "${projectDir}/docker/build"
clean {
delete proxyDockerBuildDir
}
// Generate the confi.yml files for the zip and docker distributions
tasks.register('generateConfigFiles', JavaExec) {
classpath = sourceSets.test.runtimeClasspath
mainClass = "stroom.proxy.dist.GenerateProxyDistributionConfig"
}
// Copy all the files needed by the stroom-proxy docker build into stroom-app/proxy-docker/build
tasks.register('copyFilesForProxyDockerBuild') {
dependsOn shadowJar
dependsOn generateConfigFiles
doFirst {
// Copy the stroom app fat jar
copy {
from layout.buildDirectory.dir("libs/${fatJarName}")
into proxyDockerBuildDir
}
// The config.yml will be put in place by generateConfigFiles
}
}
test {
maxParallelForks = 1
}
// The gradle application plugin enables the distribution plugin
// which creates .zip/tar archives by default, as does the shadow plugin
// We have our own buildDistribution task so disable the standard ones to avoid confusion
distZip.enabled = false
distTar.enabled = false
shadowDistZip.enabled = false
shadowDistTar.enabled = false
tasks.register('copyJar', Copy) {
dependsOn shadowJar
from shadowJar.outputs.files
into "${releaseBuildDir}/bin"
}
tasks.register('copyCommonSupportingFiles', Copy) {
from '../../dist'
// migrate is a stroom only thing
exclude '**/migrate.sh'
into releaseBuildDir
}
tasks.register('copySupportingFiles', Copy) {
dependsOn copyCommonSupportingFiles
from 'src/main/resources/banner.txt'
from 'src/dist'
into releaseBuildDir
doLast {
exec {
// Move the banner.txt into bin where it is expected
commandLine 'mv', "${releaseBuildDir}/banner.txt", "${releaseBuildDir}/bin/banner.txt"
}
// This is a sym-link so it seems to go into the zip with +x perms
// which we don't want
//exec {
//commandLine 'chmod', '644', "${releaseBuildDir}/config/config.yml"
//}
}
}
// Create an example yaml config file from the compile-time defaults
tasks.register('generateConfigDefaultsYamlFile', JavaExec) {
//dependsOn ':stroom-config:stroom-config-app:compileJava'
//dependsOn ':stroom-config:stroom-config-app:compileTestJava'
classpath = project(':stroom-proxy:stroom-proxy-app').sourceSets.test.runtimeClasspath
mainClass = 'stroom.proxy.dist.GenerateProxyExpectedYaml'
args = [configDefaultsFile, configSchemaFile]
}
// Build the release distribution zip for stroom proxy
tasks.register('buildDistribution', Zip) {
// run all the tasks that produce content for the zip
dependsOn copyJar
dependsOn copySupportingFiles
dependsOn generateConfigFiles
dependsOn generateConfigDefaultsYamlFile
from releaseBuildDir
}
// Make the build command create the full distribution
tasks.build.dependsOn copyFilesForProxyDockerBuild
tasks.build.dependsOn shadowJar
tasks.build.dependsOn buildDistribution