Skip to content

Commit

Permalink
chore: reading writekey and dataplane url from local.properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Desu Sai Venkat committed Apr 12, 2023
1 parent f5259f0 commit 10ccdbc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions sample-kotlin/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/build
local.properties
11 changes: 10 additions & 1 deletion sample-kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,24 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

Properties properties = new Properties()
File localPropertiesFile = new File(project.projectDir, "local.properties")
if (localPropertiesFile.exists()) {
properties.load(localPropertiesFile.newDataInputStream())
}

android {
compileSdkVersion 33
defaultConfig {
applicationId "com.rudderstack.test.android3"
applicationId "com.desu.venkat.android"
minSdkVersion 19
targetSdkVersion 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildConfigField("String", "DATA_PLANE_URL", properties.getProperty('dataplaneUrl', '\"https://hosted.rudderlabs.com\"'))
buildConfigField("String", "CONTROL_PLANE_URL", properties.getProperty('controlplaneUrl', '\"https://api.rudderstack.com\"'))
buildConfigField("String", "WRITE_KEY", properties.getProperty('writeKey', '\"\"'))
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class MainApplication : Application() {
AppsFlyerLib.getInstance().start(this);
rudderClient = RudderClient.getInstance(
this,
WRITE_KEY,
BuildConfig.WRITE_KEY,
RudderConfig.Builder()
.withDataPlaneUrl(DATA_PLANE_URL)
.withDataPlaneUrl(BuildConfig.DATA_PLANE_URL)
.withFactory(AppsFlyerIntegrationFactory.FACTORY)
.withLogLevel(RudderLogger.RudderLogLevel.DEBUG)
.build()
Expand Down

0 comments on commit 10ccdbc

Please sign in to comment.