-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.gradle
More file actions
168 lines (147 loc) · 5.37 KB
/
build.gradle
File metadata and controls
168 lines (147 loc) · 5.37 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
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
/*
* 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 = "Clojars"
url = "https://repo.clojars.org/"
}
maven {
name = "JitPack"
url = 'https://jitpack.io'
}
}
task buildGitCommitFile {
doLast {
def commitId = grgit.head().id
// is there a variable for builddir/classes/java/main?
file("$buildDir/classes/java/main/us/kbase/assemblyhomology/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 tests into mongo wrapper tests & all other tests (incl. integration).
* Set up GHA to run the non-mongo tests with a single version of mongo and run the
* mongo tests with matrixed mongo versions. Combine coverage at the end somehow
*/
systemProperty "ASSEMHOMOL_TEST_CONFIG", "./test.cfg"
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
}
}
javadoc {
options {
// I don't know why this isn't working, but it's not worth spending time on right now
links "https://docs.oracle.com/javase/8/docs/api/"
}
}
war {
webXml = file('war/web.xml')
}
configurations {
// can't directly access testImplementation, so extend and access
testimpl.extendsFrom testImplementation
}
task generateCLIScript {
dependsOn compileJava
doLast {
def dependencies = configurations.runtimeClasspath.collect { File file ->
file.absolutePath
}
def classpath = dependencies.join(':')
def scriptContent = """#!/bin/sh
CLASSPATH=$classpath
java -cp build/classes/java/main:\$CLASSPATH us.kbase.assemblyhomology.cli.AssemblyHomologyCLI \$@
"""
file("$buildDir/assembly_homology").text = scriptContent
file("$buildDir/assembly_homology").setExecutable(true)
}
}
task buildAll {
dependsOn generateCLIScript
dependsOn war
dependsOn javadoc
}
dependencies {
implementation 'org.ini4j:ini4j:0.5.2'
implementation 'commons-io:commons-io:2.4'
implementation 'com.beust:jcommander:1.72'
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 'com.google.guava:guava:18.0'
implementation "com.github.kbase:auth2_client_java:0.5.0"
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.1 below
}
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 below
}
implementation 'com.github.zafarkhaja:java-semver:0.9.0'
implementation 'org.yaml:snakeyaml:1.18'
implementation 'ch.qos.logback:logback-classic:1.1.2'
implementation 'org.slf4j:slf4j-api:1.7.25'
// 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 'com.fasterxml.jackson.core:jackson-annotations:2.5.4'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.5.4'
implementation 'com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider: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 'javax.servlet:javax.servlet-api:3.0.1'
implementation 'javax.xml.bind:jaxb-api:2.4.0-b180830.0359'
testImplementation "com.github.kbase:auth2:0.7.1"
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.eclipse.jetty:jetty-servlet:9.3.11.v20160721') {
exclude group: "javax.servlet", module: "javax.servlet-api" // upgrading breaks tests
}
testImplementation 'org.mockito:mockito-core:3.0.0'
testImplementation 'org.apache.commons:commons-lang3:3.5'
testImplementation('com.github.kbase:java_test_utilities:0.1.0') {
exclude group: 'com.fasterxml.jackson.core' // upgrading breaks stuff
}
}
task showTestClassPath {
doLast {
configurations.testimpl.each { println it }
}
}