-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
159 lines (144 loc) · 4.08 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
/*
Set meta-information for the project build.
*/
version 'v2.3.10'
group 'de.tue.cs.ibmi.it'
println "Project: $project"
println "Name: $name"
println "Project directory: $projectDir"
println "Build directory: $buildDir"
println "Version: $version"
println "Group: $project.group"
println "AntBuilder: $ant"
/*
The `buildscript` block defines properties (repositories, plugins, ...)
used within the Gradle build process.
*/
buildscript {
repositories {
mavenCentral()
}
}
/*
Import plugins used during the build process.
*/
/*
To prevent duplicate access to output directories a dependency-hierarchy is
established on different tasks.
*/
tasks.whenTaskAdded { task ->
if (task.name == 'jar' || task.name == 'processResources') {
task.dependsOn unpackSnpEff
}
}
/*
This task unzips SnpEff.
*/
task unpackSnpEff(type: Copy) {
from zipTree('src/main/resources/snpEff.zip')
into 'src/main/resources/'
}
/*
After building, the Jar is copied into the `releases` directory.
*/
task copyJarToReleases(type: Copy) {
mkdir 'releases'
def jarName = "build/libs/" + rootProject.name + "-" + version + ".jar"
from jarName
into "releases"
}
/*
Defines the repositories to look up dependencies.
*/
repositories {
mavenCentral()
maven {
url "https://bio.informatik.uni-jena.de/repository/libs-release-oss/"
}
maven {
url "https://artifactory.cronapp.io/public-release/"
}
}
/*
The following plugins are used during the gradle build process.
*/
apply plugin: 'java'
/*
All project dependencies are defined in the following block.
*/
dependencies {
implementation 'commons-cli:commons-cli:1.5.0'
implementation 'commons-io:commons-io:2.11.0'
implementation 'com.github.samtools:htsjdk:3.0.4'
implementation 'com.google.guava:guava:31.1-jre'
implementation 'args4j:args4j:2.33'
implementation 'org.apache.logging.log4j:log4j-core:2.20.0'
implementation 'org.apache.logging.log4j:log4j-api:2.20.0'
implementation 'org.biojava:biojava-core:5.4.0'
implementation 'org.biojava:biojava-genome:5.4.0'
implementation 'com.github.cliftonlabs:json-simple:4.0.1'
implementation 'org.javatuples:javatuples:1.2'
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'com.google.code.gson:gson-extras:2.8.5'
implementation 'org.apache.commons:commons-text:1.10.0'
implementation 'com.github.java-json-tools:json-schema-validator:2.2.14'
}
/*
In order to build a final FatJar, all entries from configurations.implementation (the above defined
dependencies) are copied into configurations.includeJars.
*/
configurations {
includeJars.extendsFrom implementationjava
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
/*
Defines the source directories for the tasks executed by the `java` plugin.
*/
sourceSets {
main {
java {
srcDir 'src/main/java'
}
resources {
srcDir 'src/main/resources'
}
}
}
/*
Copies the title and version of the project into resources files.
*/
processResources {
duplicatesStrategy 'exclude' // If duplicated files exist, they are excluded.
exclude('*.zip')
filesMatching('version.properties') {
expand projectVersion: version
}
filesMatching('title.properties') {
expand projectTitle: rootProject.name
}
}
jar {
duplicatesStrategy 'exclude' // If duplicated files exist, they are excluded.
manifest {
attributes("Implementation-Title": rootProject.name,
"Implementation-Version": archiveVersion,
"Main-Class": "main.Musial")
}
doFirst {
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
// Collects all Jars from dependencies and builds a FatJar.
}
}
/*
Defines steps executed by calling `gradle clean`.
*/
clean.doFirst {
delete "${rootDir}/releases/"
delete "${rootDir}/build/"
delete "${rootDir}/src/main/resources/snpEff"
}
/*
After building the FatJar, it is copied to the releases directory.
*/
build.finalizedBy(copyJarToReleases)