-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
235 lines (213 loc) · 8.18 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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
plugins {
// Apply the java-library plugin for API and implementation separation.
id 'org.springframework.boot' version '3.4.1'
id 'io.spring.dependency-management' version '1.1.7'
id 'java-library'
id 'maven-publish'
id 'java'
id 'com.adarshr.test-logger' version '4.0.0'
id 'jacoco'
id 'signing'
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
id "org.flywaydb.flyway" version "[9.+,10.0["
}
jacoco {
toolVersion = '0.8.10'
}
targetCompatibility = JavaVersion.VERSION_21
sourceCompatibility = JavaVersion.VERSION_21
group = "org.codeforamerica.platform"
version = "1.6.4-SNAPSHOT"
ext.admin = System.getenv("SONATYPE_USERNAME")
def localEnv = new Properties()
if (file(".env").isFile()) {
file(".env").withInputStream { localEnv.load(it) }
}
def sonatypeUsername = localEnv.getProperty("SONATYPE_USERNAME") ?: System.getenv("SONATYPE_USERNAME")
def sonatypePassword = localEnv.getProperty("SONATYPE_PASSWORD") ?: System.getenv("SONATYPE_PASSWORD")
jar {
doFirst {
fileTree(dir: "$buildDir/libs", include: '*.jar').each { file ->
if (!file.name.contains(version)) {
file.delete()
}
}
}
manifest {
attributes "Main-Class": "formflow.library.ScreenController"
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
bootJar {
enabled = false
}
task webjar(type: Jar, dependsOn: "jar") {
from(fileTree("dist")) {
into "META-INF/resources"
}
}
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
api 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.integration:spring-integration-ws:6.4.1'
implementation 'com.google.guava:guava:33.4.0-jre'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.jetbrains:annotations:26.0.1'
implementation 'io.hypersistence:hypersistence-utils-hibernate-63:3.9.0'
// implementation 'jakarta.persistence:jakarta.persistence-api:3.2.0'
implementation 'org.flywaydb:flyway-core:[9.+,10.+['
implementation 'org.webjars.npm:dropzone:5.9.3'
implementation 'com.amazonaws:aws-java-sdk-s3:1.12.364'
implementation 'com.smartystreets.api:smartystreets-java-sdk:3.18.3'
implementation 'com.github.librepdf:openpdf:2.0.3'
implementation 'org.yaml:snakeyaml:2.3'
implementation 'com.mailgun:mailgun-java:1.1.3'
implementation 'com.google.crypto.tink:tink:1.16.0'
implementation 'org.springframework.session:spring-session-jdbc'
implementation 'org.apache.tika:tika-core:3.0.0'
implementation 'commons-codec:commons-codec:1.17.2'
// For M1 issue?
//runtimeOnly 'io.netty:netty-resolver-dns-native-macos:4.1.97.Final:osx-aarch_64'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
// Use JUnit test framework.
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.4'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'org.jsoup:jsoup:1.18.3'
testImplementation 'org.mockito:mockito-inline:5.2.0'
// bonigarcia seems to need this version of client5, as of version 5.3.2.
// aws-java-sdk-s3 uses version httpclient:4.5.13, so if we see any differences in testing going forward
// we should take a look at this dependency and see if it's really testing things correctly and
// monitor the dependencies.
testImplementation 'io.github.bonigarcia:webdrivermanager:5.9.2'
testImplementation 'org.awaitility:awaitility'
testImplementation 'org.seleniumhq.selenium:selenium-java'
testImplementation 'org.postgresql:postgresql'
testImplementation 'org.projectlombok:lombok:1.18.36'
testImplementation 'com.squareup.okhttp3:mockwebserver:4.12.0'
testImplementation 'org.bouncycastle:bcpkix-jdk18on:1.80'
}
test {
finalizedBy jacocoTestReport
useJUnitPlatform()
}
jacocoTestReport {
reports {
xml.required = true
}
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
pluginMaven(MavenPublication) {
artifactId = "form-flow"
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = "Form Flow Builder"
description = "A Java library placed in a Spring Boot app to generate form flows."
url = "https://github.com/codeforamerica/form-flow/"
licenses {
license {
name = 'MIT License'
url = 'https://raw.githubusercontent.com/git/git-scm.com/main/MIT-LICENSE.txt'
}
}
developers {
developer {
id = 'cy-cfa'
name = 'Cypress Borg'
email = '[email protected]'
}
developer {
id = 'luigi'
name = 'Luigi Ray-Montañez'
email = '[email protected]'
}
developer {
id = 'birdprsn'
name = 'Alex Gonzalez'
email = '[email protected]'
}
developer {
id = 'cenyia'
name = 'Chibuisi Enyia'
email = '[email protected]'
}
developer {
id = 'rcastillo'
name = 'Rapi Castillo'
email = '[email protected]'
}
developer {
id = 'bethany'
name = 'Bethany Seeger'
email = '[email protected]'
}
developer {
id = 'vrajmohan'
name = 'Vraj Mohan'
email = '[email protected]'
}
developer {
id = 'marthapidcock'
name = 'Martha Pidcock'
email = '[email protected]'
}
}
scm {
url = 'scm:git:https://github.com/codeforamerica/form-flow.git'
}
}
}
}
}
signing {
required { admin }
def signingKey = System.getenv("GPG_SIGNING_KEY")
def signingPassword = System.getenv("GPG_SIGNING_PASSPHRASE")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications
}
nexusPublishing {
repositories {
sonatype {
if (version.endsWith("-SNAPSHOT")) {
println("Using a SNAPSHOT: ${version}")
} else {
println("Using a release version: ${version}")
}
nexusUrl = uri("https://oss.sonatype.org/service/local/")
snapshotRepositoryUrl = uri("https://oss.sonatype.org/content/repositories/snapshots")
username = sonatypeUsername
password = sonatypePassword
}
}
}
javadoc {
options.addStringOption('Xmaxwarns', '1000')
}