forked from Yubico/java-webauthn-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
211 lines (170 loc) · 4.92 KB
/
build.gradle
File metadata and controls
211 lines (170 loc) · 4.92 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
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
buildscript {
repositories {
mavenCentral()
}
dependencies {
configurations.maybeCreate('pitest')
classpath 'com.cinnober.gradle:semver-git:2.4.0'
classpath 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.3.0'
pitest 'org.pitest:pitest-command-line:1.4.2' // Transitive dependency from pitest plugin
}
}
plugins {
id 'com.github.kt3k.coveralls' version '2.8.1'
id 'io.codearte.nexus-staging' version '0.9.0'
id 'io.franzbecker.gradle-lombok' version '1.14'
}
import io.franzbecker.gradle.lombok.LombokPlugin
import io.franzbecker.gradle.lombok.task.DelombokTask
project.ext.isCiBuild = System.env.CI == 'true'
project.ext.publishEnabled = !isCiBuild &&
project.hasProperty('yubicoPublish') && project.yubicoPublish &&
project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')
if (publishEnabled) {
nexusStaging {
username = ossrhUsername
password = ossrhPassword
stagingProfileId = '6c61426e6529d'
}
}
wrapper {
gradleVersion = '4.10'
}
allprojects {
ext.snapshotSuffix = "<count>.g<sha>-SNAPSHOT<dirty>"
ext.dirtyMarker = "-DIRTY"
apply plugin: 'com.cinnober.gradle.semver-git'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: LombokPlugin
group = 'com.yubico'
sourceCompatibility = 1.8
targetCompatibility = 1.8
lombok {
version '1.18.6'
sha256 = '6373d9ade79efdc028cd48d40a9af9ac6a090dbcfaec55b438ec49556a4e92fb'
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.withType(AbstractArchiveTask) {
from(rootProject.file('COPYING'))
}
repositories {
mavenLocal()
maven { url "http://repo.maven.apache.org/maven2" }
}
idea.module { downloadJavadoc = true }
test {
failFast = true
testLogging {
showStandardStreams = isCiBuild
}
}
}
evaluationDependsOnChildren()
task assembleJavadoc(type: Sync) {
from("docs/index.html") {
expand project.properties
}
destinationDir = file("${rootProject.buildDir}/javadoc")
}
subprojects { project ->
task packageSources(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts.archives packageSources
task delombok(type: DelombokTask, dependsOn: classes) {
ext.outputDir = file("${buildDir}/delombok")
outputs.dir outputDir
sourceSets.main.java.srcDirs.each {
inputs.dir it
args(it, '-d', outputDir)
}
doFirst {
outputDir.deleteDir()
}
}
javadoc {
dependsOn delombok
source = delombok.outputDir
options.encoding = 'UTF-8'
options.addStringOption('charset', 'UTF-8')
}
task packageJavadoc(type: Jar) {
classifier = 'javadoc'
inputs.files javadoc.outputs
from javadoc.destinationDir
}
artifacts.archives packageJavadoc
rootProject.tasks.assembleJavadoc {
dependsOn javadoc
inputs.dir javadoc.destinationDir
from(javadoc.destinationDir) {
into project.name
}
}
dependencies {
compile(
'org.slf4j:slf4j-api:1.7.25',
)
testCompile(
'junit:junit:4.12',
'org.mockito:mockito-core:2.8.47',
)
}
if (publishEnabled && project.hasProperty('publishMe') && project.publishMe) {
apply plugin: 'maven'
apply plugin: 'signing'
signing {
useGpgCmd()
sign configurations.archives
}
signArchives.dependsOn check
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name project.description
description 'Java server-side library for Web Authentication'
url 'https://developers.yubico.com/java-webauthn-server/'
developers {
developer {
id 'emil'
name 'Emil Lundberg'
email 'emil@yubico.com'
}
}
licenses {
license {
name 'BSD-license'
comments 'Revised 2-clause BSD license'
}
}
scm {
url 'scm:git:git://github.com/Yubico/java-webauthn-server.git'
connection 'scm:git:git://github.com/Yubico/java-webauthn-server.git'
developerConnection 'scm:git:ssh://git@github.com/Yubico/java-webauthn-server.git'
tag 'HEAD'
}
}
}
}
}
}
}
task pitestMerge(type: com.yubico.gradle.pitest.tasks.PitestMergeTask)
coveralls {
sourceDirs = subprojects.sourceSets.main.allSource.srcDirs.flatten()
}
tasks.coveralls {
inputs.files pitestMerge.outputs.files
}