@@ -19,92 +19,92 @@ import se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask
1919import se.bjurr.gitchangelog.plugin.gradle.HelperParam
2020
2121plugins {
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
2929publishing {
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- 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+ 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
6464nexusPublishing {
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
7474signing {
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
8484tasks.withType<AbstractArchiveTask >().configureEach {
85- isPreserveFileTimestamps = false
86- isReproducibleFileOrder = true
85+ isPreserveFileTimestamps = false
86+ isReproducibleFileOrder = true
8787}
8888
8989tasks.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}
0 commit comments