We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72de909 commit fdbd9c2Copy full SHA for fdbd9c2
core/network/build.gradle.kts
@@ -1,4 +1,5 @@
1
import java.io.FileInputStream
2
+import java.io.FileNotFoundException
3
import java.util.Properties
4
5
@Suppress("DSL_SCOPE_VIOLATION")
@@ -42,7 +43,10 @@ dependencies {
42
43
44
fun getApiKey(propertyKey: String): String {
45
val propFile = rootProject.file("./local.properties")
46
+ if (!propFile.exists()) {
47
+ throw FileNotFoundException("local.properties file not found")
48
+ }
49
val properties = Properties()
50
properties.load(FileInputStream(propFile))
- return properties.getProperty(propertyKey)
51
+ return properties.getProperty(propertyKey) ?: throw IllegalArgumentException("Property $propertyKey not found in local.properties file")
52
}
0 commit comments