Fix fillBuildConstants

This commit is contained in:
Him188 2020-08-20 12:52:41 +08:00
parent a478b85ba2
commit 657c2ac613

View File

@ -107,8 +107,10 @@ 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 ->
file.writeText(
file.readText()
.replace(Regex("""val buildDate: Date = Date\((.*)\) //(.*)""")) { .replace(Regex("""val buildDate: Date = Date\((.*)\) //(.*)""")) {
""" """
val buildDate: Date = Date(${System.currentTimeMillis()}L) // ${ val buildDate: Date = Date(${System.currentTimeMillis()}L) // ${