send HEAD to fabric

This commit is contained in:
Milos Kozak 2018-08-27 20:19:30 +02:00
parent bb18fad654
commit 980e4998e2
2 changed files with 8 additions and 5 deletions

View file

@ -29,9 +29,7 @@ repositories {
}
def generateGitBuild = { ->
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append('"')
try {
def stdout = new ByteArrayOutputStream()
exec {
@ -43,9 +41,12 @@ def generateGitBuild = { ->
} catch (ignored) {
stringBuilder.append('NoGitSystemAvailable')
}
stringBuilder.append('-')
return stringBuilder.toString()
}
def generateDate = { ->
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append((new Date()).format('yyyy.MM.dd-HH:mm'))
stringBuilder.append('"')
return stringBuilder.toString()
}
@ -64,7 +65,8 @@ android {
versionCode 1500
version "2.0f-dev"
buildConfigField "String", "VERSION", '"' + version + '"'
buildConfigField "String", "BUILDVERSION", generateGitBuild()
buildConfigField "String", "BUILDVERSION", '"' + generateGitBuild() + '-' + generateDate() + '"'
buildConfigField "String", "HEAD", '"' + generateGitBuild() + '"'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
ndk {

View file

@ -109,6 +109,7 @@ public class FabricPrivacy {
private static void uploadPluginStats() {
CustomEvent pluginStats = new CustomEvent("PluginStats");
pluginStats.putCustomAttribute("version", BuildConfig.VERSION);
pluginStats.putCustomAttribute("HEAD", BuildConfig.HEAD);
for (PluginBase plugin : MainApp.getPluginsList()) {
if (!plugin.pluginDescription.alwaysEnabled) {
if (plugin.isEnabled(plugin.getType()))