-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
105 lines (80 loc) · 2.54 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
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
import org.veupathdb.lib.gradle.container.util.Logger.Level
plugins {
java
id("org.veupathdb.lib.gradle.container.container-utils") version "4.8.10"
id("com.github.johnrengelman.shadow") version "7.1.2"
}
// configure VEupathDB container plugin
containerBuild {
// Change if debugging the build process is necessary.
logLevel = Level.Info
// General project level configuration.
project {
// Project Name
name = "example-service"
// Project Group
group = "org.veupathdb.service"
// Project Version
version = "1.0.0"
// Project Root Package
projectPackage = "org.veupathdb.service.demo"
// Main Class Name
mainClassName = "Main"
}
// Docker build configuration.
docker {
// Docker build context
context = "."
// Name of the target docker file
dockerFile = "Dockerfile"
// Resulting image tag
imageName = "example-service"
}
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
tasks.shadowJar {
exclude("**/Log4j2Plugins.dat")
archiveFileName.set("service.jar")
}
repositories {
mavenCentral()
mavenLocal()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/veupathdb/maven-packages")
credentials {
username = if (extra.has("gpr.user")) extra["gpr.user"] as String? else System.getenv("GITHUB_USERNAME")
password = if (extra.has("gpr.key")) extra["gpr.key"] as String? else System.getenv("GITHUB_TOKEN")
}
}
}
// ensures changing and dynamic modules are never cached
configurations.all {
resolutionStrategy {
cacheChangingModulesFor(0, TimeUnit.SECONDS)
cacheDynamicVersionsFor(0, TimeUnit.SECONDS)
}
}
dependencies {
// Core lib
implementation("org.veupathdb.lib:jaxrs-container-core:7.0.1")
// Jersey
implementation("org.glassfish.jersey.core:jersey-server:3.1.1")
// Jackson
implementation("com.fasterxml.jackson.core:jackson-databind:2.15.3")
implementation("com.fasterxml.jackson.core:jackson-annotations:2.15.3")
// Log4J
implementation("org.apache.logging.log4j:log4j-api:2.20.0")
implementation("org.apache.logging.log4j:log4j-core:2.20.0")
// Metrics (can remove if not adding custom service metrics over those provided by container core)
implementation("io.prometheus:simpleclient:0.16.0")
implementation("io.prometheus:simpleclient_common:0.16.0")
// Unit Testing
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.2")
testImplementation("org.mockito:mockito-core:5.2.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.2")
}