-
Notifications
You must be signed in to change notification settings - Fork 143
/
build.gradle
105 lines (86 loc) · 2.5 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
101
102
103
104
105
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.cinnober.gradle:semver-git:2.5.0'
if (project.findProperty('yubicoPublish') == 'true') {
classpath 'io.github.gradle-nexus:publish-plugin:1.3.0'
}
}
}
plugins {
id 'java-platform'
// The root project has no sources, but the dependency platform also needs to be published as an artifact
// See https://docs.gradle.org/current/userguide/java_platform_plugin.html
// See https://github.com/Yubico/java-webauthn-server/issues/93#issuecomment-822806951
id 'project-convention-publish'
}
import com.yubico.gradle.GitUtils
rootProject.description = "Metadata root for the com.yubico:webauthn-server-* module family"
project.ext.isCiBuild = System.env.CI == 'true'
project.ext.publishEnabled = !isCiBuild && project.findProperty('yubicoPublish') == 'true'
wrapper {
gradleVersion = '8.1.1'
}
dependencies {
constraints {
api(constraintLibs.bundles.jackson)
api(constraintLibs.cbor)
api(constraintLibs.guava)
api(constraintLibs.httpclient5)
api(constraintLibs.slf4j)
}
}
allprojects {
ext.snapshotSuffix = "<count>.g<sha>-SNAPSHOT<dirty>"
ext.dirtyMarker = "-DIRTY"
apply plugin: 'com.cinnober.gradle.semver-git'
apply plugin: 'idea'
idea.module {
downloadJavadoc = true
downloadSources = true
}
repositories {
mavenCentral()
}
tasks.withType(AbstractTestTask) {
testLogging {
showStandardStreams = isCiBuild
}
}
}
if (publishEnabled) {
apply plugin: 'io.github.gradle-nexus.publish-plugin'
nexusPublishing {
repositories {
sonatype {
stagingProfileId = '6c61426e6529d'
username = ossrhUsername
password = ossrhPassword
}
}
}
task checkJavaVersionBeforeRelease {
doFirst {
if (JavaVersion.current() != JavaVersion.VERSION_17) {
throw new RuntimeException('Release must be built using JDK 17. Current JDK version: ' + JavaVersion.current())
}
}
}
allprojects {
tasks.withType(AbstractCompile) { shouldRunAfter checkJavaVersionBeforeRelease }
tasks.withType(AbstractTestTask) { shouldRunAfter checkJavaVersionBeforeRelease }
tasks.withType(Sign) {
dependsOn checkJavaVersionBeforeRelease
}
tasks.withType(Jar) {
doFirst {
if (GitUtils.getGitCommit(projectDir) == null) {
throw new RuntimeException("Failed to get git commit ID")
}
}
}
}
}
task pitestMerge(type: com.yubico.gradle.pitest.tasks.PitestMergeTask)