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 3
/
build.gradle
159 lines (139 loc) · 5.16 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
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
id "io.github.gradle-nexus.publish-plugin" version "1.0.0"
}
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'signing'
def buildVersion = "2.0.0-${System.env.BUILD_NUMBER ?: 'SNAPSHOT'}"
group = "uk.gov.ida"
version = "$buildVersion"
archivesBaseName = "verify-event-emitter"
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' }
}
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}
sourceSets {
intTest {
java.srcDir 'src/intTest/java'
}
}
dependencies {
compile 'joda-time:joda-time:2.9.9',
'com.google.inject:guice:4.0',
'com.google.code.findbugs:jsr305:1.3.9',
'com.amazonaws:aws-java-sdk-sqs:1.11.562',
'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.8.10',
'uk.gov.ida:dropwizard-logstash:2.1.3-93',
'org.slf4j:slf4j-api:1.7.26'
testCompile 'junit:junit:4.12',
'uk.gov.ida:common-test-utils:2.0.0-66',
'org.assertj:assertj-core:3.12.2',
'org.mockito:mockito-core:2.27.0',
'nl.jqno.equalsverifier:equalsverifier:2.4.7',
'org.json:json:20180130'
intTestCompile sourceSets.main.output,
sourceSets.test.output,
configurations.compile,
configurations.testCompile,
'cloud.localstack:localstack-utils:0.2.11'
}
task integrationTest(type: Test) {
description = 'Runs integration tests.'
group = 'verification'
testClassesDirs = sourceSets.intTest.output.classesDirs
classpath = sourceSets.intTest.runtimeClasspath
}
allprojects {
task resolveDependencies {
doLast {
configurations.all { it.isCanBeResolved() && it.resolve() }
}
}
}
task sourceJar(type: Jar) {
from sourceSets.main.allJava
}
tasks.withType(Test) {
testLogging {
events TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_ERROR
exceptionFormat TestExceptionFormat.FULL
showExceptions true
showCauses true
showStackTraces true
afterSuite { desc, result ->
if (!desc.parent) {
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
}
}
}
}
nexusPublishing {
useStaging = true
repositories {
sonatype {
// because we registered in Sonatype after 24 Feb 2021, we provide these URIs
// see: https://github.com/gradle-nexus/publish-plugin/blob/master/README.md
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_PASSWORD")
}
}
}
signing {
useInMemoryPgpKeys(
System.getenv("MAVEN_CENTRAL_SIGNING_KEY"),
System.getenv("MAVEN_CENTRAL_SIGNING_KEY_PASSWORD")
)
sign publishing.publications
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = 'Verify Event Emitter'
packaging = 'jar'
description = 'Library providing a Java Service to log Audit Events to a datastore'
url = 'https://github.com/alphagov/verify-event-emitter'
artifactId = 'verify-event-emitter'
scm {
url = 'https://github.com/alphagov/verify-event-emitter'
connection = 'scm:git:git://github.com/alphagov/verify-event-emitter.git'
developerConnection = 'scm:git:ssh://git@github.com:alphagov/verify-event-emitter.git'
}
licenses {
license {
name = 'MIT Licence'
url = 'https://github.com/alphagov/verify-event-emitter/blob/master/LICENCE'
distribution = 'repo'
}
}
developers {
developer {
name = 'GDS Developers'
}
}
} // pom
}
}
}