Skip to content

Commit

Permalink
access base url from local.properties to prevent logging in VCS
Browse files Browse the repository at this point in the history
  • Loading branch information
Debashish Kundu committed Dec 24, 2023
1 parent 3feca27 commit 3dbc4d9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import java.util.Properties

@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
plugins {
alias(libs.plugins.com.android.application)
Expand All @@ -24,8 +26,14 @@ android {
useSupportLibrary = true
}

// TODO: Set Base URL
buildConfigField("String", "BASE_URL", "\"https://dummyjson.com/\"")
val localPropertiesFile = rootProject.file("local.properties")
val localProperties = Properties()
localProperties.load(localPropertiesFile.inputStream())

/* TODO: Add base URL in local.properties file as:-
* BASE_URL=https://dummyjson.com/
*/
buildConfigField("String", "BASE_URL", "\"${localProperties.getProperty("BASE_URL")}\"")
}

buildTypes {
Expand Down

0 comments on commit 3dbc4d9

Please sign in to comment.