/
build.gradle
201 lines (157 loc) · 5.54 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
//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"
}
}
apply plugin: "com.github.ben-manes.versions" // ./gradlew dependencyUpdates
apply plugin: 'groovy'
apply plugin: 'java'
group = 'cz.siret'
version = '2.4.2-beta.1'
description = 'Ligand binding site prediction based on machine learning.'
allprojects {
apply plugin: 'java'
sourceCompatibility = 11
targetCompatibility = 11
}
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
]
}
task copyDependenciesToDist( type: Copy ) {
into "$buildDir/../distro/bin/lib"
from configurations.runtimeClasspath
}
task copyBinaryToDist( type: Copy ) {
dependsOn jar
into "$buildDir/../distro/bin"
from "$buildDir/bin"
include "*.jar"
}
task copyDocumentation( type: Copy ) {
into "$buildDir/../distro/"
from "$buildDir/../"
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 "$buildDir/../distro/bin"
delete "$buildDir/../distro/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"
def distroDir = "$project.projectDir/distro"
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
// showStandardStreams = true
}
// 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.21'
implementation 'org.codehaus.gpars:gpars:1.2.1'
implementation 'org.apache.commons:commons-lang3:3.14.0'
implementation 'org.apache.commons:commons-math3:3.6.1'
implementation 'commons-io:commons-io:2.16.1'
implementation 'com.google.guava:guava:33.1.0-jre'
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'com.univocity:univocity-parsers:2.9.1' // csv parser
implementation 'org.apache.commons:commons-csv:1.10.0'
implementation 'org.zeroturnaround:zt-zip:1.17'
implementation 'org.apache.commons:commons-compress:1.26.1'
implementation 'org.tukaani:xz:1.9'
implementation 'com.github.luben:zstd-jni:1.5.6-2'
implementation 'com.github.dpaukov:combinatoricslib3:3.4.0'
implementation 'org.slf4j:slf4j-api:1.7.36'
implementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.23.1'
implementation 'org.apache.logging.log4j:log4j-core:2.23.1'
implementation 'org.slf4j:jul-to-slf4j:1.7.36' // for netlib logging messages
implementation 'org.biojava:biojava-core:7.0.2'
implementation 'org.biojava:biojava-alignment:7.0.2'
implementation 'org.biojava:biojava-structure:7.0.2-rdk1'
implementation 'org.openscience.cdk:cdk-qsarmolecular:2.9' // for NumericalSurface class
implementation 'org.openscience.cdk:cdk-silent:2.9' // for Atom class
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.10.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2'
}