-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
105 lines (88 loc) · 2.57 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
plugins {
id 'war'
id ("org.gradlewebtools.minify") version "1.3.0"
}
description = "EPICS to web gateway"
group 'org.jlab'
version new File("${projectDir}/VERSION").text.trim()
ext.releaseDate = new Date().format('MMM dd yyyy')
ext.productionRelease = 'true'
compileJava {
options.release = 8
}
compileTestJava {
options.release = 11
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
repositories {
mavenCentral()
}
sourceSets {
integration {
java.srcDir "${projectDir}/src/integration/java"
resources.srcDir "${projectDir}/src/integration/resources"
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
}
}
configurations {
integrationImplementation.extendsFrom testImplementation
integrationRuntimeOnly.extendsFrom runtimeOnly
}
dependencies {
implementation 'javax.servlet:jstl:1.2',
'org.glassfish:javax.json:1.1.4',
files('lib/jca-2.4.6.jar')
//implementation 'org.epics:jca:2.4.6' // Only works with Java 11 runtime
providedCompile 'javax:javaee-api:7.0'
testImplementation 'junit:junit:4.13.2'
}
task integrationTest(type: Test) {
description = 'Runs integration tests.'
group = 'verification'
testClassesDirs = sourceSets.integration.output.classesDirs
classpath = sourceSets.integration.runtimeClasspath
testLogging {
events "passed", "skipped", "failed"
exceptionFormat "full"
showStandardStreams = true
}
}
processIntegrationResources {
duplicatesStrategy 'include'
}
task cssMinifyIt(type: org.gradlewebtools.minify.CssMinifyTask) {
srcDir = project.file("src/main/webapp/resources/css")
dstDir = project.file("build")
}
task jsMinifyIt(type: org.gradlewebtools.minify.JsMinifyTask) {
srcDir = project.file("src/main/webapp/resources/js")
dstDir = project.file("build")
}
war {
dependsOn(cssMinifyIt)
dependsOn(jsMinifyIt)
archiveFileName = 'epics2web.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') {
include '*.min.css'
into 'resources/css/'
}
from('build') {
include '*.min.js'
into 'resources/js/'
}
}