forked from govuk-one-login/ipv-cri-common-lambdas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
176 lines (144 loc) · 4.76 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
plugins {
id "java"
id "org.sonarqube" version "4.4.+"
id "com.diffplug.spotless" version "6.23.+"
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
ext {
dependencyVersions = [
aws_lambda_events_version: "3.11.0",
jackson_version : "2.13.1",
nimbusds_oauth_version : "11.2",
nimbusds_jwt_version : "9.36",
protobuf_version : "3.19.4",
junit : "5.10.1",
mockito : "4.3.1",
glassfish_version : "3.0.3",
powertools_version : "1.12.3",
cri_common_lib : "1.5.6"
]
}
repositories {
maven {
url 'https://gds.jfrog.io/artifactory/di-allowed-repos'
}
}
spotless {
java {
target "**/src/**/*.java"
googleJavaFormat("1.13.0").aosp()
importOrder "", "javax", "java", "\\#"
endWithNewline()
}
groovyGradle {
target '**/*.gradle'
greclipse()
trimTrailingWhitespace()
endWithNewline()
}
}
sonar {
properties {
property "sonar.projectName", "ipv-cri-common-lambdas-java"
property "sonar.projectKey", "ipv-cri-common-lambdas-java"
property "sonar.organization", "govuk-one-login"
property "sonar.host.url", "https://sonarcloud.io"
}
}
subprojects {
apply plugin: 'java'
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
repositories {
maven {
url 'https://gds.jfrog.io/artifactory/di-allowed-repos'
}
}
configurations {
aws
dynamodb
cache
jackson
tests
test_runtime
logging_runtime
lambda
sqs
powertools
nimbus
kms
mockito
lambda_tests
lettuce
ssm
cucumberRuntime
cri_common_lib
pact_tests
}
// The dynamodb enhanced package loads the apache-client as well as the spi-client, so
// we need to add the apache-client to the dependencies exclusion to not get a mismatch
configurations.all {
exclude group:"software.amazon.awssdk", module: "apache-client"
}
dependencies {
aws platform('software.amazon.awssdk:bom:2.17.191')
cri_common_lib "uk.gov.account:cri-common-lib:${dependencyVersions.cri_common_lib}"
dynamodb "software.amazon.awssdk:dynamodb",
"software.amazon.awssdk:dynamodb-enhanced"
lambda "software.amazon.awssdk:lambda",
"com.amazonaws:aws-lambda-java-events:${dependencyVersions.aws_lambda_events_version}"
//"org.apache.httpcomponents:httpclient:4.5.13"
sqs "software.amazon.awssdk:sqs"
kms "software.amazon.awssdk:kms"
lambda_tests "software.amazon.awssdk:aws-lambda-java-tests:1.1.1"
jackson "com.fasterxml.jackson.core:jackson-core:${dependencyVersions.jackson_version}",
"com.fasterxml.jackson.core:jackson-databind:${dependencyVersions.jackson_version}",
"com.fasterxml.jackson.core:jackson-annotations:${dependencyVersions.jackson_version}",
"com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${dependencyVersions.jackson_version}",
"com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${dependencyVersions.jackson_version}",
"javax.annotation:javax.annotation-api:1.3.2",
"javax.validation:validation-api:2.0.1.Final",
"javax.el:javax.el-api:3.0.0",
"org.glassfish:javax.el:3.0.0"
powertools "software.amazon.lambda:powertools-logging:${dependencyVersions.powertools_version}",
"software.amazon.lambda:powertools-metrics:${dependencyVersions.powertools_version}",
"software.amazon.lambda:powertools-tracing:${dependencyVersions.powertools_version}",
"software.amazon.lambda:powertools-parameters:${dependencyVersions.powertools_version}"
tests "org.junit.jupiter:junit-jupiter-api:${dependencyVersions.junit}",
"org.junit.jupiter:junit-jupiter-params:${dependencyVersions.junit}",
"org.mockito:mockito-junit-jupiter:${dependencyVersions.mockito}",
"org.mockito:mockito-inline:${dependencyVersions.mockito}",
"org.hamcrest:hamcrest:2.2"
pact_tests "au.com.dius.pact.provider:junit5:4.5.8",
"au.com.dius.pact:provider:4.5.8",
"software.amazon.awssdk:dynamodb:2.21.24"
test_runtime "org.junit.jupiter:junit-jupiter-engine:${dependencyVersions.junit}"
logging_runtime "com.amazonaws:aws-lambda-java-log4j2:1.5.1"
lambda_tests "software.amazon.awssdk:aws-lambda-java-tests:1.1.1"
nimbus "com.nimbusds:oauth2-oidc-sdk:${dependencyVersions.nimbusds_oauth_version}",
"com.nimbusds:nimbus-jose-jwt:${dependencyVersions.nimbusds_jwt_version}"
}
apply plugin: 'java'
test {
// Configures environment variable to avoid initialization of AWS X-Ray segments for each tests
environment "LAMBDA_TASK_ROOT", "handler"
filter {
excludeTestsMatching "uk.gov.di.ipv.cri.kbv.acceptancetest.journey.*"
}
}
tasks.register("pactTests", Test) {
useJUnitPlatform {
includeTags 'Pact'
}
}
}
clean.doFirst {
delete "${rootDir}/dist/"
delete "${rootDir}/.aws-sam"
}
defaultTasks 'clean', 'spotlessApply', 'build'