forked from etf-validator/etf-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
254 lines (205 loc) · 9.78 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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
///////////////////////////////////////////////////////////////////////////////////////
//
// ETF-WebApp
//
///////////////////////////////////////////////////////////////////////////////////////
buildscript {
repositories {
maven {
url "http://services.interactive-instruments.de/etfdev-af/plugins-releases-local"
credentials {
username 'ii-bda'
password '6ozhS683'
}}
maven {
url "https://plugins.gradle.org/m2/"
}
mavenCentral()
}
dependencies {
classpath group: 'de.interactive_instruments.bda', name: 'etf-bda', version:'1.0.24'
classpath "org.codehaus.groovy.modules.http-builder:http-builder:0.7.1"
classpath "org.springframework.boot:spring-boot-gradle-plugin:1.4.2.RELEASE"
classpath 'org.springframework:springloaded:1.2.6.RELEASE'
}
dependencies {
ant.unjar src: configurations.classpath.files.find {it.path.contains('etf')}, dest: 'build/gradle'
}
}
apply from: 'build/gradle/ii-bda.gradle'
///////////////////////////////////////////////////////////////////////////////////////
group = 'de.interactive_instruments.etf'
description = 'ETF Presentation and Controller Layer'
apply plugin: 'war'
apply from: 'jetty.gradle'
// apply from: 'gretty.gradle'
import groovy.json.JsonSlurper
apply plugin: 'idea'
ext.springSecurityVersion = "4.0.4.RELEASE"
ext.springSecurityOAuth2Version = "2.0.9.RELEASE"
ext.springVersion = "4.3.7.RELEASE"
ext.jacksonVersion = "2.7.9"
ext.springfoxSwaggerVersion = "2.6.1"
configurations {
compile.exclude group:'xalan'
testdriver
}
repositories {
maven {
url "http://files.basex.org/maven"
}
maven {
url "https://services.interactive-instruments.de/etfdev-af/ext-deegree-cache"
credentials {
username gradle.rootProject.ext.r_user
password gradle.rootProject.ext.r_pwd
}
}
}
// http://docs.spring.io/spring-boot/docs/current/reference/html/howto-hotswapping.html
idea {
module {
inheritOutputDirs = false
outputDir = file("$buildDir/classes/main/")
}
}
dependencies {
compile group: 'net.sf.saxon', name: 'Saxon-HE', version: '9.7.0-4'
compile group: 'de.interactive_instruments', name: 'ii-commons-util', version: '2.0.0' + project.snapshotSuffix
compile group: 'de.interactive_instruments.etf', name: 'etf-core', version: '1.0.0' + project.snapshotSuffix
compile group: 'de.interactive_instruments.etf', name: 'etf-spi', version: '1.0.0' + project.snapshotSuffix
// TODO remove in future versions, use SPI
compile group: 'de.interactive_instruments.etf', name: 'etf-bsxds', version: '2.0.0' + project.snapshotSuffix
compile group: 'de.interactive_instruments.etf', name: 'etf-rc', version: '1.0.0' + project.snapshotSuffix
// Prepackaged test drivers
// TODO download in future versions
testdriver group: 'de.interactive_instruments.etf.testdriver', name: 'etf-suitd', version: '2.0.0' + project.snapshotSuffix
testdriver group: 'de.interactive_instruments.etf.testdriver', name: 'etf-bsxtd', version: '2.0.0' + project.snapshotSuffix
// Bean validation
compile group: 'org.hibernate', name: 'hibernate-validator', version: '5.0.1.Final'
compile("xerces:xercesImpl:"+etf_xercesVersion){
force = true
}
compile("xml-apis:xml-apis:"+etf_xmlApisVersion){
force = true
}
compile group: 'commons-logging', name: 'commons-logging', version:'1.1.1'
compile group: 'commons-codec', name: 'commons-codec', version: etf_commonsCodecVersion
compile group: 'commons-fileupload', name: 'commons-fileupload', version:'1.3.1'
compile group: 'commons-io', name: 'commons-io', version: etf_commonsIoVersion
compile group: 'commons-lang', name: 'commons-lang', version:'2.6'
// switched from 2.4.6
compile 'org.codehaus.groovy:groovy-all:2.4.7'
compile group: 'org.jsoup', name: 'jsoup', version: '1.9.1'
compile group: 'org.slf4j', name: 'slf4j-api', version: etf_slf4jApiVersion
// Conditional logback config file processing
compile group: 'org.codehaus.janino', name: 'janino', version: '2.7.8'
compile group: 'ch.qos.logback', name: 'logback-classic', version: etf_logbackVersion
// Spring dependencies
//////////////////////////////////
// JSON
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: jacksonVersion
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: jacksonVersion
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: jacksonVersion
compile(group: 'org.springframework', name: 'spring-webmvc', version: springVersion ) {
exclude(module: 'commons-logging')
}
// Include nekohtml for thymeleaf
compile('net.sourceforge.nekohtml:nekohtml:1.9.22') {
exclude group: 'xerces', module: 'xercesImpl'
}
compile "org.springframework.security:spring-security-config:$springSecurityVersion",
"org.springframework.security:spring-security-web:$springSecurityVersion",
"org.springframework.security.oauth:spring-security-oauth2:$springSecurityOAuth2Version",
"javax.servlet:jstl:1.2",
"javax.validation:validation-api:1.1.0.Final",
"org.thymeleaf:thymeleaf-spring4:2.1.4.RELEASE",
"org.thymeleaf.extras:thymeleaf-extras-springsecurity4:2.1.2.RELEASE",
"org.thymeleaf.extras:thymeleaf-extras-conditionalcomments:2.1.1.RELEASE"
compile("org.thymeleaf.extras:thymeleaf-extras-tiles2-spring4:2.1.1.RELEASE") {
exclude group: "org.slf4j", module: "jcl-over-slf4j"
}
providedCompile group: 'javax.servlet', name: 'javax.servlet-api', version:'3.1.0'
providedCompile group: 'javax.servlet.jsp', name: 'jsp-api', version:'2.2'
compile group: 'javax.servlet', name: 'jstl', version:'1.2'
compile group: 'joda-time', name: 'joda-time', version:'2.9.3'
runtime group: 'joda-time', name: 'joda-time-jsptags', version:'1.1.1'
// Testing
testCompile group: 'junit', name: 'junit', version: etf_junitTestVersion
testCompile group: 'de.interactive_instruments.etf.test', name: 'etf-unittest', version:'1.0.0'+project.snapshotSuffix
testCompile group: 'org.springframework', name: 'spring-test', version: springVersion
testCompile group: 'org.easymock', name: 'easymock', version:'3.1'
testCompile group: 'org.seleniumhq.selenium', name: 'selenium-java', version:'2.46.0'
testCompile group: 'org.seleniumhq.selenium', name: 'selenium-firefox-driver', version:'2.46.0'
testCompile group: 'org.seleniumhq.selenium', name: 'selenium-chrome-driver', version:'2.46.0'
testCompile group: 'org.seleniumhq.selenium', name: 'selenium-htmlunit-driver', version:'2.46.0'
// API
compile group: 'io.springfox', name: 'springfox-swagger-ui', version: springfoxSwaggerVersion
compile group: 'io.springfox', name: 'springfox-swagger2', version: springfoxSwaggerVersion
// compile group: 'io.springfox', name: 'springfox-staticdocs', version: '2.4.0'
}
clean << {
delete fileTree(dir: 'src/main/webapp/WEB-INF/etf/ds/db/', include: '.basex')
delete fileTree(dir: 'src/main/webapp/WEB-INF/etf/ds/db/data' )
delete fileTree(dir: 'src/main/webapp/WEB-INF/e1tf/ds/obj' , include: '**/*')
delete fileTree(dir: 'src/main/webapp/WEB-INF/etf/testdata' , include: '**/*')
}
def findRuntimeJar(prefix) {
configurations.runtime.filter { it.name.startsWith(prefix) }
}
def normalizeJQPath(def path) {
// META-INF\resources\webjars\jquery-mobile\1.4.5\*.* -> *.*
def modified=path.replaceAll('META-INF/resources/webjars/[^/]*/[^/]*/(.*)', {"${it[1]}"})
return modified
}
// war.dependsOn(generateRebel)
war {
doFirst {
manifest {
attributes(
'Implementation-Title': project.name,
'Implementation-Vendor': 'interactive instruments GmbH',
'Implementation-Vendor-Id': 'de.interactive_instruments',
'Implementation-Version': project.version,
'Built-By': System.getProperty('user.name'),
'Build-Host': java.net.InetAddress.getLocalHost().getHostName(),
'Build-JDK': System.getProperty('java.version'),
'Build-Time': new Date().format("yyyyMMdd'T'HHmm"),
'Source-Compatibility': project.sourceCompatibility,
'Target-Compatibility': project.targetCompatibility
)
}
archiveName 'etf-webapp.war'
}
from(configurations.testdriver) {
include 'etf-*td*.jar'
into('testdrivers')
}
}
if(project.hasProperty("opbeat.organizationId")) {
task opbeatRelease() << {
final String reqPath = "/api/v1/organizations/"+
project.getProperty("opbeat.organizationId")+
"/apps/"+
project.getProperty("opbeat.appId")+"/releases/"
def releaseData = [
'rev':repo.head().abbreviatedId,
'branch':'master',
'status':'completed']
def reqHeaders = [
'User-Agent': 'gradle-notify',
'Authorization':"Bearer "+ project.getProperty("opbeat.api_key")]
def http = new groovyx.net.http.HTTPBuilder("https://intake.opbeat.com");
http.request( groovyx.net.http.Method.POST, groovyx.net.http.ContentType.JSON ) {
uri.path = reqPath
headers = reqHeaders
body = releaseData
response.failure = { resp, reader -> System.out << reader }
response.success = { println "Notified Opbeat" }
}
}
if (tasks.findByPath('uploadArchives') != null) {
opbeatRelease.shouldRunAfter uploadArchives
afterReleaseBuild.dependsOn opbeatRelease
}
}