-
Notifications
You must be signed in to change notification settings - Fork 34
/
build.gradle
208 lines (159 loc) · 5.62 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
197
198
199
200
201
202
203
204
205
206
207
208
//file:noinspection SpellCheckingInspection
//file:noinspection GroovyAssignabilityCheck
buildscript { // for "com.github.ben-manes.versions" plugin
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.github.ben-manes:gradle-versions-plugin:0.51.0"
}
}
plugins {
id 'java'
id 'groovy'
}
apply plugin: "com.github.ben-manes.versions" // ./gradlew dependencyUpdates
group = 'cz.siret'
version = '2.5.1-dev.1'
description = 'Ligand binding site prediction based on machine learning.'
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
def distroDir = "$projectDir/distro"
repositories {
mavenCentral()
mavenLocal()
maven {url "https://repository.jboss.org/nexus/content/repositories/thirdparty-releases/" }
maven {
url = file('lib/local-mvn-repo')
}
flatDir(dirs: 'lib')
}
sourceSets {
main {
resources {
exclude 'scripts/out/*'
exclude 'models/*'
}
}
}
processResources {
filter org.apache.tools.ant.filters.ReplaceTokens, tokens: [
"project_version": project.version
]
}
tasks.register('copyDependenciesToDist', Copy) {
from configurations.runtimeClasspath
into "$distroDir/bin/lib"
}
tasks.register('copyBinaryToDist', Copy) {
dependsOn jar
from "$projectDir/build/bin"
into "$distroDir/bin"
include "*.jar"
}
tasks.register('copyDocumentation', Copy) {
from "$distroDir/../"
into "$distroDir"
include "README.md", "LICENSE.txt"
}
assemble {
dependsOn processResources
dependsOn copyBinaryToDist
dependsOn copyDependenciesToDist // copy dependencies to distro dir
dependsOn copyDocumentation
}
jar {
archiveFileName = "p2rank.jar"
destinationDirectory = file("build/bin")
manifest {
attributes 'Main-Class': 'cz.siret.prank.program.Main'
}
}
clean {
delete "$distroDir/bin"
delete "$distroDir/test_output"
}
test {
useJUnitPlatform()
// show standard out and standard error of the test JVM(s) on the console
// testLogging.showStandardStreams = true
// set heap size for the test JVM(s)
maxHeapSize = "2g"
inputs.dir "$distroDir/test_data"
inputs.files("$distroDir/models", "$distroDir/config/default.groovy")
// listen to events in the test execution lifecycle
beforeTest { descriptor ->
logger.lifecycle("Running test: " + descriptor)
}
testLogging {
events "failed" // "standardOut", "standardError", "passed", "skipped"
showExceptions true
exceptionFormat "full"
showCauses true
showStackTraces true
showStandardStreams = false
}
// listen to standard out and standard error of the test JVM(s)
// onOutput { descriptor, event ->
// logger.lifecycle("Test: " + descriptor + " produced standard out/err: " + event.message )
// }
}
configurations {
runtimeClasspath.extendsFrom implementation
}
/**
* Returns an int representing how mature [version] is.
* Higher numbers are more mature.
*/
static def maturityLevel(String version) {
/**
* Version qualifiers, in order from least to most mature.
* The most mature is to have no qualifier at all.
*/
def qualifiers = ["preview", "alpha", "beta", "m", "cr", "rc"]
def qualifiersRegex = qualifiers.collect { /(?i).*[.\-]$it[.\-\d]*/ }
def index = qualifiersRegex.findIndexOf { version ==~ it }
return (index < 0) ? qualifiers.size() : index
}
tasks.named("dependencyUpdates").configure {
rejectVersionIf {
def candidateMaturity = maturityLevel(it.candidate.version)
def currentMaturity = maturityLevel(it.currentVersion)
candidateMaturity < currentMaturity
}
}
dependencies {
implementation 'org.apache.groovy:groovy:4.0.24'
implementation 'org.codehaus.gpars:gpars:1.2.1'
implementation 'org.apache.commons:commons-lang3:3.17.0'
implementation 'org.apache.commons:commons-math3:3.6.1'
implementation 'commons-io:commons-io:2.17.0'
implementation 'com.google.guava:guava:33.3.1-jre'
implementation 'com.google.code.gson:gson:2.11.0'
implementation 'com.univocity:univocity-parsers:2.9.1' // csv parser
implementation 'org.apache.commons:commons-csv:1.12.0'
implementation 'org.zeroturnaround:zt-zip:1.17'
implementation 'org.apache.commons:commons-compress:1.27.1'
implementation 'org.tukaani:xz:1.10'
implementation 'com.github.luben:zstd-jni:1.5.6-7'
implementation 'com.github.dpaukov:combinatoricslib3:3.4.0'
implementation 'us.ihmc:euclid:0.22.2'
implementation 'org.slf4j:slf4j-api:2.0.16'
implementation 'org.slf4j:jul-to-slf4j:2.0.16' // for netlib logging messages
implementation 'org.apache.logging.log4j:log4j-core:2.24.0' // 2.24.1 causes messy output at startup
implementation 'org.apache.logging.log4j:log4j-slf4j2-impl:2.24.0'
implementation 'org.biojava:biojava-core:7.1.3'
implementation 'org.biojava:biojava-alignment:7.1.3'
implementation 'org.biojava:biojava-structure:7.1.3'
implementation 'org.openscience.cdk:cdk-qsarmolecular:2.9' // for NumericalSurface class
implementation 'org.openscience.cdk:cdk-silent:2.9' // for Atom class
implementation 'cz.cuni.cusbg:faster-molecular-surface:1.0'
implementation 'nz.ac.waikato.cms.weka:weka-dev:3.9.6'
implementation fileTree(dir: 'lib', include: '*.jar')
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.11.3'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.11.3'
}