Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ plugins {
id 'de.fuerstenau.buildconfig' version '1.1.8'
}



apply plugin: "idea"
apply plugin: "java"
apply plugin: "kotlin"
Expand All @@ -25,16 +27,33 @@ apply plugin: "com.google.protobuf"
apply plugin: "org.junit.platform.gradle.plugin"

buildConfig {
ext.environment = project.hasProperty('env') &&
env == 'production' ? 'prod' : 'dev'

clsName = 'BuildConfig'
packageName = 'app'

// API.
def apiBasePath = 'https://staging.eng.sourcerer.io/api/commit'
if (ext.environment == 'prod') {
apiBasePath = 'https://sourcerer.io/api/commit'
}
apiBasePath = project.hasProperty('api') ? api : apiBasePath

buildConfigField 'String', 'API_BASE_PATH', apiBasePath

// Common.
buildConfigField 'String', 'PROFILE_URL', 'https://sourcerer.io/'

// App version.
buildConfigField 'int', 'VERSION_CODE', '1'
buildConfigField 'String', 'VERSION', '0.0.1'
buildConfigField 'String', 'PROFILE_URL', 'https://sourcerer.io/'
buildConfigField 'String', 'API_BASE_URL',
'https://staging.eng.sourcerer.io/api/commit'

// Google Analytics.
buildConfigField 'String', 'GA_BASE_PATH', 'http://www.google-analytics.com'
buildConfigField 'String', 'GA_TRACKING_ID', 'UA-107129190-2'
buildConfigField 'boolean', 'IS_GA_ENABLED', 'true'

buildConfig
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/app/api/ServerApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ServerApi (private val configurator: Configurator) : Api {
}

init {
fuelManager.basePath = BuildConfig.API_BASE_URL
fuelManager.basePath = BuildConfig.API_BASE_PATH
fuelManager.addRequestInterceptor { cookieRequestInterceptor() }
fuelManager.addResponseInterceptor { cookieResponseInterceptor() }
}
Expand Down