-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
77 lines (67 loc) · 2.08 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
plugins {
id 'war'
id "org.gradlewebtools.minify" version "1.3.1"
id "org.jlab.cat" version "1.1.0"
}
description = "Web Extensible Display Manager"
group 'org.jlab'
version new File("${projectDir}/VERSION").text.trim()
ext.releaseDate = new Date().format('MMM dd yyyy')
ext.productionRelease = 'true'
repositories {
mavenCentral()
}
tasks.withType(JavaCompile) {
options.release = 8
options.encoding = 'UTF-8'
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
dependencies {
implementation 'javax.servlet:jstl:1.2'
implementation 'org.glassfish:javax.json:1.1.4'
implementation 'javax.xml.bind:jaxb-api:2.3.1'
implementation 'org.glassfish.jaxb:jaxb-runtime:2.3.1'
providedCompile 'javax:javaee-api:7.0'
}
task combineCss(type: org.jlab.cat.CatTask) {
from("src/main/webapp/resources/widgets").include('**/*.css')
output = file("${buildDir}/combined-css/combined.css")
}
task combineJs(type: org.jlab.cat.CatTask) {
from("src/main/webapp/resources/widgets").include('**/*.js')
output = file("${buildDir}/combined-js/combined.js")
}
task cssMinifyIt(type: org.gradlewebtools.minify.CssMinifyTask) {
dependsOn(combineCss)
srcDir = project.file("build/combined-css")
dstDir = project.file("build/minified")
}
task jsMinifyIt(type: org.gradlewebtools.minify.JsMinifyTask) {
dependsOn(combineJs)
srcDir = project.file("build/combined-js")
dstDir = project.file("build/minified")
}
war {
dependsOn(cssMinifyIt)
dependsOn(jsMinifyIt)
archiveFileName = 'wedm.war'
filesMatching('WEB-INF/web.xml') {
filter {
String line -> line.replaceAll("@VERSION@", project.version)
}
filter {
String line -> line.replaceAll("@RELEASE_DATE@", releaseDate)
}
filter {
String line -> line.replaceAll("@PRODUCTION_RELEASE@", productionRelease)
}
}
from('build/minified') {
include '*.min.css'
into 'resources/css/'
}
from('build/minified') {
include '*.min.js'
into 'resources/js/'
}
}