Skip to content

Commit 720d41a

Browse files
authored
Merge pull request #79 from nstdio/opt1
fix: NPE when no `Content-Encoding` header present.
2 parents 0111b35 + b3afc61 commit 720d41a

File tree

13 files changed

+354
-310
lines changed

13 files changed

+354
-310
lines changed

buildSrc/src/main/kotlin/io.github.nstdio.http.ext.publish-conventions.gradle.kts

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -19,92 +19,92 @@ import se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask
1919
import se.bjurr.gitchangelog.plugin.gradle.HelperParam
2020

2121
plugins {
22-
signing
23-
`maven-publish`
22+
signing
23+
`maven-publish`
2424

25-
id("io.github.gradle-nexus.publish-plugin")
26-
id("se.bjurr.gitchangelog.git-changelog-gradle-plugin")
25+
id("io.github.gradle-nexus.publish-plugin")
26+
id("se.bjurr.gitchangelog.git-changelog-gradle-plugin")
2727
}
2828

2929
publishing {
30-
publications {
31-
create<MavenPublication>("mavenJava") {
32-
from(components["java"])
33-
34-
pom {
35-
name.set("JDK Http Client Extensions")
36-
description.set("The set of useful extensions for JDK HttpClient.")
37-
url.set("https://github.com/nstdio/http-client-ext")
38-
39-
licenses {
40-
license {
41-
name.set("The Apache License, Version 2.0")
42-
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
43-
}
44-
}
45-
46-
developers {
47-
developer {
48-
id.set("nstdio")
49-
name.set("Edgar Asatryan")
50-
email.set("[email protected]")
51-
}
52-
}
53-
54-
scm {
55-
connection.set("scm:git:[email protected]:nstdio/http-client-ext.git")
56-
developerConnection.set("scm:git:[email protected]:nstdio/http-client-ext.git")
57-
url.set("https://github.com/nstdio/http-client-ext")
58-
}
59-
}
30+
publications {
31+
create<MavenPublication>("mavenJava") {
32+
from(components["java"])
33+
34+
pom {
35+
name.set("JDK Http Client Extensions")
36+
description.set("The set of useful extensions for JDK HttpClient.")
37+
url.set("https://github.com/nstdio/http-client-ext")
38+
39+
licenses {
40+
license {
41+
name.set("The Apache License, Version 2.0")
42+
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
43+
}
6044
}
45+
46+
developers {
47+
developer {
48+
id.set("nstdio")
49+
name.set("Edgar Asatryan")
50+
email.set("[email protected]")
51+
}
52+
}
53+
54+
scm {
55+
connection.set("scm:git:[email protected]:nstdio/http-client-ext.git")
56+
developerConnection.set("scm:git:[email protected]:nstdio/http-client-ext.git")
57+
url.set("https://github.com/nstdio/http-client-ext")
58+
}
59+
}
6160
}
61+
}
6262
}
6363

6464
nexusPublishing {
65-
repositories {
66-
sonatype {
67-
val baseUri = uri("https://s01.oss.sonatype.org")
68-
nexusUrl.set(baseUri.resolve("/service/local/"))
69-
snapshotRepositoryUrl.set(baseUri.resolve("/content/repositories/snapshots/"))
70-
}
65+
repositories {
66+
sonatype {
67+
val baseUri = uri("https://s01.oss.sonatype.org")
68+
nexusUrl.set(baseUri.resolve("/service/local/"))
69+
snapshotRepositoryUrl.set(baseUri.resolve("/content/repositories/snapshots/"))
7170
}
71+
}
7272
}
7373

7474
signing {
75-
isRequired = (version as String).endsWith("SNAPSHOT")
75+
isRequired = (version as String).endsWith("SNAPSHOT")
7676

77-
val signingKey = findProperty("signingKey") as String?
78-
val signingPassword = findProperty("signingPassword") as String?
79-
useInMemoryPgpKeys(signingKey, signingPassword)
77+
val signingKey = findProperty("signingKey") as String?
78+
val signingPassword = findProperty("signingPassword") as String?
79+
useInMemoryPgpKeys(signingKey, signingPassword)
8080

81-
sign(publishing.publications["mavenJava"])
81+
sign(publishing.publications["mavenJava"])
8282
}
8383

8484
tasks.withType<AbstractArchiveTask>().configureEach {
85-
isPreserveFileTimestamps = false
86-
isReproducibleFileOrder = true
85+
isPreserveFileTimestamps = false
86+
isReproducibleFileOrder = true
8787
}
8888

8989
tasks.create("changelog", GitChangelogTask::class) {
90-
fromRepo = project.rootDir.path
91-
file = File("CHANGELOG.md")
92-
handlebarsHelpers = listOf(
93-
HelperParam("shortHash") { _: Any, options ->
94-
return@HelperParam options.get<String>("hash").substring(0, 7)
95-
},
96-
HelperParam("compare") { _, options ->
97-
val tagNames = options.get<List<Tag>>("tags").map { it.name }
98-
val name = options.get<String>("name")
99-
val prevTagIdx = tagNames.indexOf(name) + 1
100-
val compare = name.takeIf { it != "Unreleased" } ?: "HEAD"
101-
102-
return@HelperParam if (prevTagIdx < tagNames.size) "compare/${tagNames[prevTagIdx]}...$compare"
103-
else "releases/tag/$name"
104-
}
105-
)
106-
107-
doFirst {
108-
templateContent = file("changelog.mustache").readText()
90+
fromRepo = project.rootDir.path
91+
file = File("CHANGELOG.md")
92+
handlebarsHelpers = listOf(
93+
HelperParam("shortHash") { _: Any, options ->
94+
return@HelperParam options.get<String>("hash").substring(0, 7)
95+
},
96+
HelperParam("compare") { _, options ->
97+
val tagNames = options.get<List<Tag>>("tags").map { it.name }
98+
val name = options.get<String>("name")
99+
val prevTagIdx = tagNames.indexOf(name) + 1
100+
val compare = name.takeIf { it != "Unreleased" } ?: "HEAD"
101+
102+
return@HelperParam if (prevTagIdx < tagNames.size) "compare/${tagNames[prevTagIdx]}...$compare"
103+
else "releases/tag/$name"
109104
}
105+
)
106+
107+
doFirst {
108+
templateContent = file("changelog.mustache").readText()
109+
}
110110
}

buildSrc/src/main/kotlin/io.github.nstdio.http.ext.quality-conventions.gradle.kts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,6 @@
1717
import com.github.spotbugs.snom.Effort
1818
import com.github.spotbugs.snom.SpotBugsTask
1919

20-
/*
21-
* Copyright (C) 2022 Edgar Asatryan
22-
*
23-
* Licensed under the Apache License, Version 2.0 (the "License");
24-
* you may not use this file except in compliance with the License.
25-
* You may obtain a copy of the License at
26-
*
27-
* http://www.apache.org/licenses/LICENSE-2.0
28-
*
29-
* Unless required by applicable law or agreed to in writing, software
30-
* distributed under the License is distributed on an "AS IS" BASIS,
31-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32-
* See the License for the specific language governing permissions and
33-
* limitations under the License.
34-
*/
35-
3620
plugins {
3721
jacoco
3822
id("com.github.spotbugs")

0 commit comments

Comments
 (0)