forked from opencadc/cadc-vosui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_jnlp.gradle
192 lines (160 loc) · 5.49 KB
/
_jnlp.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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'de.gliderpilot.gradle.jnlp:gradle-jnlp-plugin:+'
}
}
apply plugin: 'de.gliderpilot.jnlp'
apply plugin: 'war'
apply plugin: 'application'
repositories {
jcenter()
mavenLocal()
// Local repository for CADC private code
maven {
url = 'https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/m2repo'
}
}
dependencies {
// runtime 'org.codehaus.mojo.webstart:webstart-jnlp-servlet:1.0-6.0.02_ea_b02.2'
compile 'log4j:log4j:1.2.+'
compile 'org.freemarker:freemarker-gae:2.3.25-incubating'
compile 'com.opencsv:opencsv:3.+'
compile 'org.restlet.jee:org.restlet:2.3.+'
compile 'org.restlet.jee:org.restlet.ext.servlet:2.3.+'
compile 'org.restlet.jee:org.restlet.ext.freemarker:2.3.+'
compile 'org.restlet.jee:org.restlet.ext.json:2.3.+'
compile 'org.opencadc:cadc-util:1.+'
compile 'org.opencadc:cadc-registry:1.+'
compile 'org.opencadc:cadc-vosi:1.+'
compile 'org.opencadc:cadc-download-manager:1.+'
compile 'org.opencadc:cadc-download-manager-server:1.+'
compile 'org.opencadc:cadc-upload-manager:1.+'
compile 'org.opencadc:cadc-vos:1.+'
// Exclude the old restlet from being inserted here.
compile('org.opencadc:cadc-vos-server:1.+') {
exclude group: 'org.restlet.jee'
exclude group: 'org.restlet.jse'
}
compile 'org.opencadc:cadc-access-control:1.+'
compile 'org.opencadc:cadc-access-control-identity:1.+'
compile 'org.apache.commons:commons-configuration2:2.+'
compile 'javax.websocket:javax.websocket-api:1.+'
testCompile 'junit:junit:4.+'
testCompile 'org.easymock:easymock:3.+'
}
version = '100'
def docker_image_name = 'opencadc/storage'
war {
archiveName 'storage##' + project.version + '.war'
from createWebstartDir
}
clean {
doFirst {
exec {
executable 'rm'
args('-rf', './docker')
}
}
}
jnlp {
jnlpParams << [codebase: '$$codebase', spec: '1.0+',
href : 'launcher.jnlp']
j2seParams = [version: '7.0+', 'max-heap-size': '256m']
signJarAddedManifestEntries = [
'Permissions': 'all-permissions',
]
useVersions = false
usePack200 = false
mainClassName = '$$mainclass'
withXml {
information {
title project.name
vendor project.group ?: project.name
}
security {
'all-permissions'()
}
resources {
'property'('name': 'ca.nrc.cadc.auth.BasicX509TrustManager.trust',
'value': 'true')
'property'('name': 'ca.nrc.cadc.reg.client.RegistryClient.host',
'value': 'jenkinsd.cadc.dao.nrc.ca')
}
}
desc = {
'application-desc'('main-class': "${project.jnlp.mainClassName}") {
argument('--verbose')
argument('--uris=$$uris')
argument('--dest=$$destination')
argument('$$ssocookiearguments')
}
}
// Keystore settings in gradle.properties, or externally configured.
signJarParams = [keystore : keystorePath, alias: keystoreAlias,
storepass: keystorePassword]
}
def jnlpLib = ['cadc-download-manager', 'cadc-dali', 'cadc-util',
'cadc-registry', 'cadc-log', 'cadc-vos', 'log4j', 'jdom2',
'xerces', 'cadc-upload-manager', 'cadc-uws'];
generateJnlp << {
jnlpFile.with {
text = readLines('UTF-8').findAll {
(!it.contains('jnlp.versionEnabled') && !it.contains('jnlp.packEnabled'));
}.join('\n')
}
}
task initDockerize(type: Copy, dependsOn: build) {
from 'Dockerfile'
from 'src/main/resources/LocalAuthority.properties'
into 'docker/'
}
task copyWAR(type: Copy, dependsOn: war) {
from 'build/libs/'
into 'docker/'
include '*.war'
}
task dockerize(type: Exec, dependsOn: [initDockerize, copyWAR]) {
commandLine 'docker', 'build', '-t', docker_image_name, '-f', './docker/Dockerfile', './docker/'
}
mainClassName = 'ca.nrc.cadc.beacon.web.restlet.StorageApplication'
ext {
// Change this value to test other locations, such as Production or RC.
intTest_web_app_url = 'http://localhost:8080/'
}
sourceSets {
intTest
}
['firefox', 'chrome'].each { driver ->
task "intTest${driver.capitalize()}"(type: Test) { driverTest ->
testClassesDir = sourceSets.intTest.output.classesDir
classpath = sourceSets.intTest.runtimeClasspath
reports {
html.destination = reporting.file("$name/html")
}
dependencies {
intTestCompile 'junit:junit:4.+'
intTestCompile 'ca.nrc.cadc:web-test:1.+'
intTestCompile 'org.seleniumhq.selenium:selenium-java:3.+'
}
systemProperty "driver", "${driver}"
if (project.hasProperty('intTest_selenium_server_url')) {
systemProperty 'selenium.server.url', project.intTest_selenium_server_url
}
else {
systemProperty 'selenium.server.url', 'http://cadcint2.cadc.dao.nrc.ca:4444'
}
if (project.hasProperty('intTest_web_app_url')) {
systemProperty 'web.app.url', project.intTest_web_app_url
}
if (project.hasProperty('intTest_user_name')) {
systemProperty 'user.name', project.intTest_user_name
}
if (project.hasProperty('intTest_user_password')) {
systemProperty 'user.password', project.intTest_user_password
}
maxParallelForks = 3
}
}