Skip to content

Commit

Permalink
chore: Remove accidentally leaked kotlin stdlib dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
nstdio committed Oct 1, 2022
1 parent c950a5c commit ea66180
Showing 1 changed file with 21 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

import groovy.util.Node
import groovy.util.NodeList
import se.bjurr.gitchangelog.api.model.Tag
import se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask
import se.bjurr.gitchangelog.plugin.gradle.HelperParam
Expand Down Expand Up @@ -57,6 +59,14 @@ publishing {
developerConnection.set("scm:git:[email protected]:nstdio/http-client-ext.git")
url.set("https://github.com/nstdio/http-client-ext")
}

withXml {
val root = asNode()
val nodes = root["dependencies"] as NodeList
if (nodes.isNotEmpty()) {
root.remove(nodes.first() as Node)
}
}
}
}
}
Expand Down Expand Up @@ -90,20 +100,17 @@ tasks.withType<AbstractArchiveTask>().configureEach {
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"
}
)
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()
Expand Down

0 comments on commit ea66180

Please sign in to comment.