-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle
142 lines (121 loc) · 3.95 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
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
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id 'war'
id "com.github.node-gradle.node" version "3.0.1"
// Use version 6.13.0 until JDK 1.8 is no longer required.
id 'com.diffplug.spotless' version '6.13.0'
// IntelliJ IDEA plugin here to allow integration tests to appear properly in IDEs.
id 'idea'
id 'jacoco'
id 'org.jetbrains.dokka' version '1.6.0'
}
node {
version = '22.11.0'
}
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
implementation 'com.opencsv:opencsv:[5.1,6.0)'
implementation 'commons-net:commons-net:3.9.0'
implementation 'org.apache.commons:commons-configuration2:[2.11.0,3.0.0)'
implementation 'org.opencadc:cadc-access-control-identity:[1.1.0,)'
implementation 'org.opencadc:cadc-gms:[1.0.12,2.0)'
implementation 'org.opencadc:cadc-log:[1.1.5,)'
implementation 'org.opencadc:cadc-rest:[1.3.9,)'
implementation 'org.opencadc:cadc-util:[1.6,)'
implementation 'org.opencadc:cadc-web-token:[1.1.1,2.0.0)'
runtimeOnly 'commons-io:commons-io:[2.17.0,3.0.0)'
runtimeOnly 'javax.servlet.jsp.jstl:jstl-api:1.2'
runtimeOnly 'javax.servlet:jstl:1.2'
runtimeOnly 'jstl:jstl:[1.0,)'
runtimeOnly 'org.apache.taglibs:taglibs-standard-impl:1.2.5'
testImplementation 'junit:junit:[4.12,5.0)'
testImplementation 'org.mockito:mockito-core:[4.11.0,5.0.0)'
}
sourceCompatibility = '1.8'
war {
// Trying to fix static file caching on new build.
eachFile {
if (it.name.endsWith('.jsp')) {
filter(ReplaceTokens, tokens: [version: project.version])
}
}
archiveFileName = 'science-portal.war'
}
tasks.register('buildReactApp', NodeTask) {
dependsOn 'npmInstall'
script = project.file('node_modules/webpack/bin/webpack.js')
args = [
'--mode', 'development',
'--entry', './src/index.js',
'-o', './src/main/webapp/dist'
]
}
// Copy js and json files from dev working area to distribution assembly folder
tasks.register('copyDevToDist', Copy) {
from layout.projectDirectory.file("public/dev")
into layout.projectDirectory.file("src/main/webapp/dist")
}
processResources.dependsOn 'buildReactApp'
assemble.dependsOn 'copyDevToDist'
clean.delete << file('src/main/webapp/dist')
spotless {
// optional: limit format enforcement to just the files changed by this feature branch
// optional: Disabled - does not work with JDK 1.8
// ratchetFrom 'origin/main'
java {
// Use the default importOrder configuration
importOrder()
// Remove unused imports
removeUnusedImports()
// Google Java Format, Android Open Source Project style which uses 4 spaces for indentation
palantirJavaFormat()
// Format annotations on a single line
formatAnnotations()
}
format 'misc', {
target '*.gradle'
trimTrailingWhitespace()
indentWithSpaces(4)
endWithNewline()
}
}
check.dependsOn spotlessCheck
// Create Java Code Coverage Reports
jacocoTestReport {
reports {
xml.enabled true
html.enabled true
}
}
check.dependsOn jacocoTestReport
// Create JavaDoc
javadoc {
destinationDir = file("${buildDir}/docs/javadoc")
}
// Create Java Documentation using Dokka for Github Markdown and HTML
tasks.dokkaGfm.configure {
outputDirectory.set(file("${buildDir}/docs/dokka/gfm"))
dokkaSourceSets {
register("main") {
sourceRoots.from(file("src/main/java"))
}
}
}
tasks.dokkaHtml.configure {
outputDirectory.set(file("${buildDir}/docs/dokka/html"))
dokkaSourceSets {
register("main") {
sourceRoots.from(file("src/main/java"))
}
configureEach {
jdkVersion.set(11)
sourceLink {
localDirectory.set(file("src/main/java"))
remoteUrl.set("https://github.com/opencadc/science-portal/tree/main/src/main/java")
}
}
}
}