1
0
mirror of https://github.com/mamoe/mirai.git synced 2025-04-17 09:09:23 +08:00

Fix updateSnapshotVersion for updated Versions template

This commit is contained in:
Him188 2021-12-27 16:57:33 +00:00
parent 1cd354a7e3
commit 1f9484b2e4
2 changed files with 7 additions and 4 deletions
buildSrc/src/main/kotlin
ci-release-helper

View File

@ -14,7 +14,8 @@ import org.gradle.kotlin.dsl.exclude
import org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler
object Versions {
val project = System.getenv("mirai.build.project.version") ?: "2.10.0-RC"
val project = System.getenv("mirai.build.project.version")
?: /*PROJECT_VERSION_START*/"2.10.0-RC-null-1cd354a7"/*PROJECT_VERSION_END*/
val core = project
val console = project
@ -55,7 +56,8 @@ object Versions {
const val yamlkt = "0.10.2"
const val intellijGradlePlugin = "1.3.0"
// const val kotlinIntellijPlugin = "211-1.5.20-release-284-IJ7442.40" // keep to newest as kotlinCompiler
// const val kotlinIntellijPlugin = "211-1.5.20-release-284-IJ7442.40" // keep to newest as kotlinCompiler
const val intellij = "2021.3" // don't update easily unless you want your disk space -= 500MB
}

View File

@ -28,8 +28,9 @@ tasks.register("updateSnapshotVersion") {
doLast {
rootProject.file("buildSrc/src/main/kotlin/Versions.kt").run {
var text = readText()
check(text.indexOf("project = \"${project.version}\"") != -1) { "Cannot find \"project = \\\"${project.version}\\\"\"" }
text = text.replace("project = \"${project.version}\"", "project = \"${snapshotVersion}\"")
val template = { version: Any? -> "/*PROJECT_VERSION_START*/\"${version}\"/*PROJECT_VERSION_END*/" }
check(text.indexOf(template(project.version)) != -1) { "Cannot find ${template(project.version)}" }
text = text.replace(template(project.version), template(snapshotVersion))
writeText(text)
}
}