Skip to content

Commit 4f23456

Browse files
committed
fix licenses. add version information to jars and manifests
1 parent a18f421 commit 4f23456

File tree

1 file changed

+45
-4
lines changed

1 file changed

+45
-4
lines changed

build.gradle

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ tasks.withType(JavaExec) {
4343
systemProperty("robaho.net.httpserver.http2InitialWindowSize","1024000")
4444
systemProperty("robaho.net.httpserver.http2ConnectionWindowSize","1024000000")
4545
systemProperty("robaho.net.httpserver.EnableStats","true")
46+
systemProperty("robaho.net.httpserver.EnableDebug","true")
4647
}
4748

4849
dependencies {
@@ -90,6 +91,43 @@ sourceSets {
9091
}
9192
}
9293

94+
def getGitVersion () {
95+
def output = new ByteArrayOutputStream()
96+
exec {
97+
commandLine 'git', 'rev-list', '--tags', '--max-count=1'
98+
standardOutput = output
99+
}
100+
def revision = output.toString().trim()
101+
output.reset()
102+
exec {
103+
commandLine 'git', 'describe', '--tags', revision
104+
standardOutput = output
105+
}
106+
return output.toString().trim()
107+
}
108+
109+
version = getGitVersion()
110+
111+
task showGitVersion {
112+
doLast {
113+
println "project version is "+version
114+
}
115+
}
116+
117+
build {
118+
doFirst {
119+
getGitVersion
120+
}
121+
}
122+
123+
jar {
124+
manifest {
125+
attributes(
126+
"Implementation-Title": project.name,
127+
"Implementation-Version": version)
128+
}
129+
}
130+
93131
task runSingleUnitTest(type: Test) {
94132
outputs.upToDateWhen { false }
95133
dependsOn testClasses
@@ -173,13 +211,12 @@ publishing {
173211
maven(MavenPublication) {
174212
groupId = 'io.github.robaho'
175213
artifactId = 'httpserver'
176-
version = "1.0.18"
177214

178215
from components.java
179216

180217
pom {
181218
name = 'HttpServer'
182-
description = 'A zero dependency implements of the JDK httpserver designed for Virtual Threads. Includes websocket support.'
219+
description = 'A zero dependency implementation of the JDK httpserver designed for Virtual Threads. Includes websocket and Http2 support.'
183220

184221
signing {
185222
sign publishing.publications.maven
@@ -194,13 +231,17 @@ publishing {
194231

195232
licenses {
196233
license {
197-
name = 'gnu v2.0'
198-
url = 'https://www.gnu.org/licenses/old-licenses/gpl-2.0.html'
234+
name = 'gnu v2.0 with classpath exception'
235+
url = 'https://www.gnu.org/software/classpath/license.html'
199236
}
200237
license {
201238
name = 'nanohttpd'
202239
url = 'https://github.com/NanoHttpd/nanohttpd/blob/efb2ebf85a2b06f7c508aba9eaad5377e3a01e81/LICENSE.md'
203240
}
241+
license {
242+
name = 'MIT License'
243+
url = 'https://opensource.org/licenses/MIT'
244+
}
204245
}
205246

206247
developers {

0 commit comments

Comments
 (0)