代码拉取完成,页面将自动刷新
import java.time.Duration
plugins {
id("io.github.gradle-nexus.publish-plugin")
id("otel.spotless-conventions")
}
apply(from = "version.gradle.kts")
nexusPublishing {
packageGroup.set("io.opentelemetry")
repositories {
sonatype {
username.set(System.getenv("SONATYPE_USER"))
password.set(System.getenv("SONATYPE_KEY"))
}
}
connectTimeout.set(Duration.ofMinutes(5))
clientTimeout.set(Duration.ofMinutes(5))
transitionCheckOptions {
// We have many artifacts so Maven Central takes a long time on its compliance checks. This sets
// the timeout for waiting for the repository to close to a comfortable 50 minutes.
maxRetries.set(300)
delayBetween.set(Duration.ofSeconds(10))
}
}
// The BOM projects register dependent tasks that actually do the generating.
tasks.register("generateBuildSubstitutions") {
group = "publishing"
description = "Generate a code snippet that can be copy-pasted for use in composite builds."
}
subprojects {
group = "io.opentelemetry"
}
tasks {
register("updateVersionInDocs") {
group = "documentation"
doLast {
val version = findProperty("release.version")
val versionParts = version.toString().split('.')
val minorVersionNumber = Integer.parseInt(versionParts[1])
val nextSnapshot = "${versionParts[0]}.${minorVersionNumber + 1}.0-SNAPSHOT"
val readme = file("README.md")
if (readme.exists()) {
val readmeText = readme.readText()
val updatedText = readmeText
.replace("""<version>\d+\.\d+\.\d+</version>""".toRegex(), "<version>$version</version>")
.replace("""<version>\d+\.\d+\.\d+-SNAPSHOT</version>""".toRegex(), "<version>$nextSnapshot</version>")
.replace("""(implementation.*io\.opentelemetry:.*:)(\d+\.\d+\.\d+)(?!-SNAPSHOT)(.*)""".toRegex(), "\$1${version}\$3")
.replace("""(implementation.*io\.opentelemetry:.*:)(\d+\.\d+\.\d+-SNAPSHOT)(.*)""".toRegex(), "\$1${nextSnapshot}\$3")
.replace("""<!--VERSION_STABLE-->.*<!--/VERSION_STABLE-->""".toRegex(), "<!--VERSION_STABLE-->$version<!--/VERSION_STABLE-->")
.replace("""<!--VERSION_UNSTABLE-->.*<!--/VERSION_UNSTABLE-->""".toRegex(), "<!--VERSION_UNSTABLE-->$version-alpha<!--/VERSION_UNSTABLE-->")
readme.writeText(updatedText)
}
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。