@@ -19,92 +19,92 @@ import se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask
19
19
import se.bjurr.gitchangelog.plugin.gradle.HelperParam
20
20
21
21
plugins {
22
- signing
23
- `maven- publish`
22
+ signing
23
+ `maven- publish`
24
24
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" )
27
27
}
28
28
29
29
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
-
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
+ }
60
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
+ }
61
60
}
61
+ }
62
62
}
63
63
64
64
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/" ))
71
70
}
71
+ }
72
72
}
73
73
74
74
signing {
75
- isRequired = (version as String ).endsWith(" SNAPSHOT" )
75
+ isRequired = (version as String ).endsWith(" SNAPSHOT" )
76
76
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)
80
80
81
- sign(publishing.publications[" mavenJava" ])
81
+ sign(publishing.publications[" mavenJava" ])
82
82
}
83
83
84
84
tasks.withType<AbstractArchiveTask >().configureEach {
85
- isPreserveFileTimestamps = false
86
- isReproducibleFileOrder = true
85
+ isPreserveFileTimestamps = false
86
+ isReproducibleFileOrder = true
87
87
}
88
88
89
89
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 "
109
104
}
105
+ )
106
+
107
+ doFirst {
108
+ templateContent = file(" changelog.mustache" ).readText()
109
+ }
110
110
}
0 commit comments