-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
100 lines (79 loc) · 2.64 KB
/
build.gradle
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
import tech.esystems.workspace.java.plugin.artifact.ArtifactPlugin
apply plugin: ArtifactPlugin
wrapper {
gradleVersion = '8.11'
}
subprojects { Project project ->
project.pluginManager.withPlugin('java') {
project.repositories {
mavenCentral()
}
project.java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
project.configurations {
integrationTestImplementation.extendsFrom testImplementation
integrationTestRuntimeOnly.extendsFrom testRuntimeOnly
}
project.sourceSets {
integrationTest {
java.srcDir 'src/test-integration/java'
resources.srcDir 'src/test-integration/resources'
compileClasspath += sourceSets.main.output + configurations.testRuntimeClasspath
runtimeClasspath += output + compileClasspath
}
}
project.dependencies {
compileOnly 'org.projectlombok:lombok:1.18.36'
annotationProcessor 'org.projectlombok:lombok:1.18.36'
testImplementation platform('org.junit:junit-bom:5.11.3')
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation 'org.keycloak:keycloak-server-spi:26.1.0'
testImplementation 'org.keycloak:keycloak-services:26.1.0'
testImplementation 'org.mockito:mockito-core:5.14.2'
testImplementation 'org.mockito:mockito-junit-jupiter:5.14.2'
}
project.tasks.withType(Test) {
var listArgs = new ArrayList<String>()
listArgs.add("--add-opens=java.base/java.lang=ALL-UNNAMED")
listArgs.add("--add-opens=java.base/java.lang.invoke=ALL-UNNAMED")
setJvmArgs(listArgs)
maxParallelForks = (int) (Runtime.runtime.availableProcessors() / 2)
useJUnitPlatform()
testLogging {
exceptionFormat 'full'
events "started", "passed", "skipped", "failed"
}
}
project.tasks.register('integrationTest', Test) {
description = 'Runs integration tests'
group = 'verification'
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
shouldRunAfter(tasks.test)
}
project.tasks.integrationTest {
jvmArgs = tasks.test.jvmArgs
useJUnitPlatform()
}
project.tasks.register('deploy') {
description = 'Deploys the JAR output to the Keycloak server directory'
group = 'deployment'
dependsOn(jar)
doLast {
def jarFile = jar.archiveFile.get().asFile
def keycloakDeployDir = new File(rootDir, "server/providers")
if (!keycloakDeployDir.exists()) {
keycloakDeployDir.mkdirs()
}
copy {
from jarFile
into keycloakDeployDir
}
println "JAR deployed to ${ keycloakDeployDir.absolutePath }"
}
}
}
}