-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle.kts
134 lines (118 loc) · 3.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
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
import org.jetbrains.dokka.DokkaConfiguration
import org.jetbrains.dokka.gradle.DokkaTask
import org.owasp.dependencycheck.gradle.extension.DependencyCheckExtension
import java.net.URL
object Meta {
const val BASE_URL = "https://github.com/eu-digital-identity-wallet/eudi-lib-jvm-openid4vci-kt"
}
plugins {
base
`java-library`
jacoco
alias(libs.plugins.dokka)
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.spotless)
alias(libs.plugins.sonarqube)
alias(libs.plugins.dependency.check)
alias(libs.plugins.maven.publish)
}
repositories {
mavenCentral()
mavenLocal()
maven {
url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
mavenContent { snapshotsOnly() }
}
}
dependencies {
api(libs.nimbus.oauth2.oidc.sdk)
api(libs.ktor.client.core)
api(libs.ktor.client.content.negotiation)
api(libs.ktor.client.serialization)
api(libs.ktor.serialization.kotlinx.json)
testImplementation(libs.kotlinx.coroutines.test)
testImplementation(libs.jsoup)
testImplementation(kotlin("test"))
testImplementation(libs.ktor.client.okhttp)
testImplementation(libs.ktor.server.test.host)
testImplementation(libs.ktor.server.content.negotiation)
testImplementation(libs.ktor.client.mock)
testImplementation(libs.ktor.client.logging)
testImplementation(libs.logback.classic)
testImplementation(libs.cbor)
}
java {
sourceCompatibility = JavaVersion.toVersion(libs.versions.java.get())
}
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(libs.versions.java.get()))
vendor.set(JvmVendorSpec.ADOPTIUM)
}
}
spotless {
kotlin {
ktlint(libs.versions.ktlint.get())
licenseHeaderFile("FileHeader.txt")
}
kotlinGradle {
ktlint(libs.versions.ktlint.get())
}
}
testing {
suites {
val test by getting(JvmTestSuite::class) {
useJUnitJupiter()
}
}
}
tasks.jacocoTestReport {
reports {
xml.required.set(true)
}
}
tasks.jar {
manifest {
attributes(
mapOf(
"Implementation-Title" to project.name,
"Implementation-Version" to project.version,
),
)
}
}
tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets {
named("main") {
// used as project name in the header
moduleName.set("EUDI OpenId4VCI library")
// contains descriptions for the module and the packages
includes.from("Module.md")
documentedVisibilities.set(setOf(DokkaConfiguration.Visibility.PUBLIC, DokkaConfiguration.Visibility.PROTECTED))
val remoteSourceUrl = System.getenv()["GIT_REF_NAME"]?.let { URL("${Meta.BASE_URL}/tree/$it/src") }
remoteSourceUrl
?.let {
sourceLink {
localDirectory.set(projectDir.resolve("src"))
remoteUrl.set(it)
remoteLineSuffix.set("#L")
}
}
}
}
}
mavenPublishing {
pom {
ciManagement {
system = "github"
url = "${Meta.BASE_URL}/actions"
}
}
}
val nvdApiKey: String? = System.getenv("NVD_API_KEY") ?: properties["nvdApiKey"]?.toString()
val dependencyCheckExtension = extensions.findByType(DependencyCheckExtension::class.java)
dependencyCheckExtension?.apply {
formats = mutableListOf("XML", "HTML")
nvd.apiKey = nvdApiKey ?: ""
}