-
Notifications
You must be signed in to change notification settings - Fork 8
/
build-for-snyk.gradle
210 lines (190 loc) · 8.83 KB
/
build-for-snyk.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
plugins {
id 'java'
id 'war'
id 'idea'
id 'project-report'
}
group 'org.opendap'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
jcenter()
maven {
url "https://repo.enonic.com/public"
}
}
sourceSets {
main {
java {
srcDirs = ['src_gradle']
}
}
}
ext {
junitVersion = '5.6.2'
}
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
//implementation group: 'junit', name: 'junit', version: '4.4'
implementation group: 'junit', name: 'junit', version: '4.13.1'
implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.6.1'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.3.1'
implementation group: 'commons-cli', name: 'commons-cli', version: '1.2'
//implementation group: 'commons-codec', name: 'commons-codec', version: '1.8'
implementation group: 'commons-codec', name: 'commons-codec', version: '1.13'
implementation group: 'commons-httpclient', name: 'commons-httpclient', version: '3.1'
//implementation group: 'commons-io', name: 'commons-io', version: '2.4'
implementation group: 'commons-io', name: 'commons-io', version: '2.7'
implementation group: 'commons-lang', name: 'commons-lang', version: '2.5'
implementation group: 'commons-logging', name: 'commons-logging', version: '1.1.3'
implementation group: 'org.owasp.encoder', name: 'encoder', version: '1.2.2'
implementation group: 'org.jvnet.ogc', name: 'gml-v_3_2_1', version: '2.6.1'
implementation group: 'org.jvnet.ogc', name: 'gmlcov-v_1_0', version: '2.6.1'
implementation group: 'org.jvnet.jaxb2_commons', name: 'jaxb2-basics-runtime', version: '0.11.0'
implementation group: 'org.jvnet.ogc', name: 'ows-v_2_0', version: '2.6.1'
implementation group: 'org.jvnet.ogc', name: 'sweCommon-v_2_0', version: '2.6.1'
implementation group: 'org.jvnet.ogc', name: 'wcs-v_2_0', version: '2.6.1'
implementation group: 'com.sun.xml.bind', name: 'jaxb-api', version: '2.3.1'
implementation group: 'com.sun.xml.bind', name: 'jaxb-core', version: '2.3.0-b170127.1453'
implementation group: 'com.sun.xml.bind', name: 'jaxb-impl', version: '2.3.0-b170127.1453'
// implementation group: 'ch.qos.logback', name: 'logback-classic', version: '0.9.26'
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.0'
// implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.3'
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.13'
implementation group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4.6'
implementation group: 'xerces', name: 'xercesImpl', version: '2.12.2'
implementation group: 'commons-io', name: 'commons-io', version: '1.2'
implementation group: 'org.jdom', name: 'jdom', version: '1.1.1'
implementation group: 'net.sf.saxon', name: 'saxon', version: '9.1.0.8'
implementation group: 'net.sf.saxon', name: 'saxon-jdom', version: '9.1.0.8'
implementation group: 'org.clojars.pjt', name: 'saxon9-s9api', version: '9.1.0.8'
// implementation group: 'ch.qos.logback', name: 'logback-core', version: '0.9.26'
implementation group: 'ch.qos.logback', name: 'logback-core', version: '1.1.11'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.3.1'
implementation group: 'org.tuckey', name: 'urlrewritefilter', version: '3.2.0'
implementation group: 'org.owasp.encoder', name: 'encoder-jsp', version: '1.2.2'
implementation group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1'
// implementation group: 'xalan', name: 'xalan', version: '2.7.1'
implementation group: 'xalan', name: 'xalan', version: '2.7.2'
// providedCompile group: 'org.apache.tomcat', name: 'catalina', version: '6.0.14'
providedCompile group: 'org.apache.tomcat', name: 'catalina', version: '6.0.53'
providedCompile group: 'javax.servlet', name: 'javax.servlet-api', version: '3.0.1'
providedCompile group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0'
// ---- NGAP libraries -----
//AmazonElastiCacheClusterClient-no-version.jar
implementation group: 'com.amazonaws', name: 'elasticache-java-cluster-client', version: '1.1.2'
//kryo-4.0.2.jar
implementation group: 'com.esotericsoftware', name: 'kryo', version: '4.0.2'
//kryo-serializers-0.46-SNAPSHOT.jar
implementation group: 'de.javakaffee', name: 'kryo-serializers', version: '0.45'
//memcached-session-manager-2.3.3-SNAPSHOT.jar
implementation group: 'de.javakaffee.msm', name: 'memcached-session-manager', version: '2.3.2'
//memcached-session-manager-tc7-2.3.3-SNAPSHOT.jar
compile group: 'de.javakaffee.msm', name: 'memcached-session-manager-tc7', version: '2.3.2'
//minlog-1.3.0.jar
implementation group: 'com.esotericsoftware', name: 'minlog', version: '1.3.0'
//msm-kryo-serializer-2.3.3-SNAPSHOT.jar
implementation group: 'de.javakaffee.msm', name: 'msm-kryo-serializer', version: '2.3.2'
//objenesis-3.2.jar
testImplementation group: 'org.objenesis', name: 'objenesis', version: '3.2'
//redisson-all-3.5.5.jar
implementation group: 'org.redisson', name: 'redisson-all', version: '3.11.6'
implementation group: 'com.esotericsoftware', name: 'reflectasm', version: '1.11.9'
}
// see https://docs.gradle.org/current/dsl/org.gradle.api.plugins.ExtraPropertiesExtension.html
project.ext {
resources_dir = "${projectDir}/resources"
// WebInf_resources_dir = "${project.resources_dir}/hyrax/WEB-INF"
// distribution_resources_dir = "${project.resources_dir}/distribution"
// Build Directories
build_dir = "${buildDir}"
build_classes = "${project.build_dir}/classes"
build_docs = "${project.build_dir}/docs"
build_dist = "${project.build_dir}/dist"
build_lib = "${project.build_dir}/lib"
build_run = "${project.build_dir}/run"
build_src = "${project.build_dir}/src"
build_resources = "${project.build_dir}/resources"
hyrax_resources_dir = "${project.resources_dir}/hyrax"
ngap_resources_dir = "${project.resources_dir}/ngap"
robots_resources_dir = "${project.resources_dir}/robots"
build_robots_resources = "${project.build_dir}/robots"
wcs_resources_dir = "${project.resources_dir}/WCS/2.0"
}
clean.doFirst {
delete "src_gradle"
}
task init_dir {
description "Create required folders in the build directory."
doLast {
mkdir "${project.build_dir}"
mkdir "${project.build_classes}"
// mkdir "${project.'build_docs'}"
// mkdir "${project.'build_run'}"
}
}
task copyResources(type: Copy) {
description "Copy from original resources."
from("resources/hyrax") {
include "**"
include "xsl/**"
include "WEB-INF/**"
exclude "WEB-INF/logback.xml"
exclude "WEB-INF/logback-test.xml"
}
from("./doc") {
exclude "src.distribution.readme"
into("docs")
}
from("resources/WCS/2.0") {
include "**"
include "xsl/**"
include "WEB-INF/**"
exclude "unused"
exclude "WEB-INF/web.xml"
exclude "WEB-INF/urlrewrite.xml"
exclude "WEB-INF/logback.xml"
exclude "WEB-INF/logback-test.xml"
}
into("src_gradle/main/webapp")
}
task copySources(type: Copy) {
description "Copy original source code."
from("src") {
// include all the java files
include "opendap/**"
include "org/opendap/**"
exclude "opendap/cmr/**"
// Exclude the experimental code
exclude "opendap/experiments/**"
// Exclude the Metacat code
exclude "opendap/metacat/**"
// Exclude WCS 1.1.2 and semantics code
exclude "opendap/wcs/v1_1_2/**"
exclude "opendap/semantics/**"
// Exclude prototype Amazon Web Services code from production
exclude "opendap/aws/**"
exclude "opendap/noaa_s3/**"
// Exclude async test code
exclude "opendap/async/**"
}
into("src_gradle/main/java")
}
task PreProcessSourceCode(dependsOn: ['clean', 'init_dir', 'copySources', 'copyResources']) {
description = "Moves selected source code from the development tree into the build/src directory. " +
"The code text is filtered to update version numbers."
}
war {
// Define war file name
archiveName("${DEPLOYMENT_CONTEXT}.war")
webAppDirName = "src_gradle/main/webapp"
destinationDirectory = file("$buildDir/dist")
//classpath = configurations.compileClasspath
}
task server(dependsOn: ['PreProcessSourceCode', 'build']){
description = "Performs a clean build of the core software and assembles the WAR file."
}
task getReports(dependsOn: ['htmlDependencyReport', 'propertyReport', 'taskReport', 'projectReport']) {
println("Reports:")
}