Commit fd0a401a authored by Matyáš Latner's avatar Matyáš Latner

#653 Use production server only on master branch

parent af677155
......@@ -67,6 +67,8 @@ allprojects {
assetsDebugURLPart = onMaster() ? '' : 'debug/'
assetsDownloadUrl = project.hasProperty("TABLEXIA_ASSETS_DOWNLOAD_URL") ? ("${TABLEXIA_ASSETS_DOWNLOAD_URL}/${assetsDebugURLPart}") : "<NO_URL_CONFIGURED>/"
assetsUploadURL = (project.hasProperty("TABLEXIA_ASSETS_UPLOAD_USER") && project.hasProperty("TABLEXIA_ASSETS_UPLOAD_URL")) ? "${TABLEXIA_ASSETS_UPLOAD_USER}@${TABLEXIA_ASSETS_UPLOAD_URL}/${assetsDebugURLPart}" : "<NO_URL_CONFIGURED>/"
serverFallbackHost = "<NO_SERVER_HOST>"
serverHost = onMaster() ? getPropertyValueOrFallbackValue("TABLEXIA_SERVER_HOST_PRODUCTION", serverFallbackHost) : getPropertyValueOrFallbackValue("TABLEXIA_SERVER_HOST_DEBUG", serverFallbackHost)
tablexiaVersionName = getVersionNameFromGit(TABLEXIA_GIT_PATH)
tablexiaVersionCode = getVersionCodeFromGit(TABLEXIA_GIT_PATH)
tablexiaModelVersionName = getVersionNameFromGit(MODEL_GIT_PATH)
......@@ -278,6 +280,10 @@ task processAssets(dependsOn: [':util:checksum:runChecksum', ':util:checksum:run
}
}
def getPropertyValueOrFallbackValue(String key, String fallbackValue) {
return project.hasProperty(key) ? project.getProperties().get(key) : fallbackValue
}
def getTablexiaAppName() {
if (onMaster()) {
return "${project.appName}"
......
......@@ -61,7 +61,7 @@ task writeTablexiaBuildConfig {
" public final static String ASSETS_CHECKSUM = \"${getMapConvertedToString(rootProject.ext.assetsChecksum)}\";\n" +
" public final static String TABLEXIA_ASSETS_URL = \"${project.assetsDownloadUrl}\";\n" +
" public final static String TABLEXIA_SERVER_PROTOCOL = ${project.hasProperty('TABLEXIA_SERVER_PROTOCOL') ? "\"$TABLEXIA_SERVER_PROTOCOL\"" : "null"};\n" +
" public final static String TABLEXIA_SERVER_HOST = ${project.hasProperty('TABLEXIA_SERVER_HOST') ? "\"$TABLEXIA_SERVER_HOST\"" : "null"};\n" +
" public final static String TABLEXIA_SERVER_HOST = \"${project.serverHost}\";\n" +
" public final static Integer TABLEXIA_SERVER_PORT = ${project.hasProperty('TABLEXIA_SERVER_PORT') ? "$TABLEXIA_SERVER_PORT" : "null"};\n" +
" public final static String TABLEXIA_SERVER_SECRET = ${project.hasProperty('TABLEXIA_SERVER_SECRET') ? "\"$TABLEXIA_SERVER_SECRET\"" : "null"};\n" +
" public final static String SENTRY_DSN_FALLBACK = \"${project.sentryDSNFallbackValue}\";\n" +
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment