This repository has been archived by the owner on Dec 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
207 lines (168 loc) · 6.92 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
buildscript {
repositories {
if (System.getenv('VERIFY_USE_PUBLIC_BINARIES') == 'true') {
logger.warn('Production builds MUST NOT be built with public binaries.\nUse artifactory/allowed-repos for production builds.\n\n')
maven { url 'https://build.shibboleth.net/nexus/content/repositories/releases' }
mavenCentral()
} else {
maven { url 'https://gds.jfrog.io/artifactory/allowed-repos' }
}
}
dependencies {
classpath 'com.github.spullara.mustache.java:compiler:0.9.10',
'org.yaml:snakeyaml:1.33',
'uk.gov.ida:verify-gradle:2.0.0-37',
'com.google.guava:guava:23.0'
}
}
plugins {
id "io.github.gradle-nexus.publish-plugin" version "1.1.0"
}
ext {
opensaml_version = '3.4.6'
dropwizard_version = '2.1.3'
build_version = "$opensaml_version-${System.env.BUILD_NUMBER ?: 'SNAPSHOT'}"
}
allprojects {
apply plugin: 'java'
group = "uk.gov.ida"
version = "$build_version"
}
apply from: 'idea.gradle'
apply from: 'publish.gradle'
repositories {
mavenCentral()
}
def dependencyVersions = [
ida_utils:'414',
dropwizard:"$dropwizard_version",
ida_test_utils:"2.0.0-70",
opensaml:"$opensaml_version",
dev_pki: '2.0.0-48',
saml_lib:"$opensaml_version-276",
glassfish_version:'2.6.1',
glassfish_jersey_version:'2.34'
]
subprojects {
repositories {
if (System.getenv('VERIFY_USE_PUBLIC_BINARIES') == 'true') {
logger.warn('Production builds MUST NOT be built with public binaries.\nUse artifactory/allowed-repos for production builds.\n\n')
mavenCentral()
} else {
maven { url 'https://gds.jfrog.io/artifactory/allowed-repos' }
}
}
task allDeps(type: DependencyReportTask) {}
configurations {
common
dropwizard
msa
saml
saml_test
soap
test_utils
test_deps_compile
test_deps_runtime
integrationtests
config
verify_event_emitter
ida_utils
dev_pki
saml_lib
prometheus
redis
redis_test
awssdk
s3mock
snakeYaml
}
configurations.all {
resolutionStrategy {
force "ch.qos.logback:logback-classic:1.2.9"
force "ch.qos.logback:logback-access:1.2.9"
force "org.apache.santuario:xmlsec:2.1.8"
}
}
dependencies {
common 'joda-time:joda-time:2.12.0',
'com.google.inject:guice:5.1.0',
"javax.xml.bind:jaxb-api:2.3.1",
"com.sun.xml.bind:jaxb-core:4.0.1",
"com.sun.xml.bind:jaxb-impl:4.0.1",
"org.glassfish.jersey.media:jersey-media-jaxb:2.38"
dropwizard "io.dropwizard:dropwizard-core:$dependencyVersions.dropwizard",
"io.dropwizard:dropwizard-client:$dependencyVersions.dropwizard",
"io.dropwizard:dropwizard-auth:$dependencyVersions.dropwizard",
"io.dropwizard:dropwizard-configuration:$dependencyVersions.dropwizard",
"io.dropwizard:dropwizard-metrics-graphite:$dependencyVersions.dropwizard",
'org.dhatim:dropwizard-sentry:2.1.2-4',
'com.google.inject.extensions:guice-servlet:5.1.0',
"org.glassfish.hk2:guice-bridge:$dependencyVersions.glassfish_version",
"org.glassfish.jersey.inject:jersey-hk2:$dependencyVersions.glassfish_jersey_version",
"org.glassfish.jersey.core:jersey-client:$dependencyVersions.glassfish_jersey_version",
"org.glassfish.jersey.core:jersey-server:$dependencyVersions.glassfish_jersey_version",
'org.reflections:reflections:0.10.2'
config 'commons-io:commons-io:2.11.0'
verify_event_emitter "uk.gov.ida:verify-event-emitter:2.0.0-88"
ida_utils "uk.gov.ida:common-utils:2.0.0-$dependencyVersions.ida_utils",
"uk.gov.ida:security-utils:2.0.0-$dependencyVersions.ida_utils",
"uk.gov.ida:rest-utils:2.0.0-$dependencyVersions.ida_utils"
dev_pki "uk.gov.ida:verify-dev-pki:$dependencyVersions.dev_pki"
prometheus 'uk.gov.ida:gds-metrics-dropwizard:0.7.0-13'
saml "org.opensaml:opensaml-core:$dependencyVersions.opensaml",
project(":hub-saml")
constraints {
saml("org.bouncycastle:bcprov-jdk15on:1.67") {
because "opensaml:3.4.6 has a dep on bcprov-jdk15on:1.59 which is vulnerable to CVE-2018-1000180"
}
}
saml_lib "uk.gov.ida:saml-lib:$dependencyVersions.saml_lib"
saml_test "uk.gov.ida:saml-test:$dependencyVersions.saml_lib"
test_utils "io.dropwizard:dropwizard-testing:$dependencyVersions.dropwizard",
"org.junit.jupiter:junit-jupiter-api:5.9.1",
"org.mockito:mockito-junit-jupiter:4.8.1",
'org.assertj:assertj-core:3.23.1',
'commons-io:commons-io:2.11.0'
def test_deps_deps = [
'org.json:json:20220924',
'com.jayway.awaitility:awaitility:1.7.0',
'com.github.tomakehurst:wiremock-standalone:2.27.2',
"uk.gov.ida:saml-test:$dependencyVersions.saml_lib",
"uk.gov.ida:common-test-utils:$dependencyVersions.ida_test_utils",
"org.glassfish.jersey.media:jersey-media-jaxb:2.33"
]
test_deps_deps.each { dep ->
test_deps_runtime(dep)
test_deps_compile(dep) { transitive = false }
}
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1'
soap('org.apache.ws.commons:ws-commons-util:1.0.1') { transitive = false }
redis('io.lettuce:lettuce-core:6.2.1.RELEASE')
redis_test('com.github.kstyrc:embedded-redis:0.6')
awssdk 'com.amazonaws:aws-java-sdk-s3:1.12.338'
s3mock ('com.adobe.testing:s3mock-junit5:2.11.0') { exclude group: 'org.yaml', module: 'snakeyaml' }
snakeYaml 'org.yaml:snakeyaml:1.33'
}
tasks.withType(Test) {
useJUnitPlatform()
}
}
task downloadDependencies(type: Exec) {
configurations.testRuntimeClasspath.files
commandLine 'echo', 'Downloaded all dependencies'
}
task(outputDependencies) doLast {
println "hub_saml="+dependencyVersions.hub_saml
println "saml_metadata="+dependencyVersions.saml_metadata
println "rest_utils="+dependencyVersions.rest_utils
println "ida_utils="+dependencyVersions.ida_utils
}
import javax.crypto.Cipher
task(checkJceInstalled) doLast {
if (Cipher.getMaxAllowedKeyLength('AES') <= 128) {
throw new GradleException("""ERROR: You need to have the unlimited strength JCE installed.
See http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
+Note this is installed by default in Java 8 1.6.1 or later""")
}
}
defaultTasks 'clean', 'test', 'jar'