-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.gradle.kts
108 lines (85 loc) · 2.69 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
106
107
108
plugins {
java
application
checkstyle
jacoco
}
group = "org.mitre"
repositories {
mavenCentral()
maven {
url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
}
}
dependencies {
implementation("ca.uhn.hapi.fhir", "org.hl7.fhir.validation", "6.5.0")
// validator dependency needed for terminology (why can't it get this automatically?)
implementation("com.squareup.okhttp3", "okhttp", "4.12.0")
// validator dependency needed to prevent a ClassNotFoundException
implementation("org.fhir:ucum:1.0.9")
// GSON for our JSON needs
implementation("com.google.code.gson", "gson", "2.11.0")
// Basic logging. Reload4J is a security-focused fork of Log4J 1.x
implementation("org.slf4j", "slf4j-reload4j", "2.0.16")
// Web Server
implementation("com.sparkjava", "spark-core", "2.9.4")
// Testing stuff
testImplementation("org.junit.jupiter", "junit-jupiter", "5.9.3")
}
java {
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_11
}
application {
mainClass.set("org.mitre.inferno.App")
}
checkstyle {
toolVersion = "8.25"
}
jacoco {
toolVersion = "0.8.8"
}
tasks {
withType<JavaCompile> {
options.compilerArgs.add("-Xlint:deprecation")
}
}
tasks.test {
environment(mapOf("DISABLE_TX" to "true"))
maxHeapSize = "6144m"
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
configure<JacocoTaskExtension> {
excludes = mutableListOf("org/hl7/fhir/r4/formats/JsonParser",
"org/hl7/fhir/r5/formats/JsonParser",
"org/hl7/fhir/r4/formats/XmlParser",
"org/hl7/fhir/r5/formats/XmlParser")
}
}
val testCoverage by tasks.registering {
group = "verification"
description = "Runs the unit tests with coverage."
dependsOn(":test", ":jacocoTestReport")
val jacocoTestReport = tasks.findByName("jacocoTestReport")
jacocoTestReport?.mustRunAfter(tasks.findByName("test"))
}
tasks.register<Jar>("uberJar") {
archiveClassifier.set("uber")
duplicatesStrategy = org.gradle.api.file.DuplicatesStrategy.INCLUDE
manifest {
attributes("Implementation-Title" to "FHIR Validator Wrapper",
"Implementation-Version" to project.version,
"Main-Class" to "org.mitre.inferno.App")
}
from(sourceSets.main.get().output)
dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
})
}
val setVersion = tasks.processResources {
expand("version" to project.version)
inputs.property("appVersion", project.version)
}