File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
gradle-conventions/src/main/kotlin/util/other Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import org.gradle.kotlin.dsl.provideDelegate
1010import java.util.Properties
1111import java.util.concurrent.atomic.AtomicReference
1212import kotlin.io.path.Path
13+ import kotlin.io.path.exists
1314import kotlin.io.path.inputStream
1415
1516private val ref = AtomicReference <Properties >()
@@ -19,7 +20,13 @@ fun Project.localProperties(): Properties {
1920 ref.compareAndSet(null , Properties ().apply {
2021 val globalRootDir: String by extra
2122
22- load(Path (globalRootDir, " local.properties" ).inputStream())
23+ val filepath = Path (globalRootDir, " local.properties" )
24+
25+ if (! filepath.exists()) {
26+ return @apply
27+ }
28+
29+ load(filepath.inputStream())
2330 })
2431 }
2532
You can’t perform that action at this time.
0 commit comments