forked from VEuPathDB/service-dataset-access
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
56 lines (46 loc) · 1.49 KB
/
build.gradle.kts
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
import java.util.Properties
import java.io.FileInputStream
plugins {
java
}
repositories {
jcenter()
mavenCentral()
maven {
name = "Bintray"
url = uri("https://dl.bintray.com/veupathdb")
}
}
apply(from = "dependencies.gradle.kts")
// Load Props
val buildProps = Properties()
buildProps.load(FileInputStream(File(rootDir, "service.properties")))
val fullPack = "${buildProps["app.package.root"]}.${buildProps["app.package.service"]}"
// Project settings
group = buildProps["project.group"] ?: error("empty 1")
version = buildProps["project.version"] ?: error("empty 2")
tasks.jar {
manifest {
attributes["Main-Class"] = "${fullPack}.${buildProps["app.main-class"]}"
attributes["Implementation-Title"] = buildProps["project.name"]
attributes["Implementation-Version"] = buildProps["project.version"]
}
println("Packaging Components")
from(configurations.runtimeClasspath.get().map {
println(" " + it.name)
if (it.isDirectory) it else zipTree(it).matching {
exclude { f ->
val name = f.name.toLowerCase()
(name.contains("log4j") && name.contains(".dat")) ||
name.endsWith(".sf") ||
name.endsWith(".dsa") ||
name.endsWith(".rsa")
} } })
archiveFileName.set("service.jar")
}
tasks.register("print-package") { print(fullPack) }
tasks.register("print-container-name") { print(buildProps["container.name"]) }
val test by tasks.getting(Test::class) {
// Use junit platform for unit tests
useJUnitPlatform()
}