Commit a98d56b4 authored by Drahomír Karchňák's avatar Drahomír Karchňák

Fixed gradle properties.

parent db117989
......@@ -80,7 +80,6 @@
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="GOOGLEMAPS_APIKEY"/>
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
<meta-data android:name="com.crashlytics.ApiKey" android:value="RMBT_CRASHLYTICS_APIKEY"/>
<meta-data android:name="cz.nic.labs.rmbt.android.test.RMBTBugReport" android:value="RMBT_USE_BUGREPORT"/>
</application>
......
......@@ -49,7 +49,7 @@ dependencies {
task prepareDebugVersion(dependsOn: 'processDebugManifest') {
doLast{
//TODO - Find a better way
// google maps
File manifest = file("${buildDir}/intermediates/manifests/full/debug/AndroidManifest.xml")
String manifestContent = manifest.getText('UTF-8')
......@@ -57,41 +57,12 @@ task prepareDebugVersion(dependsOn: 'processDebugManifest') {
manifestContent = manifestContent.replaceAll(/GOOGLEMAPS_APIKEY/, RMBT_GOOGLEMAPS_APIKEY)
}
manifest.write(manifestContent, 'UTF-8')
// control server
File values = file("${buildDir}/intermediates/res/debug/values/values.xml")
String valuesContent = values.getText('UTF-8')
if (project.hasProperty('RMBT_CONTROL_HOST')) {
valuesContent = valuesContent.replaceAll(/CONTROL_HOST/, RMBT_CONTROL_HOST)
}
if (project.hasProperty('RMBT_CONTROL_IPV4_HOST')) {
valuesContent = valuesContent.replaceAll(/CONTROL_IPV4_HOST/, RMBT_CONTROL_IPV4_HOST)
}
if (project.hasProperty('RMBT_CONTROL_IPV6_HOST')) {
valuesContent = valuesContent.replaceAll(/CONTROL_IPV6_HOST/, RMBT_CONTROL_IPV6_HOST)
}
if (project.hasProperty('RMBT_CONTROL_IPV4_CHECK_HOST')) {
valuesContent = valuesContent.replaceAll(/CONTROL_IPV4_CHECK_HOST/, RMBT_CONTROL_IPV4_CHECK_HOST)
}
if (project.hasProperty('RMBT_CONTROL_IPV6_CHECK_HOST')) {
valuesContent = valuesContent.replaceAll(/CONTROL_IPV6_CHECK_HOST/, RMBT_CONTROL_IPV6_CHECK_HOST)
}
if (project.hasProperty('RMBT_CONTROL_PORT')) {
valuesContent = valuesContent.replaceAll(/RMBT_CONTROL_PORT/, RMBT_CONTROL_PORT)
}
if (project.hasProperty('RMBT_CONTROL_SSL')) {
valuesContent = valuesContent.replaceAll(/RMBT_CONTROL_SSL/, RMBT_CONTROL_SSL)
}
if (project.hasProperty('RMBT_QOS_SSL')) {
valuesContent = valuesContent.replaceAll(/RMBT_QOS_SSL/, RMBT_QOS_SSL)
}
values.write(valuesContent, 'UTF-8')
}
}
task prepareReleaseVersion(dependsOn: 'processReleaseManifest') {
doLast{
//TODO - Find a better way
// google maps
File manifest = file("${buildDir}/intermediates/manifests/full/release/AndroidManifest.xml")
String manifestContent = manifest.getText('UTF-8')
......@@ -99,57 +70,21 @@ task prepareReleaseVersion(dependsOn: 'processReleaseManifest') {
manifestContent = manifestContent.replaceAll(/GOOGLEMAPS_APIKEY/, RMBT_GOOGLEMAPS_APIKEY)
}
manifest.write(manifestContent, 'UTF-8')
// control server
File values = file("${buildDir}/intermediates/res/release/values/values.xml")
String valuesContent = values.getText('UTF-8')
if (project.hasProperty('RMBT_CONTROL_HOST')) {
valuesContent = valuesContent.replaceAll(/CONTROL_HOST/, RMBT_CONTROL_HOST)
}
if (project.hasProperty('RMBT_CONTROL_IPV4_HOST')) {
valuesContent = valuesContent.replaceAll(/CONTROL_IPV4_HOST/, RMBT_CONTROL_IPV4_HOST)
}
if (project.hasProperty('RMBT_CONTROL_IPV6_HOST')) {
valuesContent = valuesContent.replaceAll(/CONTROL_IPV6_HOST/, RMBT_CONTROL_IPV6_HOST)
}
if (project.hasProperty('RMBT_CONTROL_IPV4_CHECK_HOST')) {
valuesContent = valuesContent.replaceAll(/CONTROL_IPV4_CHECK_HOST/, RMBT_CONTROL_IPV4_CHECK_HOST)
}
if (project.hasProperty('RMBT_CONTROL_IPV6_CHECK_HOST')) {
valuesContent = valuesContent.replaceAll(/CONTROL_IPV6_CHECK_HOST/, RMBT_CONTROL_IPV6_CHECK_HOST)
}
if (project.hasProperty('RMBT_CONTROL_PORT')) {
valuesContent = valuesContent.replaceAll(/RMBT_CONTROL_PORT/, RMBT_CONTROL_PORT)
}
if (project.hasProperty('RMBT_CONTROL_SSL')) {
valuesContent = valuesContent.replaceAll(/RMBT_CONTROL_SSL/, RMBT_CONTROL_SSL)
}
if (project.hasProperty('RMBT_QOS_SSL')) {
valuesContent = valuesContent.replaceAll(/RMBT_QOS_SSL/, RMBT_QOS_SSL)
}
values.write(valuesContent, 'UTF-8')
}
}
//TODO - Find a better way
//task prepareCrashlyticsDebug(dependsOn: 'processDebugManifest') {
// doLast{
// // api key
// File manifest = file("${buildDir}/intermediates/manifests/full/debug/AndroidManifest.xml")
// String manifestContent = manifest.getText('UTF-8')
// if (project.hasProperty('RMBT_CRASHLYTICS_APIKEY')) {
// manifestContent = manifestContent.replaceAll(/RMBT_CRASHLYTICS_APIKEY/, RMBT_CRASHLYTICS_APIKEY)
// }
//
// // bug reporting
// if (project.hasProperty('RMBT_USE_BUGREPORT')) {
// manifestContent = manifestContent.replaceAll(/RMBT_USE_BUGREPORT/, RMBT_USE_BUGREPORT)
// }
// manifest.write(manifestContent, 'UTF-8')
//
// // api secret
// if (project.hasProperty('RMBT_CRASHLYTICS_APISECRET')) {
// File crashlytics = file("crashlytics.properties")
// crashlytics.write(/apiSecret=/ + RMBT_CRASHLYTICS_APISECRET, 'UTF-8')
// }
// }
//}
......@@ -158,20 +93,12 @@ task prepareReleaseVersion(dependsOn: 'processReleaseManifest') {
// // api key
// File manifest = file("${buildDir}/intermediates/manifests/full/release/AndroidManifest.xml")
// String manifestContent = manifest.getText('UTF-8')
// if (project.hasProperty('RMBT_CRASHLYTICS_APIKEY')) {
// manifestContent = manifestContent.replaceAll(/RMBT_CRASHLYTICS_APIKEY/, RMBT_CRASHLYTICS_APIKEY)
// }
//
// // bug reporting
// if (project.hasProperty('RMBT_USE_BUGREPORT')) {
// manifestContent = manifestContent.replaceAll(/RMBT_USE_BUGREPORT/, RMBT_USE_BUGREPORT)
// }
// manifest.write(manifestContent, 'UTF-8')
//
// // api secret
// if (project.hasProperty('RMBT_CRASHLYTICS_APISECRET')) {
// File crashlytics = file("crashlytics.properties")
// crashlytics.write(/apiSecret=/ + RMBT_CRASHLYTICS_APISECRET, 'UTF-8')
// }
// }
//}
......@@ -185,6 +112,7 @@ tasks.whenTaskAdded { task ->
task.dependsOn prepareReleaseVersion
}
//TODO - Is this necessary?
//tasks.whenTaskAdded { task ->
// if (task.name == 'crashlyticsGenerateResourcesDebug')
// task.dependsOn prepareCrashlyticsDebug
......@@ -247,13 +175,42 @@ android {
buildTypes.all { buildType ->
buildConfigField "String", "CLIENT_SECRET", project.hasProperty('RMBT_CLIENT_SECRET') ? String.format("\"%s\"", RMBT_CLIENT_SECRET) : "null"
// ext.enableCrashlytics = project.hasProperty('RMBT_CRASHLYTICS_APIKEY')
}
defaultConfig {
targetSdkVersion 19
versionName getVersionNameFromGit()
versionCode getVersionCodeFromGit()
if(project.hasProperty('RMBT_CONTROL_IPV4_HOST')) {
resValue 'string', 'default_control_host', "${RMBT_CONTROL_IPV4_HOST}"
resValue 'string', 'default_control_host_ipv4_only', project.property('RMBT_CONTROL_IPV4_HOST')
}
if(project.hasProperty('RMBT_CONTROL_IPV6_HOST')) {
resValue 'string', 'default_control_host_ipv6_only', project.property('RMBT_CONTROL_IPV6_HOST')
}
if(project.hasProperty('RMBT_CONTROL_IPV4_CHECK_HOST')) {
resValue 'string', 'default_control_check_ipv4_url', project.property('RMBT_CONTROL_IPV4_CHECK_HOST')
}
if(project.hasProperty('RMBT_CONTROL_IPV6_CHECK_HOST')) {
resValue 'string', 'default_control_check_ipv6_url', project.property('RMBT_CONTROL_IPV6_CHECK_HOST')
}
if (project.hasProperty('RMBT_CONTROL_PORT')) {
resValue 'string', 'default_control_port', project.property('RMBT_CONTROL_PORT')
}
if (project.hasProperty('RMBT_CONTROL_SSL')) {
resValue 'string', 'default_control_ssl', project.property('RMBT_CONTROL_SSL')
}
if (project.hasProperty('RMBT_QOS_SSL')) {
resValue 'string', 'default_qos_ssl', project.property('RMBT_QOS_SSL')
}
}
lintOptions {
......
......@@ -21,16 +21,4 @@
<integer name="default_loop_min_delay">30</integer>
<integer name="default_loop_max_delay">900</integer>
<integer name="default_loop_max_movement">250</integer>
<string translatable="false" name="default_control_host">CONTROL_IPV4_HOST</string>
<string translatable="false" name="default_control_host_ipv4_only">CONTROL_IPV4_HOST</string>
<string translatable="false" name="default_control_host_ipv6_only">CONTROL_IPV6_HOST</string>
<string translatable="false" name="default_control_check_ipv4_url">CONTROL_IPV4_CHECK_HOST</string>
<string translatable="false" name="default_control_check_ipv6_url">CONTROL_IPV6_CHECK_HOST</string>
<string translatable="false" name="default_control_port">RMBT_CONTROL_PORT</string>
<string translatable="false" name="default_control_ssl">RMBT_CONTROL_SSL</string>
<string translatable="false" name="default_qos_ssl">RMBT_QOS_SSL</string>
</resources>
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