-
Notifications
You must be signed in to change notification settings - Fork 161
Expand file tree
/
Copy pathbuild.gradle
More file actions
108 lines (93 loc) · 2.35 KB
/
build.gradle
File metadata and controls
108 lines (93 loc) · 2.35 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.cinnober.gradle:semver-git:2.5.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'
id 'org.jreleaser' version '1.21.0'
}
import com.yubico.gradle.GitUtils
project.ext.isCiBuild = System.env.CI == 'true'
wrapper {
gradleVersion = '8.14.3'
}
dependencies {
constraints {
api(constraintLibs.bundles.jackson)
api(constraintLibs.cbor)
api(constraintLibs.guava)
api(constraintLibs.httpclient5)
api(constraintLibs.slf4j)
}
}
allprojects {
apply plugin: 'idea'
if (System.env.VERSION) {
it.version = System.env.VERSION
} else {
ext.snapshotSuffix = "<count>.g<sha>-SNAPSHOT<dirty>"
ext.dirtyMarker = "-DIRTY"
apply plugin: 'com.cinnober.gradle.semver-git'
}
idea.module {
downloadJavadoc = true
downloadSources = true
}
repositories {
mavenCentral()
}
tasks.withType(AbstractTestTask) {
testLogging {
showStandardStreams = isCiBuild
}
}
}
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)
jreleaser {
signing {
active = 'ALWAYS'
mode = 'COMMAND'
armored = true
verify = false
}
deploy {
maven {
mavenCentral {
sonatype {
active = 'ALWAYS'
url = 'https://central.sonatype.com/api/v1/publisher'
stagingRepository('build/staging-deploy')
}
}
}
}
}