-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
131 lines (117 loc) · 5.41 KB
/
build.gradle.kts
File metadata and controls
131 lines (117 loc) · 5.41 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
group = "org.openmbee.flexo.sysmlv2"
version = "0.2.0"
application {
mainClass.set("io.ktor.server.netty.EngineMain")
}
repositories {
mavenCentral()
gradlePluginPortal()
}
jacoco {
toolVersion = "0.8.12"
}
plugins {
application
kotlin("jvm") version "2.3.21"
kotlin("plugin.serialization") version "2.3.21"
jacoco
id("org.sonarqube") version "6.2.0.5505"
}
sonar {
properties {
property("sonar.projectKey", "Open-MBEE_flexo-mms-sysmlv2")
property("sonar.organization", "openmbee")
property("sonar.host.url", "https://sonarcloud.io")
property("sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco/test/jacocoTestReport.xml")
}
}
dependencies {
implementation(kotlin("stdlib"))
val ktorVersion = "3.4.3"
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-serialization-gson:$ktorVersion")
implementation("io.ktor:ktor-serialization-kotlinx-json:$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-auto-head-response:$ktorVersion")
implementation("io.ktor:ktor-server-call-logging:$ktorVersion")
implementation("io.ktor:ktor-server-compression:$ktorVersion")
// implementation("io.ktor:ktor-server-conditional-headers:$ktorVersion")
implementation("io.ktor:ktor-server-content-negotiation:$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-hsts:$ktorVersion")
// implementation("io.ktor:ktor-server-locations:$ktorVersion")
implementation("io.ktor:ktor-server-metrics:$ktorVersion")
implementation("io.ktor:ktor-server-netty:$ktorVersion")
implementation("io.ktor:ktor-server-resources:$ktorVersion")
implementation("io.ktor:ktor-server-status-pages:$ktorVersion")
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-assertions-ktor:$kotestVersion")
testImplementation("io.kotest:kotest-property:$kotestVersion")
testImplementation("io.ktor:ktor-server-test-host:$ktorVersion")
implementation("ch.qos.logback:logback-classic:1.5.18")
val junitVersion = "5.13.1"
testImplementation("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.2")
// sign JWTs locally in tests with the same shared secret as the
// layer1-service container (see src/test/resources/test.env)
testImplementation("com.auth0:java-jwt:4.5.0")
val jenaVersion = "6.0.0"
implementation("org.apache.jena:jena-arq:${jenaVersion}")
implementation("org.apache.jena:jena-querybuilder:${jenaVersion}")
// CommonSpec.beforeEach uses RDFConnection to reload cluster.trig via GSP
testImplementation("org.apache.jena:jena-rdfconnection:${jenaVersion}")
}
tasks.wrapper {
gradleVersion = "8.10.2"
distributionType = Wrapper.DistributionType.ALL
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
kotlin {
jvmToolchain(21)
}
tasks {
test {
useJUnitPlatform()
this.testLogging {
this.showStandardStreams = true
}
// layer1-service running locally (started via
// src/test/resources/docker-compose.yml). The in-process sysmlv2
// module under test forwards calls to it.
environment("FLEXO_PROTOCOL", System.getenv("FLEXO_PROTOCOL") ?: "http")
environment("FLEXO_HOST", System.getenv("FLEXO_HOST") ?: "localhost")
environment("FLEXO_PORT", System.getenv("FLEXO_PORT") ?: "8080")
environment("FLEXO_SYSMLV2_ORG", System.getenv("FLEXO_SYSMLV2_ORG") ?: "sysmlv2")
// triplestore endpoints used by CommonSpec.beforeEach to drop +
// reload the seed cluster.trig before each test.
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")
// JWT shared with layer1 (must match src/test/resources/test.env)
environment("JWT_DOMAIN", System.getenv("JWT_DOMAIN") ?: "http://flexo-mms-services")
environment("JWT_AUDIENCE", System.getenv("JWT_AUDIENCE") ?: "flexo-mms-audience")
environment("JWT_REALM", System.getenv("JWT_REALM") ?: "flexo-mms")
environment("JWT_SECRET", System.getenv("JWT_SECRET") ?: "thisissomethingreallylong1234567801234567890")
}
}
tasks.test {
finalizedBy(tasks.jacocoTestReport)
}
tasks.jacocoTestReport {
dependsOn(tasks.test)
reports {
xml.required.set(true)
}
}