-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
135 lines (111 loc) · 4.42 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
buildscript {
ext.kotlin_version = "1.6.10"
ext.ktor_version = "1.6.8"
repositories {
maven { url("https://repo1.maven.org/maven2") }
maven { url("https://plugins.gradle.org/m2") }
}
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: "kotlin"
apply plugin: "com.github.johnrengelman.shadow"
if (rootProject == project) {
repositories {
maven { url("https://repo1.maven.org/maven2") }
maven { url("https://plugins.gradle.org/m2") }
}
}
sourceCompatibility = 11
targetCompatibility = sourceCompatibility
compileKotlin { kotlinOptions.jvmTarget = sourceCompatibility }
compileTestKotlin { kotlinOptions.jvmTarget = sourceCompatibility }
project(":bioinf-commons")
dependencies {
implementation project(":bioinf-commons")
// Kotlin dependencies
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version")
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version")
// Server: Ktor dependencies
implementation("io.ktor:ktor-server-netty:$ktor_version")
implementation("io.ktor:ktor-jackson:$ktor_version")
// Logging dependencies
implementation("ch.qos.logback:logback-classic:1.4.12")
implementation("ch.qos.logback:logback-core:1.4.12")
//ML dependencies
implementation("nz.ac.waikato.cms.weka:weka-stable:3.8.6")
// Bioinformatics (science) dependencies
implementation project(":bioinf-commons")
implementation("org.nield:kotlin-statistics:1.2.1")
implementation("org.apache.commons:commons-math3:3.6.1")
// Testing dependencies
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)
}
}
tasks.withType(Test) {
// Continue execution even if tests for some of the sub-projects failed.
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")
}
test {
include "**/*Test.class"
}
task sourcesJar(type: Jar) {
classifier = "sources"
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
shadowJar {
// File name: "$baseName-$version-$classifier.jar"
baseName = "fishbone"
version = "${version}.${project.buildCounter}"
classifier = ""
minimize {
// kotlin.jvm.KotlinReflectionNotSupportedError: Kotlin reflection implementation is not found at runtime. Make sure you have kotlin-reflect.jar in the classpath
exclude(dependency("org.jetbrains.kotlin:.*"))
// ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type ch.qos.logback.core.rolling.RollingFileAppender
exclude(dependency("org.slf4j:.*"))
// java.lang.NoClassDefFoundError: com/fasterxml/jackson/dataformat/yaml/YAMLFactory
exclude(dependency("com.fasterxml.jackson.dataformat:.*"))
// java.lang.NoClassDefFoundError: org/yaml/snakeyaml/error/YAMLException
exclude(dependency("org.yaml:.*"))
}
manifest {
attributes "Main-Class": "org.jetbrains.bio.fishbone.FishboneApp"
}
zip64 true
}
jar {
manifest {
attributes provider: "gradle"
attributes "Application-Name": "Fishbone $version"
attributes "Built-By": "JetBrains Research TeamCity"
}
}
// https://github.com/gradle/gradle/issues/5816
if (rootProject == project) {
wrapper {
gradleVersion = "6.8"
}
}