diff --git a/buildSrc/src/main/kotlin/io.github.nstdio.http.ext.publish-conventions.gradle.kts b/buildSrc/src/main/kotlin/io.github.nstdio.http.ext.publish-conventions.gradle.kts index b1feba6..2465a6e 100644 --- a/buildSrc/src/main/kotlin/io.github.nstdio.http.ext.publish-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/io.github.nstdio.http.ext.publish-conventions.gradle.kts @@ -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 @@ -57,6 +59,14 @@ publishing { developerConnection.set("scm:git:git@github.com: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) + } + } } } } @@ -90,20 +100,17 @@ tasks.withType().configureEach { tasks.create("changelog", GitChangelogTask::class) { fromRepo = project.rootDir.path file = File("CHANGELOG.md") - handlebarsHelpers = listOf( - HelperParam("shortHash") { _: Any, options -> - return@HelperParam options.get("hash").substring(0, 7) - }, - HelperParam("compare") { _, options -> - val tagNames = options.get>("tags").map { it.name } - val name = options.get("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("hash").substring(0, 7) + }, HelperParam("compare") { _, options -> + val tagNames = options.get>("tags").map { it.name } + val name = options.get("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()