log remote
This commit is contained in:
parent
3adbce1aff
commit
1286aabb5b
4 changed files with 28 additions and 1 deletions
|
@ -45,6 +45,22 @@ def generateGitBuild = { ->
|
||||||
return stringBuilder.toString()
|
return stringBuilder.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def generateGitRemote = { ->
|
||||||
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
|
try {
|
||||||
|
def stdout = new ByteArrayOutputStream()
|
||||||
|
exec {
|
||||||
|
commandLine 'git', 'remote', 'get-url', 'origin'
|
||||||
|
standardOutput = stdout
|
||||||
|
}
|
||||||
|
String commitObject = stdout.toString().trim()
|
||||||
|
stringBuilder.append(commitObject)
|
||||||
|
} catch (ignored) {
|
||||||
|
stringBuilder.append('NoGitSystemAvailable')
|
||||||
|
}
|
||||||
|
return stringBuilder.toString()
|
||||||
|
}
|
||||||
|
|
||||||
def generateDate = { ->
|
def generateDate = { ->
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
stringBuilder.append((new Date()).format('yyyy.MM.dd-HH:mm'))
|
stringBuilder.append((new Date()).format('yyyy.MM.dd-HH:mm'))
|
||||||
|
@ -67,6 +83,7 @@ android {
|
||||||
version "2.2.3-dev"
|
version "2.2.3-dev"
|
||||||
buildConfigField "String", "VERSION", '"' + version + '"'
|
buildConfigField "String", "VERSION", '"' + version + '"'
|
||||||
buildConfigField "String", "BUILDVERSION", '"' + generateGitBuild() + '-' + generateDate() + '"'
|
buildConfigField "String", "BUILDVERSION", '"' + generateGitBuild() + '-' + generateDate() + '"'
|
||||||
|
buildConfigField "String", "REMOTE", '"' + generateGitRemote()+ '"'
|
||||||
buildConfigField "String", "HEAD", '"' + generateGitBuild() + '"'
|
buildConfigField "String", "HEAD", '"' + generateGitBuild() + '"'
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
// if you change minSdkVersion to less than 11, you need to change executeTask for wear
|
// if you change minSdkVersion to less than 11, you need to change executeTask for wear
|
||||||
|
|
|
@ -125,7 +125,6 @@ public class MainApp extends Application {
|
||||||
try {
|
try {
|
||||||
if (FabricPrivacy.fabricEnabled()) {
|
if (FabricPrivacy.fabricEnabled()) {
|
||||||
Fabric.with(this, new Crashlytics());
|
Fabric.with(this, new Crashlytics());
|
||||||
Crashlytics.setString("BUILDVERSION", BuildConfig.BUILDVERSION);
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Error with Fabric init! " + e);
|
log.error("Error with Fabric init! " + e);
|
||||||
|
@ -137,6 +136,7 @@ public class MainApp extends Application {
|
||||||
|
|
||||||
log.info("Version: " + BuildConfig.VERSION_NAME);
|
log.info("Version: " + BuildConfig.VERSION_NAME);
|
||||||
log.info("BuildVersion: " + BuildConfig.BUILDVERSION);
|
log.info("BuildVersion: " + BuildConfig.BUILDVERSION);
|
||||||
|
log.info("Remote: " + BuildConfig.REMOTE);
|
||||||
|
|
||||||
String extFilesDir = LoggerUtils.getLogDirectory();
|
String extFilesDir = LoggerUtils.getLogDirectory();
|
||||||
File engineeringModeSemaphore = new File(extFilesDir, "engineering_mode");
|
File engineeringModeSemaphore = new File(extFilesDir, "engineering_mode");
|
||||||
|
|
|
@ -222,6 +222,7 @@ public class MaintenancePlugin extends PluginBase {
|
||||||
builder.append("NSCLIENT" + System.lineSeparator());
|
builder.append("NSCLIENT" + System.lineSeparator());
|
||||||
|
|
||||||
builder.append("Build: " + BuildConfig.BUILDVERSION + System.lineSeparator());
|
builder.append("Build: " + BuildConfig.BUILDVERSION + System.lineSeparator());
|
||||||
|
builder.append("Remote: " + BuildConfig.REMOTE + System.lineSeparator());
|
||||||
builder.append("Flavor: " + BuildConfig.FLAVOR + BuildConfig.BUILD_TYPE + System.lineSeparator());
|
builder.append("Flavor: " + BuildConfig.FLAVOR + BuildConfig.BUILD_TYPE + System.lineSeparator());
|
||||||
builder.append(MainApp.gs(R.string.configbuilder_nightscoutversion_label) + " " + NSSettingsStatus.getInstance().nightscoutVersionName + System.lineSeparator());
|
builder.append(MainApp.gs(R.string.configbuilder_nightscoutversion_label) + " " + NSSettingsStatus.getInstance().nightscoutVersionName + System.lineSeparator());
|
||||||
if (MainApp.engineeringMode)
|
if (MainApp.engineeringMode)
|
||||||
|
|
|
@ -111,11 +111,20 @@ public class FabricPrivacy {
|
||||||
if (!fabricEnabled()) return;
|
if (!fabricEnabled()) return;
|
||||||
|
|
||||||
String closedLoopEnabled = MainApp.getConstraintChecker().isClosedLoopAllowed().value() ? "CLOSED_LOOP_ENABLED" : "CLOSED_LOOP_DISABLED";
|
String closedLoopEnabled = MainApp.getConstraintChecker().isClosedLoopAllowed().value() ? "CLOSED_LOOP_ENABLED" : "CLOSED_LOOP_DISABLED";
|
||||||
|
// Size is limited to 36 chars
|
||||||
|
String remote = BuildConfig.REMOTE
|
||||||
|
.replace("https://","")
|
||||||
|
.replace("http://","")
|
||||||
|
.replace(".git", "")
|
||||||
|
.replace(".com/", ":")
|
||||||
|
.replace(".org/", ":")
|
||||||
|
.replace(".net/", ":");
|
||||||
|
|
||||||
MainApp.getFirebaseAnalytics().setUserProperty("Mode", BuildConfig.APPLICATION_ID + "-" + closedLoopEnabled);
|
MainApp.getFirebaseAnalytics().setUserProperty("Mode", BuildConfig.APPLICATION_ID + "-" + closedLoopEnabled);
|
||||||
MainApp.getFirebaseAnalytics().setUserProperty("Language", LocaleHelper.getLanguage(MainApp.instance()));
|
MainApp.getFirebaseAnalytics().setUserProperty("Language", LocaleHelper.getLanguage(MainApp.instance()));
|
||||||
MainApp.getFirebaseAnalytics().setUserProperty("Version", BuildConfig.VERSION);
|
MainApp.getFirebaseAnalytics().setUserProperty("Version", BuildConfig.VERSION);
|
||||||
MainApp.getFirebaseAnalytics().setUserProperty("HEAD", BuildConfig.HEAD);
|
MainApp.getFirebaseAnalytics().setUserProperty("HEAD", BuildConfig.HEAD);
|
||||||
|
MainApp.getFirebaseAnalytics().setUserProperty("Remote", remote);
|
||||||
if (ConfigBuilderPlugin.getPlugin().getActivePump() != null)
|
if (ConfigBuilderPlugin.getPlugin().getActivePump() != null)
|
||||||
MainApp.getFirebaseAnalytics().setUserProperty("Pump", ConfigBuilderPlugin.getPlugin().getActivePump().getClass().getSimpleName());
|
MainApp.getFirebaseAnalytics().setUserProperty("Pump", ConfigBuilderPlugin.getPlugin().getActivePump().getClass().getSimpleName());
|
||||||
if (ConfigBuilderPlugin.getPlugin().getActiveAPS() != null)
|
if (ConfigBuilderPlugin.getPlugin().getActiveAPS() != null)
|
||||||
|
|
Loading…
Reference in a new issue