-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
163 lines (139 loc) · 4.44 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
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
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: 'signing'
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
repositories {
mavenCentral()
}
dependencies {
implementation group: 'tech.kwik', name: 'kwik', version: '0.10'
implementation group: 'tech.kwik', name: 'qpack', version: '2.0'
def junitVersion = "5.10.0"
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitVersion")
testImplementation("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
testImplementation("org.assertj:assertj-core:3.24.2")
testImplementation("org.mockito:mockito-core:5.6.0")
}
sourceSets {
main {
resources {
srcDir "${buildDir}/generated"
exclude 'sources/**'
}
}
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
println "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
}
}
}
jar {
manifest {
attributes 'Main-Class': 'tech.kwik.flupke.sample.Flupke'
}
from {
configurations.compileClasspath.findAll { it.name =~ /qpack.*\.jar/ }.collect { it.isDirectory() ? it : zipTree(it) }
}
exclude 'module-info.class'
}
task uberJar(type: Jar) {
manifest {
attributes 'Main-Class': 'tech.kwik.flupke.sample.Flupke'
}
archiveBaseName = "flupke-uber"
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.txt', 'module-info.class'
with jar
}
task determineVersion {
doLast {
def proc = "git describe --always --dirty".execute()
proc.waitFor()
if (proc.exitValue()) {
logger.quiet("Building development version.")
} else {
def versionTag = proc.in.readLines()[0]
// Check that tag matches format like v1.0 or v1.0.19
if (versionTag ==~ /v?[0-9]+(\.\d+){1,2}/) {
if (versionTag.startsWith("v")) {
versionTag = versionTag[1..-1]
}
logger.quiet("Building version ${versionTag}.")
}
else {
logger.error("Version tag '${versionTag}' does not contain a valid version.");
}
project.version = versionTag
ext.versionDir = new File("${buildDir}", "generated/tech/kwik/flupke/impl")
versionDir.mkdirs()
new File(versionDir, "version.properties").text = versionTag
}
}
}
compileJava.dependsOn (determineVersion, processResources)
group = 'tech.kwik'
java {
withJavadocJar()
withSourcesJar()
}
def pomContent = {
name = 'Flupke'
description = 'Java implementation of HTTP3 (RFC 9114): generic client / client library and HTTP3 server plugin for Kwik.'
url = 'https://github.com/ptrd/flupke'
licenses {
license {
name = 'GNU Lesser General Public License v3'
url = 'https://www.gnu.org/licenses/lgpl-3.0-standalone.html'
}
}
developers {
developer {
id = 'peterd'
name = 'Peter Doornbosch'
email = 'peter.doornbosch@gmail.com'
}
}
scm {
connection = 'scm:git:git@github.com:ptrd/flupke.git'
developerConnection = 'scm:git:git@github.com:ptrd/flupke.git'
url = 'https://github.com/ptrd/flupke'
}
}
publishing {
publications {
flupke(MavenPublication) {
artifactId = 'flupke'
from components.java
pom pomContent
}
}
repositories {
maven {
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = project.properties.ossrhUsername
password = project.properties.ossrhPassword
}
}
}
}
signing {
sign publishing.publications.flupke
}
javadoc {
options.addStringOption('Xdoclint:none', '-quiet')
options.addBooleanOption('html5', true)
}