forked from hmcts/service-auth-provider-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
147 lines (124 loc) · 4.63 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
plugins {
id 'java'
id 'application'
id 'jacoco'
id 'com.github.ben-manes.versions' version '0.17.0'
id 'org.owasp.dependencycheck' version '3.2.1'
id 'org.sonarqube' version '2.6.1'
id 'org.springframework.boot' version '2.0.3.RELEASE'
}
group = 'uk.gov.hmcts.auth.provider.service'
sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceSets {
functionalTest {
java {
compileClasspath += main.output
runtimeClasspath += main.output
srcDir file('src/functionalTest/java')
}
}
}
repositories {
jcenter()
mavenLocal()
maven { url "https://dl.bintray.com/hmcts/hmcts-maven" }
}
// https://jeremylong.github.io/DependencyCheck/dependency-check-gradle/configuration.html
dependencyCheck {
// Specifies if the build should be failed if a CVSS score above a specified level is identified.
// range of 0-10 fails the build, anything greater and it doesn't fail the build
failBuildOnCVSS = System.getProperty('dependencyCheck.failBuild') == 'false' ? 11 : 0
suppressionFile = 'dependency-check-suppressions.xml'
analyzers {
// Disable scanning of .NET related binaries
assemblyEnabled = false
}
}
dependencyUpdates.resolutionStrategy = {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm'].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
}
if (rejected) {
selection.reject('Release candidate')
}
}
}
}
sonarqube {
properties {
property "sonar.projectName", "Reform :: Service Auth Provider"
property 'sonar.coverage.exclusions', "**/config/**"
}
}
def versions = [
springBoot: plugins.getPlugin('org.springframework.boot').class.package.implementationVersion,
springfoxSwagger: '2.9.0',
reformLogging: '3.0.1',
logback: '1.2.3'
]
dependencies {
compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: versions.springBoot
compile group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: versions.springBoot
compile group: 'com.google.guava', name: 'guava', version: '21.0'
compile group: 'io.jsonwebtoken', name: 'jjwt', version: '0.7.0'
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.3'
compile group: 'com.warrenstrange', name: 'googleauth', version: '1.1.2'
compile group: 'uk.gov.hmcts.reform', name: 'java-logging-appinsights', version: versions.reformLogging
compile group: 'uk.gov.hmcts.reform', name: 'java-logging', version: versions.reformLogging
compile group: 'ch.qos.logback', name: 'logback-classic', version: versions.logback
compile group: 'ch.qos.logback', name: 'logback-core', version: versions.logback
compile group: 'io.springfox', name: 'springfox-swagger2', version: versions.springfoxSwagger
compile group: 'io.springfox', name: 'springfox-swagger-ui', version: versions.springfoxSwagger
compileOnly group: 'net.sourceforge.findbugs', name: 'annotations', version: '1.3.2'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.assertj', name: 'assertj-core', version: '3.5.2'
functionalTestCompile sourceSets.main.runtimeClasspath
functionalTestCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: versions.springBoot
functionalTestCompile group: 'com.typesafe', name: 'config', version: '1.3.3'
functionalTestCompile group: 'io.rest-assured', name: 'rest-assured', version: '3.1.0'
testCompile(group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: versions.springBoot) {
exclude(module: 'commons-logging')
}
}
installDist {
applicationDefaultJvmArgs = ["-Djava.security.egd=file:/dev/./urandom"]
}
run {
applicationDefaultJvmArgs = ["-Djava.security.egd=file:/dev/./urandom"]
mainClassName = 'uk.gov.hmcts.auth.provider.service.api.ServiceAuthProviderApplication'
}
jar {
archiveName 'service-auth-provider.jar'
manifest {
attributes('Implementation-Version': project.version.toString())
}
}
task printVersion {
doLast {
print project.version
}
}
compileFunctionalTestJava {
options.compilerArgs << "-Xlint:unchecked"
}
task functional(type: Test, group: 'Verification') {
description = "Runs Functional Tests"
testClassesDirs = sourceSets.functionalTest.output.classesDirs
classpath = sourceSets.functionalTest.runtimeClasspath
}
task smoke(type: Test) {
dependsOn functional
description = "Runs Smoke Tests"
}
jacocoTestReport {
executionData(test)
reports {
xml.enabled true
html.enabled true
html.destination file("${buildDir}/reports/jacoco")
csv.enabled false
}
}