-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: NPE when no
Content-Encoding
header present.
- Loading branch information
Showing
13 changed files
with
354 additions
and
310 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,92 +19,92 @@ import se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask | |
import se.bjurr.gitchangelog.plugin.gradle.HelperParam | ||
|
||
plugins { | ||
signing | ||
`maven-publish` | ||
signing | ||
`maven-publish` | ||
|
||
id("io.github.gradle-nexus.publish-plugin") | ||
id("se.bjurr.gitchangelog.git-changelog-gradle-plugin") | ||
id("io.github.gradle-nexus.publish-plugin") | ||
id("se.bjurr.gitchangelog.git-changelog-gradle-plugin") | ||
} | ||
|
||
publishing { | ||
publications { | ||
create<MavenPublication>("mavenJava") { | ||
from(components["java"]) | ||
|
||
pom { | ||
name.set("JDK Http Client Extensions") | ||
description.set("The set of useful extensions for JDK HttpClient.") | ||
url.set("https://github.com/nstdio/http-client-ext") | ||
|
||
licenses { | ||
license { | ||
name.set("The Apache License, Version 2.0") | ||
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id.set("nstdio") | ||
name.set("Edgar Asatryan") | ||
email.set("[email protected]") | ||
} | ||
} | ||
|
||
scm { | ||
connection.set("scm:git:[email protected]:nstdio/http-client-ext.git") | ||
developerConnection.set("scm:git:[email protected]:nstdio/http-client-ext.git") | ||
url.set("https://github.com/nstdio/http-client-ext") | ||
} | ||
} | ||
publications { | ||
create<MavenPublication>("mavenJava") { | ||
from(components["java"]) | ||
|
||
pom { | ||
name.set("JDK Http Client Extensions") | ||
description.set("The set of useful extensions for JDK HttpClient.") | ||
url.set("https://github.com/nstdio/http-client-ext") | ||
|
||
licenses { | ||
license { | ||
name.set("The Apache License, Version 2.0") | ||
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id.set("nstdio") | ||
name.set("Edgar Asatryan") | ||
email.set("[email protected]") | ||
} | ||
} | ||
|
||
scm { | ||
connection.set("scm:git:[email protected]:nstdio/http-client-ext.git") | ||
developerConnection.set("scm:git:[email protected]:nstdio/http-client-ext.git") | ||
url.set("https://github.com/nstdio/http-client-ext") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
nexusPublishing { | ||
repositories { | ||
sonatype { | ||
val baseUri = uri("https://s01.oss.sonatype.org") | ||
nexusUrl.set(baseUri.resolve("/service/local/")) | ||
snapshotRepositoryUrl.set(baseUri.resolve("/content/repositories/snapshots/")) | ||
} | ||
repositories { | ||
sonatype { | ||
val baseUri = uri("https://s01.oss.sonatype.org") | ||
nexusUrl.set(baseUri.resolve("/service/local/")) | ||
snapshotRepositoryUrl.set(baseUri.resolve("/content/repositories/snapshots/")) | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
isRequired = (version as String).endsWith("SNAPSHOT") | ||
isRequired = (version as String).endsWith("SNAPSHOT") | ||
|
||
val signingKey = findProperty("signingKey") as String? | ||
val signingPassword = findProperty("signingPassword") as String? | ||
useInMemoryPgpKeys(signingKey, signingPassword) | ||
val signingKey = findProperty("signingKey") as String? | ||
val signingPassword = findProperty("signingPassword") as String? | ||
useInMemoryPgpKeys(signingKey, signingPassword) | ||
|
||
sign(publishing.publications["mavenJava"]) | ||
sign(publishing.publications["mavenJava"]) | ||
} | ||
|
||
tasks.withType<AbstractArchiveTask>().configureEach { | ||
isPreserveFileTimestamps = false | ||
isReproducibleFileOrder = true | ||
isPreserveFileTimestamps = false | ||
isReproducibleFileOrder = true | ||
} | ||
|
||
tasks.create("changelog", GitChangelogTask::class) { | ||
fromRepo = project.rootDir.path | ||
file = File("CHANGELOG.md") | ||
handlebarsHelpers = listOf( | ||
HelperParam("shortHash") { _: Any, options -> | ||
return@HelperParam options.get<String>("hash").substring(0, 7) | ||
}, | ||
HelperParam("compare") { _, options -> | ||
val tagNames = options.get<List<Tag>>("tags").map { it.name } | ||
val name = options.get<String>("name") | ||
val prevTagIdx = tagNames.indexOf(name) + 1 | ||
val compare = name.takeIf { it != "Unreleased" } ?: "HEAD" | ||
|
||
return@HelperParam if (prevTagIdx < tagNames.size) "compare/${tagNames[prevTagIdx]}...$compare" | ||
else "releases/tag/$name" | ||
} | ||
) | ||
|
||
doFirst { | ||
templateContent = file("changelog.mustache").readText() | ||
fromRepo = project.rootDir.path | ||
file = File("CHANGELOG.md") | ||
handlebarsHelpers = listOf( | ||
HelperParam("shortHash") { _: Any, options -> | ||
return@HelperParam options.get<String>("hash").substring(0, 7) | ||
}, | ||
HelperParam("compare") { _, options -> | ||
val tagNames = options.get<List<Tag>>("tags").map { it.name } | ||
val name = options.get<String>("name") | ||
val prevTagIdx = tagNames.indexOf(name) + 1 | ||
val compare = name.takeIf { it != "Unreleased" } ?: "HEAD" | ||
|
||
return@HelperParam if (prevTagIdx < tagNames.size) "compare/${tagNames[prevTagIdx]}...$compare" | ||
else "releases/tag/$name" | ||
} | ||
) | ||
|
||
doFirst { | ||
templateContent = file("changelog.mustache").readText() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.