-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
171 lines (142 loc) · 5.21 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
buildscript {
ext {
nexus_url = "${project.findProperty('nexus_url') ?: System.getenv('NEXUS_HOST')}"
nexus_user = "${project.findProperty('nexus_user') ?: System.getenv('NEXUS_USERNAME')}"
nexus_pw = "${project.findProperty('nexus_pw') ?: System.getenv('NEXUS_PASSWORD')}"
no_nexus = (project.findProperty('no_nexus') ?: System.getenv('NO_NEXUS') ?: false).toBoolean()
if (!no_nexus && (nexus_url == "null" || nexus_user == "null" || nexus_pw == "null")) {
throw new GradleException("property no_nexus='false' (or not defined) but at least one of the properties nexus_url, nexus_user or nexus_pw is not configured. Please configure those properties!")
}
def folderRel = (String)("${project.findProperty('nexus_folder_releases') ?: System.getenv('NEXUS_FOLDER_RELEASES')}")
nexusFolderReleases = folderRel == "null" ? "maven-releases" : folderRel
def folderSnaps = (String)("${project.findProperty('nexus_folder_snapshots') ?: System.getenv('NEXUS_FOLDER_SNAPSHOTS')}")
nexusFolderSnapshots = folderSnaps == "null" ? "maven-snapshots" : folderSnaps
snippetsDir = file('build/generated-snippets')
}
repositories {
if (no_nexus) {
println("using repository 'mavenCentral', because property no_nexus=$no_nexus")
mavenCentral()
} else {
println("using nexus repositories")
maven() {
url "${nexus_url}/repository/maven-public/"
credentials {
username = "${nexus_user}"
password = "${nexus_pw}"
}
}
maven() {
url "${nexus_url}/repository/atlassian_public/"
credentials {
username = "${nexus_user}"
password = "${nexus_pw}"
}
}
}
}
}
buildscript {
ext {
joobyVersion = "1.6.6"
}
dependencies {
classpath "org.jooby:jooby-gradle-plugin:$joobyVersion"
}
}
plugins {
id "com.github.johnrengelman.shadow"
id "com.google.osdetector" version "1.6.2"
id "io.spring.dependency-management" version "1.0.8.RELEASE"
}
apply plugin: "application"
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "groovy"
apply plugin: "jooby"
apply plugin: "jacoco"
repositories {
if (no_nexus) {
println("using repository 'mavenCentral', because property no_nexus=$no_nexus")
mavenCentral()
maven() {
url "https://plugins.gradle.org/m2/"
}
} else {
println("using nexus repositories")
maven() {
url "${nexus_url}/repository/maven-public/"
credentials {
username = "${nexus_user}"
password = "${nexus_pw}"
}
}
maven() {
url "${nexus_url}/repository/atlassian_public/"
credentials {
username = "${nexus_user}"
password = "${nexus_pw}"
}
}
maven() {
url "https://plugins.gradle.org/m2/"
}
}
}
group = 'org.ods'
version = '0.1'
mainClassName = "app.App"
sourceCompatibility = 1.8
dependencyManagement {
imports {
mavenBom "org.jooby:jooby-bom:$joobyVersion"
}
}
dependencies {
implementation "com.github.ben-manes.caffeine:caffeine:2.7.0"
implementation "com.github.jknack:handlebars:4.1.2"
implementation "commons-io:commons-io:2.11.0"
implementation "io.github.openfeign:feign-core:10.2.3"
implementation "io.github.openfeign:feign-gson:10.2.3"
implementation "io.github.openfeign:feign-okhttp:10.2.3"
implementation "net.lingala.zip4j:zip4j:1.3.3"
implementation "org.apache.httpcomponents:httpclient:4.5.8"
implementation "org.codehaus.groovy:groovy-all:2.5.7"
implementation "org.jooby:jooby-jackson"
implementation "org.jooby:jooby-netty"
implementation "io.netty:netty-transport-native-epoll:${dependencyManagement.importedProperties['netty.version']}:${osdetector.classifier.contains('linux') ? 'linux-x86_64' : ''}"
implementation "io.netty:netty-tcnative-boringssl-static:${dependencyManagement.importedProperties['boringssl.version']}"
implementation "org.apache.pdfbox:pdfbox:2.0.24"
testImplementation "junit:junit:4.12"
testImplementation "com.github.stefanbirkner:system-rules:1.19.0" // for managing environment variables
testImplementation "com.github.tomakehurst:wiremock:2.23.2" // for mocking HTTP server reponses
testImplementation "io.rest-assured:rest-assured:4.0.0" // for validating REST services
testImplementation "org.spockframework:spock-core:1.3-groovy-2.5"
testImplementation "cglib:cglib-nodep:3.3.0" // for mocking classes
testImplementation "org.objenesis:objenesis:3.1"
}
import com.github.jengelman.gradle.plugins.shadow.transformers.NewGroovyExtensionModuleTransformer
shadowJar {
mergeServiceFiles()
mergeGroovyExtensionModules()
transform(NewGroovyExtensionModuleTransformer)
}
test {
outputs.dir snippetsDir
// Use overrides in conf/application.test.conf in ConfigFactory.load()
// TODO: setting application.env should be enough, but apparently isn't
systemProperty "application.env", "test"
systemProperty "config.resource", "application.test.conf"
testLogging {
showStandardStreams = true
}
finalizedBy jacocoTestReport
}
jacocoTestReport {
reports {
xml.enabled true
}
}
/** We diverge from the default resources structure to adopt the Jooby standard: */
sourceSets.main.resources {
srcDirs = ["conf", "public"]
}