-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
155 lines (139 loc) · 5.1 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
/*
* This file was generated by the Gradle 'init' task.
*/
plugins {
id 'java'
id 'war'
id 'jacoco'
id 'org.ajoberstar.grgit' version '4.1.1'
}
repositories {
mavenCentral()
maven {
name = "Jitpack"
url = 'https://jitpack.io'
}
maven {
name = "Clojars"
url = "https://repo.clojars.org/"
}
}
task buildGitCommitFile {
doLast {
def commitId = grgit.head().id
// is there a variable for builddir/classes/java/main?
file("$buildDir/classes/java/main/us/kbase/groups/gitcommit").text = commitId
}
}
compileJava {
// TODO BUILD remove when we no longer support java 8, use `options.release = 11` if needed
java.sourceCompatibility = JavaVersion.VERSION_1_8
java.targetCompatibility = JavaVersion.VERSION_1_8
finalizedBy buildGitCommitFile
}
test {
/*
* TODO TEST Figure out why tests fail without this and remove. Might have something to do
* with the stfuLoggers() call in many of the tests, might kill logging for tests that
* require it
* Although it seems to make Mongo start up correctly as well which is odd
*/
forkEvery = 1
/*
* TODO TEST split mongo wrapper tests out.
* Set up GHA to run the full test suite with a single version of mongo and run the
* mongo tests with matrixed mongo versions.
* Since the tests only take a minute or two this isn't high ROI.
*/
systemProperty "KBASE_GROUPS_TEST_CONFIG", "./test.cfg"
maxHeapSize = "3G"
testLogging {
exceptionFormat = 'full'
showStandardStreams = true
}
finalizedBy jacocoTestReport
}
// TODO TEST add a test that starts the server in a docker container and checks some simple cmds
jacocoTestReport {
reports {
xml.required = true
csv.required = true
}
}
war {
webXml = file('war/web.xml')
}
configurations {
// can't directly access testImplementation, so extend and access
testimpl.extendsFrom testImplementation
}
def fromURL = { url, name ->
File file = new File("$buildDir/download/${name}.jar")
file.parentFile.mkdirs()
if (!file.exists()) {
new URL(url).withInputStream { downloadStream ->
file.withOutputStream { fileOut ->
fileOut << downloadStream
}
}
}
files(file.absolutePath)
}
dependencies {
compileOnly 'javax.servlet:javax.servlet-api:3.0.1'
implementation fromURL(
'https://github.com/kbase/jars/raw/master/lib/jars/kbase/catalog/kbase-catalog-client-2.1.3.jar',
'kbase-catalog-client-2.1.3'
)
// TODO DEPS Need to rework the java common logger to not use syslog4j at all since it's
// abandonware and has a ton of CVEs, even in the newer versions.
implementation "org.syslog4j:syslog4j:0.9.46"
implementation 'ch.qos.logback:logback-classic:1.1.2'
implementation("com.github.kbase:auth2_client_java:0.5.0") {
exclude group: 'com.fasterxml.jackson.core' // breaks everything if we upgrade
}
implementation("com.github.kbase:java_common:0.3.0") {
exclude group: 'net.java.dev.jna' // breaks mac builds, not needed
exclude group: 'org.eclipse.jetty.aggregate' // ugh, java common pollutes everything
exclude group: 'com.fasterxml.jackson.core' // breaks everything if we upgrade
exclude group: 'javax.servlet', module: 'servlet-api' // 2.5 vs 3.0.1 above
}
implementation('com.github.kbase.workspace_deluxe:workspace-client:0.15.0') {
exclude group: 'net.java.dev.jna' // breaks mac builds, not needed
exclude group: 'org.eclipse.jetty.aggregate' // ugh, java common pollutes everything
exclude group: 'com.fasterxml.jackson.core' // breaks everything if we upgrade
exclude group: 'javax.servlet', module: 'servlet-api' // 2.5 vs 3.0.1 above
}
implementation 'org.ini4j:ini4j:0.5.2'
implementation 'org.mongodb:mongodb-driver-core:4.11.1'
implementation 'org.mongodb:mongodb-driver-sync:4.11.1'
implementation 'org.mongodb:bson-record-codec:4.11.1'
implementation 'org.mongodb:bson:4.11.1'
implementation 'org.apache.kafka:kafka-clients:2.1.0'
implementation 'com.google.guava:guava:18.0'
implementation 'org.slf4j:slf4j-api:1.7.25'
implementation 'com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.5.4'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.5.4'
implementation 'org.glassfish.jersey.containers:jersey-container-servlet:2.23.2'
implementation 'org.glassfish.jersey.media:jersey-media-json-jackson:2.23.2'
implementation 'com.github.zafarkhaja:java-semver:0.9.0'
testImplementation "com.github.kbase:auth2:0.7.1"
testImplementation('com.github.kbase:java_test_utilities:0.1.0') {
exclude group: 'com.fasterxml.jackson.core' // breaks everything if we upgrade
}
testImplementation 'com.github.kbase.workspace_deluxe:workspace_deluxe-test-shadow-all:0.15.0'
testImplementation 'nl.jqno.equalsverifier:equalsverifier:3.1.10'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:3.0.0'
testImplementation('org.mock-server:mockserver-netty:5.4.1') {
// otherwise a newer jackson implementation is brought in and tests make a poo poo
// TODO BUILD on upgrade switch to the no dependencies version
exclude group: "com.fasterxml.jackson.core"
}
testImplementation 'org.eclipse.jetty:jetty-servlet:9.3.11.v20160721'
}
task showTestClassPath {
doLast {
configurations.testimpl.each { println it }
}
}