-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
196 lines (162 loc) · 7.43 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
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
// Ziggy Gradle Build File
//
// This file contains the declarative portion of the build only.
// Imperative tasks are found in script-plugins and are applied at the
// bottom of this file.
// To view a dependency graph using the taskinfo plugin, run "./gradlew tiTree build"
plugins {
id 'com.github.spotbugs' version '5.2.+'
id 'eclipse'
id 'jacoco'
id 'java'
id 'maven-publish'
id 'org.barfuin.gradle.taskinfo' version '2.1.+'
id 'signing'
}
defaultTasks 'assemble', 'publish', 'test'
ext {
// Location of third-party sources.
outsideDir = "$rootDir/outside"
// The dependency group used for libraries from outside is called "outside".
// This variable contains the directory that contains the libraries from
// outside. Without the dependency group and the outside subdirectory,
// consumers of the published module will get "null" errors.
outsideGroupDir = "$buildDir/libs/outside"
// Name of the outside group, used in publishing artifacts.
outsideGroup = "outside"
}
repositories {
mavenCentral()
flatDir {
dirs "$outsideDir/lib"
}
}
dependencies {
// Needed to compile ziggy.
implementation files("$rootDir/buildSrc/build/libs/buildSrc-${version}.jar")
implementation 'com.github.librepdf:openpdf:1.3.+'
implementation 'com.github.spotbugs:spotbugs-annotations:4.7.+'
implementation 'com.google.guava:guava:23.6.+'
implementation 'com.jgoodies:jgoodies-forms:1.9.+'
implementation 'com.jgoodies:jgoodies-looks:2.7.+'
implementation 'commons-cli:commons-cli:1.5.+'
implementation 'commons-codec:commons-codec:1.16.+'
implementation 'commons-io:commons-io:2.11.+'
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:3.0.+'
implementation 'org.apache.commons:commons-collections4:4.4'
implementation 'org.apache.commons:commons-compress:1.25.+'
implementation 'org.apache.commons:commons-configuration2:2.9.+'
implementation 'org.apache.commons:commons-csv:1.9.+'
implementation 'org.apache.commons:commons-exec:1.4.+'
implementation 'org.apache.commons:commons-lang3:3.12.+'
implementation 'org.apache.commons:commons-math3:3.6.+'
implementation 'org.apache.commons:commons-text:1.11.+'
implementation 'org.apache.logging.log4j:log4j-core:2.20.+'
implementation 'org.apache.logging.log4j:log4j-slf4j2-impl:2.20.+'
implementation 'org.hibernate.orm:hibernate-ant:6.2.+'
implementation 'org.hibernate:hibernate-core:6.2.+'
implementation 'org.javassist:javassist:3.29.2-GA'
implementation 'org.jfree:jfreechart:1.0.+'
implementation 'org.jsoup:jsoup:1.16.+'
implementation 'org.netbeans.api:org-netbeans-swing-outline:RELEASE121' // see note below
implementation 'org.slf4j:slf4j-api:2.0.+'
implementation 'org.tros:l2fprod-properties-editor:1.3.+'
// The NetBeans library started emitting the error,
// "No SVG loader available for ... columns.svg"
// at version 122 (through version 200). Hold version at 121 until
// this error is fixed or a workaround is discovered.
// Configuration2 declares the following as optional [1]. It's not, so it's added here.
// Occasionally, comment out this line--if the tests pass, delete it.
// 1. https://github.com/apache/commons-configuration/blob/master/pom.xml
implementation 'commons-beanutils:commons-beanutils:1.9.+'
// Libraries built outside.
implementation 'outside:jarhdf5:1.12.+'
implementation 'outside:wrapper:3.5.+'
// Needed to run unit tests and at runtime.
implementation 'org.hsqldb:hsqldb:2.7.+'
// Needed to compile unit tests.
testImplementation 'junit:junit:4.13.+'
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation 'org.mockito:mockito-core:3.12.+'
// Needed at runtime.
runtimeOnly 'org.hibernate.orm:hibernate-hikaricp:6.2.+'
runtimeOnly 'org.postgresql:postgresql:42.6.+'
// Astonishingly, for some reason configuration2 doesn't work when
// called by MATLAB, but configuration does. Ziggy doesn't use MATLAB
// in its build but provides MATLAB utilities that pipelines can call,
// so I think that makes this a runtime dependency for Ziggy.
runtimeOnly 'commons-configuration:commons-configuration:1.10'
// The following plugin reveals some bugs in our code, but until
// the "The following classes needed for analysis were missing" bug
// is fixed, it is commented out for daily use.
// spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.12.+'
annotationProcessor 'org.hibernate.orm:hibernate-jpamodelgen:6.2.+'
}
tasks.withType(JavaCompile) {
options.deprecation = true
}
// Add additional artifacts for publishing (see script-utils/publish.gradle).
java {
// This runs the javadoc task, which currently fails due to
// Javadoc errors. Enable after errors fixed, or ignored.
// withJavadocJar()
withSourcesJar()
}
// To view code coverage, run the jacocoTestReport task and view the output in:
// build/reports/jacoco/test/html/index.html.
check.dependsOn jacocoTestReport
jacocoTestReport {
// TODO Switch dependency to testAll to ensure that the integration tests are counted
// Depending on anything other than test results in this task
// getting SKIPPED, perhaps due to missing execution data. If code
// coverage of integration tests is desired, see comment in the test
// configuration.
// Switching to a recent version of JUnit 5+ was shown to work in one post
dependsOn test
// Since GUI code doesn't have unit tests, exclude it from the
// reports until the GUI code can be adequately unit tested. The
// main problem with leaving GUI code in the coverage report is
// that new GUI code can lower the total code coverage in
// violation of the coverage requirement in the SMP.
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: ['gov/nasa/ziggy/ui/*'])
}))
}
}
javadoc {
title = "Ziggy API"
options.overview = "src/main/java/overview.html"
options.addBooleanOption("Xdoclint:-missing", true)
}
check.dependsOn javadoc
// The SpotBugs plugin adds spotbugsMain and spotbugsTest to the check task.
spotbugs {
// The SMP requires that all high priority problems are addressed before testing can commence.
// Set reportLevel to 'low' to reveal a handful of interesting and potential bugs.
reportLevel = 'high'
}
tasks.withType(com.github.spotbugs.snom.SpotBugsTask) {
reports {
html.stylesheet = "fancy-hist.xsl"
}
}
// Outside build files should copy their jars to $outsideGroupDir and
// then make copyOutsideLibs depend on the task that performs that copy.
// This is used to publish the outside jars.
task copyOutsideLibs
compileJava.dependsOn copyOutsideLibs
// Apply Ziggy Gradle script plugins.
// A couple of the other scripts depend on integrationTest.
apply from: "script-plugins/test.gradle"
// Most scripts in alphabetical order.
apply from: "script-plugins/copy.gradle"
apply from: "script-plugins/database-schemas.gradle"
apply from: "script-plugins/eclipse.gradle"
apply from: "script-plugins/hdf5.gradle"
apply from: "script-plugins/misc.gradle"
apply from: "script-plugins/wrapper.gradle"
apply from: "script-plugins/xml-schemas.gradle"
apply from: "script-plugins/ziggy-libraries.gradle"
// Depends on versions set in hdf5.gradle and wrapper.gradle and copyBuildSrc from copy.gradle.
apply from: "script-plugins/publish.gradle"