mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-10 18:40:15 +08:00
Fix fillBuildConstants
This commit is contained in:
parent
a478b85ba2
commit
657c2ac613
@ -107,23 +107,25 @@ tasks {
|
|||||||
val fillBuildConstants by registering {
|
val fillBuildConstants by registering {
|
||||||
group = "mirai"
|
group = "mirai"
|
||||||
doLast {
|
doLast {
|
||||||
(compileKotlin as KotlinCompile).source.filter { it.name == "MiraiConsole.kt" }.single().let { file ->
|
(compileKotlin as KotlinCompile).source.filter { it.name == "MiraiConsoleBuildConstants.kt" }.single()
|
||||||
file.writeText(file.readText()
|
.let { file ->
|
||||||
.replace(Regex("""val buildDate: Date = Date\((.*)\) //(.*)""")) {
|
file.writeText(
|
||||||
"""
|
file.readText()
|
||||||
|
.replace(Regex("""val buildDate: Date = Date\((.*)\) //(.*)""")) {
|
||||||
|
"""
|
||||||
val buildDate: Date = Date(${System.currentTimeMillis()}L) // ${
|
val buildDate: Date = Date(${System.currentTimeMillis()}L) // ${
|
||||||
SimpleDateFormat("yyyy-MM-dd HH:mm:ss").apply {
|
SimpleDateFormat("yyyy-MM-dd HH:mm:ss").apply {
|
||||||
timeZone = TimeZone.getTimeZone("GMT+8")
|
timeZone = TimeZone.getTimeZone("GMT+8")
|
||||||
}.format(Date())
|
}.format(Date())
|
||||||
}
|
}
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
}
|
}
|
||||||
.replace(Regex("""const val version: String = "(.*)"""")) {
|
.replace(Regex("""const val version: String = "(.*)"""")) {
|
||||||
"""
|
"""
|
||||||
const val version: String = "${Versions.console}"
|
const val version: String = "${Versions.console}"
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user