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
10
10
import java.util.Properties
11
11
import java.util.concurrent.atomic.AtomicReference
12
12
import kotlin.io.path.Path
13
+ import kotlin.io.path.exists
13
14
import kotlin.io.path.inputStream
14
15
15
16
private val ref = AtomicReference <Properties >()
@@ -19,7 +20,13 @@ fun Project.localProperties(): Properties {
19
20
ref.compareAndSet(null , Properties ().apply {
20
21
val globalRootDir: String by extra
21
22
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())
23
30
})
24
31
}
25
32
You can’t perform that action at this time.
0 commit comments