-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
110 lines (97 loc) · 3.48 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
import java.net.URLEncoder
plugins {
jacoco
`java-library`
`maven-publish`
id("com.palantir.git-version") version "3.1.0" // to compute the project version from Git tags and hashes
id("org.sonarqube") version "6.0.1.5171"
}
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
val keycloakVersion = "26.0.7"
val lombokVersion = "1.18.36"
val guavaVersion = "33.4.0-jre"
val jUnitJupiterVersion = "5.11.4"
val mockitoJunitVersion = "5.14.2"
val assertJVersion = "3.27.0"
val jakartaWsRsVersion = "3.1.0"
val jerseyVersion = "3.1.9"
val commonsCodecVersion = "1.17.1"
dependencies {
implementation(platform("org.keycloak.bom:keycloak-bom-parent:${keycloakVersion}"))
implementation(platform("org.keycloak.bom:keycloak-spi-bom:${keycloakVersion}"))
compileOnlyApi("org.keycloak:keycloak-server-spi:${keycloakVersion}")
compileOnlyApi("org.keycloak:keycloak-server-spi-private:${keycloakVersion}")
implementation("org.keycloak:keycloak-services:${keycloakVersion}")
constraints {
implementation("com.google.guava:guava:${guavaVersion}")
implementation("commons-codec:commons-codec:${commonsCodecVersion}")
}
testImplementation("org.junit.jupiter:junit-jupiter:${jUnitJupiterVersion}")
testImplementation("org.mockito:mockito-junit-jupiter:${mockitoJunitVersion}")
testImplementation("org.assertj:assertj-core:${assertJVersion}")
testImplementation("jakarta.ws.rs:jakarta.ws.rs-api:${jakartaWsRsVersion}")
testImplementation("org.glassfish.jersey.core:jersey-common:${jerseyVersion}")
compileOnly("org.projectlombok:lombok:${lombokVersion}")
annotationProcessor("org.projectlombok:lombok:${lombokVersion}")
}
// Apply a specific Java toolchain to ease working on different environments.
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
tasks.jacocoTestReport {
dependsOn(tasks.test)
reports {
html.required = true
xml.required = true
}
}
tasks.test {
finalizedBy(tasks.jacocoTestReport) // report is always generated after tests run
}
tasks.named<Test>("test") {
useJUnitPlatform()
}
tasks.withType<AbstractArchiveTask> {
setProperty("archiveFileName", "keycloak-kubernetes-authenticator.jar")
}
sonar {
properties {
property("sonar.projectKey", "chr-fritz_keycloak-kubernetes-authenticator")
property("sonar.organization", "chr-fritz")
property("sonar.host.url", "https://sonarcloud.io")
}
}
val gitVersion: groovy.lang.Closure<String> by extra
val versionDetails: groovy.lang.Closure<com.palantir.gradle.gitversion.VersionDetails> by extra
val details = versionDetails()
version = gitVersion() + (if (!details.isCleanTag) "-SNAPSHOT" else "")
publishing {
publications {
create<MavenPublication>("mavenJava") {
groupId = "de.chrfritz.keycloak.authenticators"
from(components["java"])
artifactId = tasks.jar.get().archiveBaseName.get()
}
}
repositories {
maven {
name = "GitHubPackages"
url =
uri(
"https://maven.pkg.github.com/" + URLEncoder.encode(
System.getenv("GITHUB_ACTOR"),
"UTF-8"
) + "/keycloak-kubernetes-authenticator"
)
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}