-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
151 lines (127 loc) · 5.12 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
151 lines (127 loc) · 5.12 KB
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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.net.URI
plugins {
application
kotlin("jvm") version "2.3.20"
kotlin("plugin.serialization") version "2.3.20"
jacoco
id("org.sonarqube") version "6.2.0.5505"
}
group = "org.openmbee.flexo.mms"
version = "0.3.1"
sonar {
properties {
property("sonar.projectKey", "Open-MBEE_flexo-mms-layer1-service")
property("sonar.organization", "openmbee")
property("sonar.host.url", "https://sonarcloud.io")
property("sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco/test/jacocoTestReport.xml")
}
}
application {
mainClass.set("io.ktor.server.netty.EngineMain")
}
repositories {
mavenCentral()
}
jacoco {
toolVersion = "0.8.12"
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
}
val testFuseki: Configuration by configurations.creating
dependencies {
implementation(kotlin("stdlib"))
val kotestVersion = "6.1.11"
testImplementation("io.kotest:kotest-runner-junit5:$kotestVersion")
testImplementation("io.kotest:kotest-assertions-core:$kotestVersion")
testImplementation("io.kotest:kotest-assertions-json-jvm:$kotestVersion")
testImplementation("io.kotest:kotest-property:$kotestVersion")
val commonsCliVersion = "1.9.0"
implementation("commons-cli:commons-cli:$commonsCliVersion")
val kotlinxJsonVersion = "1.9.0"
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxJsonVersion")
val jenaVersion = "6.0.0"
implementation("org.apache.jena:jena-arq:${jenaVersion}")
testImplementation("org.apache.jena:jena-rdfconnection:${jenaVersion}");
testFuseki("org.apache.jena:jena-fuseki-server:$jenaVersion")
val ktorVersion = "3.4.2"
implementation("io.ktor:ktor-client-core:${ktorVersion}")
implementation("io.ktor:ktor-client-content-negotiation:${ktorVersion}")
implementation("io.ktor:ktor-client-cio:${ktorVersion}")
implementation("io.ktor:ktor-server-core:$ktorVersion")
implementation("io.ktor:ktor-server-auth:$ktorVersion")
implementation("io.ktor:ktor-server-auth-jwt:$ktorVersion")
implementation("io.ktor:ktor-server-call-logging:$ktorVersion")
implementation("io.ktor:ktor-server-conditional-headers:$ktorVersion")
implementation("io.ktor:ktor-server-cors:$ktorVersion")
implementation("io.ktor:ktor-server-default-headers:$ktorVersion")
implementation("io.ktor:ktor-server-forwarded-header:$ktorVersion")
implementation("io.ktor:ktor-server-host-common:$ktorVersion")
implementation("io.ktor:ktor-server-netty:$ktorVersion")
implementation("io.ktor:ktor-server-status-pages:$ktorVersion")
testImplementation("io.ktor:ktor-server-test-host:$ktorVersion")
testImplementation("io.kotest:kotest-assertions-ktor:$kotestVersion")
val logbackVersion = "1.5.18"
implementation("ch.qos.logback:logback-classic:$logbackVersion")
val systemLambdaVersion = "1.2.1"
testImplementation("com.github.stefanbirkner:system-lambda:$systemLambdaVersion")
val junitVersion = "5.13.1"
testImplementation("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
val migzVersion = "2.0.beta-1"
implementation("com.linkedin.migz:migz:$migzVersion")
// if/when needed, uncomment the block below to install dependencies from github repos
// repositories {
// maven {
// url = URI("https://jitpack.io")
// }
// }
// implementation("com.github.$USER:$REPO:master-SNAPSHOT")
}
tasks {
test {
useJUnitPlatform()
this.testLogging {
this.showStandardStreams = true
}
environment("FLEXO_MMS_ROOT_CONTEXT", System.getenv("FLEXO_MMS_ROOT_CONTEXT") ?: "http://layer1-service")
environment("FLEXO_MMS_QUERY_URL", System.getenv("FLEXO_MMS_QUERY_URL") ?: "http://localhost:3030/ds/sparql")
environment("FLEXO_MMS_UPDATE_URL", System.getenv("FLEXO_MMS_UPDATE_URL") ?: "http://localhost:3030/ds/update")
environment("FLEXO_MMS_GRAPH_STORE_PROTOCOL_URL", System.getenv("FLEXO_MMS_GRAPH_STORE_PROTOCOL_URL") ?: "http://localhost:3030/ds/data")
if (System.getenv("FLEXO_MMS_STORE_SERVICE_URL") != null)
environment("FLEXO_MMS_STORE_SERVICE_URL", System.getenv("FLEXO_MMS_STORE_SERVICE_URL") ?: "http://localhost:8081/store")
}
}
tasks.test {
finalizedBy(tasks.jacocoTestReport) // report is always generated after tests run
}
tasks.jacocoTestReport {
dependsOn(tasks.test) // tests are required to run before generating the report
reports {
xml.required.set(true)
}
}
tasks.register("generateBuildInfo") {
val buildInfoFile = layout.buildDirectory.file("resources/main/build-info.properties").get().asFile
outputs.file(buildInfoFile)
doLast {
buildInfoFile.writeText(
"""
build.version=${project.version}
""".trimIndent()
)
}
}
tasks.named("processResources") {
finalizedBy("generateBuildInfo")
}
tasks.named("jar") {
dependsOn("generateBuildInfo")
}
val compileKotlin: KotlinCompile by tasks
compileKotlin.compilerOptions {
freeCompilerArgs.add("-Xdebug")
}
kotlin {
jvmToolchain(21)
}