-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
147 lines (117 loc) · 4.23 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
import org.apache.tools.ant.filters.ReplaceTokens
// SPAN application version
version = "2.0"
buildscript {
ext.kotlin_version = "1.6.10"
repositories {
maven { url("https://repo1.maven.org/maven2") }
maven { url("https://plugins.gradle.org/m2") }
maven { url("https://jitpack.io") }
}
dependencies {
classpath "com.github.jengelman.gradle.plugins:shadow:6.1.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
/* We can't use `plugins` block here because of the multi-root setup, since the `plugins` block doesn't allow
* specifying a plugin more than once throughout the whole project. */
apply plugin: "application"
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "kotlin"
mainClassName = "org.jetbrains.bio.span.SpanCLA"
sourceCompatibility = 8
targetCompatibility = sourceCompatibility
compileKotlin { kotlinOptions.jvmTarget = sourceCompatibility }
compileTestKotlin { kotlinOptions.jvmTarget = sourceCompatibility }
if (rootProject == project) {
repositories {
maven { url("https://repo1.maven.org/maven2") }
maven { url("https://plugins.gradle.org/m2") }
}
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version")
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version")
// Logging dependencies
implementation("ch.qos.logback:logback-classic:1.3.14")
implementation("ch.qos.logback:logback-core:1.3.14")
implementation("com.google.code.gson:gson:2.10.1")
implementation("org.apache.commons:commons-csv:1.10.0")
implementation("net.sf.jopt-simple:jopt-simple:5.0.4")
implementation("org.jetbrains.bio:viktor:1.2.0")
implementation("org.jetbrains.bio:big:0.9.1")
implementation project(":bioinf-commons")
testImplementation project(path: ":bioinf-commons", configuration: "testOutput")
testImplementation("junit:junit:4.13.2")
testImplementation("org.jetbrains.kotlin:kotlin-test:$kotlin_version")
}
private String settingsFolder(final String propertyName, final String folderName) {
if (!System.hasProperty(propertyName)) {
return "${rootProject.buildDir}/.tests/$folderName"
} else {
return System.getProperty(propertyName)
}
}
test {
dependsOn ":bioinf-commons:generateTestOrganism"
dependsOn ":bioinf-commons:test"
include "**/*Test.class"
ignoreFailures = true
maxParallelForks = Runtime.runtime.availableProcessors()
maxHeapSize = "1024m"
testLogging.showStandardStreams = true
systemProperty "genomes.path", settingsFolder("genomes.path", "genomes")
systemProperty "experiments.path", settingsFolder("experiments.path", "experiments")
systemProperty "raw.data.path", settingsFolder("experiments.path", "rawdata")
systemProperty "caches.path", settingsFolder("genomes.path", "caches")
systemProperty "logs.path", settingsFolder("experiments.path", "logs")
systemProperty "teamcity.build.checkoutDir", System.getProperty("teamcity.build.checkoutDir")
}
task processBuildProperties(type: Copy) {
shadowJar.dependsOn name
// turn of cache for this task
outputs.upToDateWhen { false }
// Fix version and build in properties file
from(sourceSets.main.resources) {
include "span.properties"
}
into sourceSets.main.output.resourcesDir
filter(ReplaceTokens, tokens: [
VERSION: version,
BUILD : project.buildCounter,
DATE : new Date().format("MMMM dd, yyyy")
])
}
task sourcesJar(type: Jar) {
classifier = "sources"
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
shadowJar {
// File name: "$baseName-$version-$classifier.jar"
archiveBaseName.set("span")
archiveVersion.set("${version}.${project.buildCounter}")
archiveClassifier.set("")
zip64 true
mustRunAfter test
// umm
mustRunAfter clean
}
jar {
manifest {
attributes provider: "gradle"
attributes "Application-Name": "SPAN $version"
attributes "Built-By": "JetBrains Research TeamCity"
}
}
clean {
dependsOn ":bioinf-commons:clean"
}
// https://github.com/gradle/gradle/issues/5816
if (rootProject == project) {
wrapper {
gradleVersion = "6.8"
}
}