-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild.gradle
More file actions
122 lines (104 loc) · 3.03 KB
/
build.gradle
File metadata and controls
122 lines (104 loc) · 3.03 KB
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
plugins {
id 'war'
id 'org.gradlewebtools.minify' version '2.1.1'
id 'com.diffplug.spotless' version '7.2.1'
}
description = "EPICS to web gateway"
group = 'org.jlab'
version = new File("${projectDir}/VERSION").text.trim()
ext.version = project.version
ext.releaseDate = new Date().format('MMM dd yyyy')
ext.productionRelease = 'true'
compileJava {
options.release = 21
}
compileTestJava {
options.release = 21
}
tasks.withType(JavaCompile).configureEach {
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 'jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api:3.0.0',
'org.glassfish.web:jakarta.servlet.jsp.jstl:3.0.0',
'org.glassfish:jakarta.json:2.0.1',
'org.epics:jca:2.4.10'
providedCompile 'jakarta.servlet:jakarta.servlet-api:6.1.0',
'jakarta.websocket:jakarta.websocket-api:2.2.0',
'jakarta.websocket:jakarta.websocket-client-api:2.2.0'
testImplementation 'junit:junit:4.13.2'
}
tasks.register('integrationTest', 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'
}
tasks.register('cssMinifyIt', org.gradlewebtools.minify.CssMinifyTask) {
srcDir = project.file("src/main/webapp/resources/css")
dstDir = project.file("build")
}
tasks.register('jsMinifyIt', org.gradlewebtools.minify.JsMinifyTask) {
srcDir = project.file("src/main/webapp/resources/js")
dstDir = project.file("build")
}
test {
dependsOn(cssMinifyIt)
dependsOn(jsMinifyIt)
}
tasks.named('jar') {
enabled = false
}
war {
dependsOn(cssMinifyIt)
dependsOn(jsMinifyIt)
archiveFileName = 'epics2web.war'
filesMatching('WEB-INF/web.xml') {
filter {
String line -> line.replaceAll("@VERSION@", 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/'
}
}
spotless {
java {
googleJavaFormat()
}
}