mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-05 13:52:27 +08:00
[build] Fix build when local.properties
not found
This commit is contained in:
parent
f87c142a69
commit
eb892da093
@ -31,7 +31,7 @@ private lateinit var localProperties: Properties
|
|||||||
private fun Project.loadLocalPropertiesIfAbsent() {
|
private fun Project.loadLocalPropertiesIfAbsent() {
|
||||||
if (::localProperties.isInitialized) return
|
if (::localProperties.isInitialized) return
|
||||||
localProperties = Properties().apply {
|
localProperties = Properties().apply {
|
||||||
rootProject.projectDir.resolve("local.properties").bufferedReader().use {
|
rootProject.projectDir.resolve("local.properties").takeIf { it.exists() }?.bufferedReader()?.use {
|
||||||
load(it)
|
load(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ rootProject.name = "mirai"
|
|||||||
|
|
||||||
|
|
||||||
val localProperties = Properties().apply {
|
val localProperties = Properties().apply {
|
||||||
rootProject.projectDir.resolve("local.properties").bufferedReader().use {
|
rootProject.projectDir.resolve("local.properties").takeIf { it.exists() }?.bufferedReader()?.use {
|
||||||
load(it)
|
load(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user