build.gradle.kts :app, :core:libraries

This commit is contained in:
Milos Kozak 2023-10-11 14:19:56 +02:00
parent f41a62c611
commit 2c9ce06043
8 changed files with 103 additions and 369 deletions

View file

@ -1,279 +0,0 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
id 'kotlin-allopen'
id 'kotlinx-serialization'
id 'com.google.gms.google-services'
id 'com.google.firebase.crashlytics'
}
apply from: "${project.rootDir}/core/main/android_dependencies.gradle"
apply from: "${project.rootDir}/core/main/jacoco_global.gradle"
repositories {
mavenCentral()
google()
}
def generateGitBuild = { ->
StringBuilder stringBuilder = new StringBuilder()
try {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--always'
standardOutput = stdout
}
String commitObject = stdout.toString().trim()
stringBuilder.append(commitObject)
} catch (ignored) {
stringBuilder.append('NoGitSystemAvailable')
}
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 = { ->
StringBuilder stringBuilder = new StringBuilder()
// showing only date prevents app to rebuild everytime
stringBuilder.append((new Date()).format('yyyy.MM.dd'))
return stringBuilder.toString()
}
def isMaster = { ->
return !version.contains('-')
}
def gitAvailable = { ->
StringBuilder stringBuilder = new StringBuilder()
try {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', '--version'
standardOutput = stdout
}
String commitObject = stdout.toString().trim()
stringBuilder.append(commitObject)
} catch (ignored) {
return false // NoGitSystemAvailable
}
return !stringBuilder.toString().isEmpty()
}
def allCommitted = { ->
StringBuilder stringBuilder = new StringBuilder()
try {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'status', '-s'
standardOutput = stdout
}
// ignore all changes done in .idea/codeStyles
String cleanedList = stdout.toString().replaceAll(/(?m)^\s*(M|A|D|\?\?)\s*.*?\.idea\/codeStyles\/.*?\s*$/, "")
// ignore all files added to project dir but not staged/known to GIT
cleanedList = cleanedList.replaceAll(/(?m)^\s*(\?\?)\s*.*?\s*$/, "")
stringBuilder.append(cleanedList.trim())
} catch (ignored) {
return false // NoGitSystemAvailable
}
return stringBuilder.toString().isEmpty()
}
android {
namespace 'app.aaps'
ndkVersion "21.1.6352462"
defaultConfig {
multiDexEnabled true
versionCode 1500
version "3.2.0-dev-m"
buildConfigField "String", "VERSION", '"' + version + '"'
buildConfigField "String", "BUILDVERSION", '"' + generateGitBuild() + '-' + generateDate() + '"'
buildConfigField "String", "REMOTE", '"' + generateGitRemote() + '"'
buildConfigField "String", "HEAD", '"' + generateGitBuild() + '"'
buildConfigField "String", "COMMITTED", '"' + allCommitted() + '"'
}
flavorDimensions = ["standard"]
productFlavors {
full {
applicationId "info.nightscout.androidaps"
dimension "standard"
resValue "string", "app_name", "AAPS"
versionName version
manifestPlaceholders = [
appIcon : "@mipmap/ic_launcher",
appIconRound: "@mipmap/ic_launcher_round"
]
}
pumpcontrol {
applicationId "info.nightscout.aapspumpcontrol"
dimension "standard"
resValue "string", "app_name", "Pumpcontrol"
versionName version + "-pumpcontrol"
manifestPlaceholders = [
appIcon : "@mipmap/ic_pumpcontrol",
appIconRound: "@null"
]
}
aapsclient {
applicationId "info.nightscout.aapsclient"
dimension "standard"
resValue "string", "app_name", "AAPSClient"
versionName version + "-aapsclient"
manifestPlaceholders = [
appIcon : "@mipmap/ic_yellowowl",
appIconRound: "@mipmap/ic_yellowowl"
]
}
aapsclient2 {
applicationId "info.nightscout.aapsclient2"
dimension "standard"
resValue "string", "app_name", "AAPSClient2"
versionName version + "-aapsclient"
manifestPlaceholders = [
appIcon : "@mipmap/ic_blueowl",
appIconRound: "@mipmap/ic_blueowl"
]
}
}
useLibrary "org.apache.http.legacy"
dataBinding { //Deleting it causes a binding error
enabled = true
}
}
allprojects {
repositories {
}
}
dependencies {
wearApp project(':wear')
// in order to use internet's versions you'd need to enable Jetifier again
// https://github.com/nightscout/graphview.git
// https://github.com/nightscout/iconify.git
implementation project(':shared:impl')
implementation project(':core:main')
implementation project(':core:graphview')
implementation project(':core:interfaces')
implementation project(':core:libraries')
implementation project(':core:nssdk')
implementation project(':core:utils')
implementation project(':core:ui')
implementation project(':core:validators')
implementation project(':ui')
implementation project(':plugins:aps')
implementation project(':plugins:automation')
implementation project(':plugins:configuration')
implementation project(':plugins:constraints')
implementation project(':plugins:insulin')
implementation project(':plugins:main')
implementation project(':plugins:sensitivity')
implementation project(':plugins:smoothing')
implementation project(':plugins:source')
implementation project(':plugins:sync')
implementation project(':implementation')
implementation project(':database:entities')
implementation project(':database:impl')
implementation project(':pump:combo')
implementation project(':pump:combov2')
implementation project(':pump:dana')
implementation project(':pump:danars')
implementation project(':pump:danar')
implementation project(':pump:diaconn')
implementation project(':pump:eopatch')
implementation project(':pump:medtrum')
implementation project(':insight')
implementation project(':pump:medtronic')
implementation project(':pump:pump-common')
implementation project(':pump:omnipod-common')
implementation project(':pump:omnipod-eros')
implementation project(':pump:omnipod-dash')
implementation project(':pump:rileylink')
implementation project(':pump:virtual')
implementation project(':workflow')
testImplementation project(':shared:tests')
implementation fileTree(include: ['*.jar'], dir: 'libs')
/* Dagger2 - We are going to use dagger.android which includes
* support for Activity and fragment injection so we need to include
* the following dependencies */
kapt "com.google.dagger:dagger-android-processor:$dagger_version"
kapt "com.google.dagger:dagger-compiler:$dagger_version"
// MainApp
api "com.uber.rxdogtag2:rxdogtag:2.0.2"
}
apply from: "${project.rootDir}/core/main/test_dependencies.gradle"
/*
// Run 'adb' shell command to clear application data of main app for 'debug' variant
task clearMainAppData(type: Exec) {
// we have to iterate to find the 'debug' variant to obtain a variant reference
android.applicationVariants.all { variant ->
if (variant.name == "fullDebug") {
def applicationId = [variant.mergedFlavor.applicationId, variant.buildType.applicationIdSuffix].findAll().join()
def clearDataCommand = ['adb', 'shell', 'pm', 'clear', applicationId]
println "Clearing application data of ${variant.name} variant: [${clearDataCommand}]"
def stdout = new ByteArrayOutputStream()
exec {
commandLine clearDataCommand
standardOutput = stdout
}
String result = stdout.toString().trim()
if (!result.startsWith("Success")) {
println result
throw new GradleException(clearDataCommand.join(" "))
}
}
}
}
// Clear Application Data (once) before running instrumentation test
tasks.whenTaskAdded { task ->
// Both of these targets are equivalent today, although in future connectedCheck
// will also include connectedUiAutomatorTest (not implemented yet)
if(task.name == "connectedAndroidTest" || task.name == "connectedCheck"){
task.dependsOn(clearMainAppData)
}
}
*/
printf('--------------\n')
printf('isMaster: %s\n', isMaster().toString())
printf('gitAvailable: %s\n', gitAvailable().toString())
printf('allCommitted: %s\n', allCommitted().toString())
printf('--------------\n')
if (isMaster() && !gitAvailable()) {
throw new GradleException('GIT system is not available. On Windows try to run Android Studio as an Administrator. Check if GIT is installed and Studio have permissions to use it')
}
if (isMaster() && !allCommitted()) {
throw new GradleException('There are uncommitted changes. Clone sources again as described in wiki and do not allow gradle update')
}

View file

@ -21,96 +21,104 @@ repositories {
google() google()
} }
allOpen { fun generateGitBuild(): String {
// allows mocking for classes w/o directly opening them for release builds val stringBuilder: StringBuilder = StringBuilder()
annotation("info.nightscout.androidaps.annotations.OpenForTesting") try {
val stdout = ByteArrayOutputStream()
exec {
commandLine("git", "describe", "--always")
standardOutput = stdout
}
val commitObject = stdout.toString().trim()
stringBuilder.append(commitObject)
} catch (ignored: Exception) {
stringBuilder.append("NoGitSystemAvailable")
}
return stringBuilder.toString()
} }
fun generateGitBuild(): String = fun generateGitRemote(): String {
val stringBuilder: StringBuilder = StringBuilder()
try { try {
ByteArrayOutputStream().let { val stdout = ByteArrayOutputStream()
exec { exec {
commandLine("git", "describe", "--always") commandLine("git", "remote", "get-url", "origin")
standardOutput = it standardOutput = stdout
}
it.toString().trim()
} }
val commitObject: String = stdout.toString().trim()
stringBuilder.append(commitObject)
} catch (ignored: Exception) { } catch (ignored: Exception) {
"NoGitSystemAvailable" stringBuilder.append("NoGitSystemAvailable")
} }
return stringBuilder.toString()
}
fun generateGitRemote(): String = fun generateDate(): String {
try { val stringBuilder: StringBuilder = StringBuilder()
ByteArrayOutputStream().let {
exec {
commandLine("git", "remote", "get-url", "origin")
standardOutput = it
}
it.toString().trim()
}
} catch (ignored: Exception) {
"NoGitSystemAvailable"
}
fun generateDate(): String =
// showing only date prevents app to rebuild everytime // showing only date prevents app to rebuild everytime
SimpleDateFormat("yyyy.MM.dd").format(Date()) stringBuilder.append(SimpleDateFormat("yyyy.MM.dd").format(Date()))
return stringBuilder.toString()
}
fun isMaster(): Boolean = !Versions.appVersion.contains("-") fun isMaster(): Boolean = !Versions.appVersion.contains("-")
fun gitAvailable(): Boolean = fun gitAvailable(): Boolean {
val stringBuilder: StringBuilder = StringBuilder()
try { try {
ByteArrayOutputStream().let { val stdout = ByteArrayOutputStream()
exec { exec {
commandLine("git", "--version") commandLine("git", "--version")
standardOutput = it standardOutput = stdout
}
it.toString().trim().isNotEmpty()
} }
val commitObject = stdout.toString().trim()
stringBuilder.append(commitObject)
} catch (ignored: Exception) { } catch (ignored: Exception) {
false // NoGitSystemAvailable return false // NoGitSystemAvailable
} }
return !stringBuilder.toString().isEmpty()
fun allCommitted(): Boolean = }
fun allCommitted(): Boolean {
val stringBuilder: StringBuilder = StringBuilder()
try { try {
ByteArrayOutputStream().let { val stdout = ByteArrayOutputStream()
exec { exec {
commandLine("git", "status", "-s") commandLine("git", "status", "-s")
standardOutput = it standardOutput = stdout
}
it.toString()
// ignore all changes done in .idea/codeStyles
.replace(Regex("(?m)^\\s*(M|A|D|\\?\\?)\\s*.*?\\.idea\\/codeStyles\\/.*?\\s*$"), "")
// ignore all files added to project dir but not staged/known to GIT
.replace(Regex("(?m)^\\s*(\\?\\?)\\s*.*?\\s*$"), "")
.trim().isEmpty()
} }
// ignore all changes done in .idea/codeStyles
val cleanedList: String = stdout.toString().replace("/(?m)^\\s*(M|A|D|\\?\\?)\\s*.*?\\.idea\\/codeStyles\\/.*?\\s*\$/", "")
// ignore all files added to project dir but not staged/known to GIT
.replace("/(?m)^\\s*(\\?\\?)\\s*.*?\\s*\$/", "")
stringBuilder.append(cleanedList.trim())
} catch (ignored: Exception) { } catch (ignored: Exception) {
false // NoGitSystemAvailable return false // NoGitSystemAvailable
} }
return stringBuilder.toString().isEmpty()
}
android { android {
namespace = "info.nightscout.androidaps" namespace = "app.aaps"
ndkVersion = Versions.ndkVersion ndkVersion = Versions.ndkVersion
defaultConfig { defaultConfig {
multiDexEnabled = true multiDexEnabled = true
versionCode = Versions.versionCode versionCode = Versions.versionCode
version = Versions.appVersion version = Versions.appVersion
buildConfigField("String", "VERSION", "\"" + Versions.appVersion + "\"") buildConfigField("String", "VERSION", "\"$version\"")
buildConfigField("String", "BUILDVERSION", "\"" + generateGitBuild() + "-" + generateDate() + "\"") buildConfigField("String", "BUILDVERSION", "\"${generateGitBuild()}-${generateDate()}\"")
buildConfigField("String", "REMOTE", "\"" + generateGitRemote() + "\"") buildConfigField("String", "REMOTE", "\"${generateGitRemote()}\"")
buildConfigField("String", "HEAD", "\"" + generateGitBuild() + "\"") buildConfigField("String", "HEAD", "\"${generateGitBuild()}\"")
buildConfigField("Boolean", "COMMITTED", allCommitted().toString()) buildConfigField("String", "COMMITTED", "\"${allCommitted()}\"")
} }
val dim = "standard" flavorDimensions.add("standard")
flavorDimensions.add(dim)
productFlavors { productFlavors {
create("full") { create("full") {
applicationId = "info.nightscout.androidaps" applicationId = "info.nightscout.androidaps"
dimension = dim dimension = "standard"
resValue("string", "app_name", "AAPS") resValue("string", "app_name", "AAPS")
versionName = Versions.appVersion versionName = Versions.appVersion
manifestPlaceholders["appIcon"] = "@mipmap/ic_launcher" manifestPlaceholders["appIcon"] = "@mipmap/ic_launcher"
@ -118,7 +126,7 @@ android {
} }
create("pumpcontrol") { create("pumpcontrol") {
applicationId = "info.nightscout.aapspumpcontrol" applicationId = "info.nightscout.aapspumpcontrol"
dimension = dim dimension = "standard"
resValue("string", "app_name", "Pumpcontrol") resValue("string", "app_name", "Pumpcontrol")
versionName = Versions.appVersion + "-pumpcontrol" versionName = Versions.appVersion + "-pumpcontrol"
manifestPlaceholders["appIcon"] = "@mipmap/ic_pumpcontrol" manifestPlaceholders["appIcon"] = "@mipmap/ic_pumpcontrol"
@ -126,7 +134,7 @@ android {
} }
create("aapsclient") { create("aapsclient") {
applicationId = "info.nightscout.aapsclient" applicationId = "info.nightscout.aapsclient"
dimension = dim dimension = "standard"
resValue("string", "app_name", "AAPSClient") resValue("string", "app_name", "AAPSClient")
versionName = Versions.appVersion + "-aapsclient" versionName = Versions.appVersion + "-aapsclient"
manifestPlaceholders["appIcon"] = "@mipmap/ic_yellowowl" manifestPlaceholders["appIcon"] = "@mipmap/ic_yellowowl"
@ -134,7 +142,7 @@ android {
} }
create("aapsclient2") { create("aapsclient2") {
applicationId = "info.nightscout.aapsclient2" applicationId = "info.nightscout.aapsclient2"
dimension = dim dimension = "standard"
resValue("string", "app_name", "AAPSClient2") resValue("string", "app_name", "AAPSClient2")
versionName = Versions.appVersion + "-aapsclient" versionName = Versions.appVersion + "-aapsclient"
manifestPlaceholders["appIcon"] = "@mipmap/ic_blueowl" manifestPlaceholders["appIcon"] = "@mipmap/ic_blueowl"
@ -142,23 +150,29 @@ android {
} }
} }
dataBinding { //Deleting it causes a binding error useLibrary("org.apache.http.legacy")
enable = true
//Deleting it causes a binding error
dataBinding { enable }
}
allprojects {
repositories {
} }
} }
dependencies { dependencies {
wearApp(project(":wear"))
// in order to use internet"s versions you"d need to enable Jetifier again // in order to use internet"s versions you"d need to enable Jetifier again
// https://github.com/nightscout/graphview.git // https://github.com/nightscout/graphview.git
// https://github.com/nightscout/iconify.git // https://github.com/nightscout/iconify.git
implementation(project(":app-wear-shared:shared")) implementation(project(":shared:impl"))
implementation(project(":app-wear-shared:shared-impl"))
implementation(project(":core:main")) implementation(project(":core:main"))
implementation(project(":core:graph"))
implementation(project(":core:graphview")) implementation(project(":core:graphview"))
implementation(project(":core:interfaces")) implementation(project(":core:interfaces"))
implementation(project(":core:libraries")) implementation(project(":core:libraries"))
implementation(project(":core:ns-sdk")) implementation(project(":core:nssdk"))
implementation(project(":core:utils")) implementation(project(":core:utils"))
implementation(project(":core:ui")) implementation(project(":core:ui"))
implementation(project(":core:validators")) implementation(project(":core:validators"))
@ -187,7 +201,6 @@ dependencies {
implementation(project(":insight")) implementation(project(":insight"))
implementation(project(":pump:medtronic")) implementation(project(":pump:medtronic"))
implementation(project(":pump:pump-common")) implementation(project(":pump:pump-common"))
implementation(project(":pump:pump-core"))
implementation(project(":pump:omnipod-common")) implementation(project(":pump:omnipod-common"))
implementation(project(":pump:omnipod-eros")) implementation(project(":pump:omnipod-eros"))
implementation(project(":pump:omnipod-dash")) implementation(project(":pump:omnipod-dash"))
@ -195,31 +208,31 @@ dependencies {
implementation(project(":pump:virtual")) implementation(project(":pump:virtual"))
implementation(project(":workflow")) implementation(project(":workflow"))
testImplementation(project(":app-wear-shared:shared-tests")) testImplementation(project(":shared:tests"))
//implementation fileTree(include = listOf("*.jar"), dir = "libs") // implementation(fileTree (include: listOf("*.jar"), dir = "libs"))
/* Dagger2 - We are going to use dagger.android which includes /* Dagger2 - We are going to use dagger.android which includes
* support for Activity and fragment injection so we need to include * support for Activity and fragment injection so we need to include
* the following dependencies */ * the following dependencies */
kapt(Libs.Dagger.androidProcesssor) kapt(Libs.Dagger.androidProcessor)
kapt(Libs.Dagger.compiler) kapt(Libs.Dagger.compiler)
// MainApp // MainApp
api(Libs.Rx.rxDogTag) api(Libs.Rx.rxDogTag)
} }
apply(from = "${project.rootDir}/core/main/test_dependencies.gradle") apply(from = "${project.rootDir}/core/main/test_dependencies.gradle")
println("--------------") println("-------------------")
println("isMaster: ${isMaster()}") println("isMaster: ${isMaster()}")
println("gitAvailable: ${gitAvailable()}") println("gitAvailable: ${gitAvailable()}")
println("allCommitted: ${allCommitted()}") println("allCommitted: ${allCommitted()}")
println("--------------") println("-------------------")
if (isMaster() && !gitAvailable()) { if (isMaster() && !gitAvailable()) {
throw GradleException("GIT system is not available. On Windows try to run Android Studio as an Administrator. Check if GIT is installed and Studio have permissions to use it") throw GradleException("GIT system is not available. On Windows try to run Android Studio as an Administrator. Check if GIT is installed and Studio have permissions to use it")
} }
if (isMaster() && !allCommitted()) { if (isMaster() && !allCommitted()) {
throw GradleException("There are uncommitted changes. Clone sources again as described in wiki and do not allow gradle update") throw GradleException("There are uncommitted changes. Clone sources again as described in wiki and do not allow gradle update")
} }

View file

@ -205,7 +205,7 @@ class MainActivity : DaggerAppCompatActivityWithResult() {
} }
R.id.nav_about -> { R.id.nav_about -> {
var message = "Build: ${BuildConfig.BUILDVERSION}\n" var message = "Build: ${config.BUILD_VERSION}\n"
message += "Flavor: ${BuildConfig.FLAVOR}${BuildConfig.BUILD_TYPE}\n" message += "Flavor: ${BuildConfig.FLAVOR}${BuildConfig.BUILD_TYPE}\n"
message += "${rh.gs(app.aaps.plugins.configuration.R.string.configbuilder_nightscoutversion_label)} ${activePlugin.activeNsClient?.detectedNsVersion() ?: rh.gs(app.aaps.plugins.main.R.string.not_available_full)}" message += "${rh.gs(app.aaps.plugins.configuration.R.string.configbuilder_nightscoutversion_label)} ${activePlugin.activeNsClient?.detectedNsVersion() ?: rh.gs(app.aaps.plugins.main.R.string.not_available_full)}"
if (config.isEngineeringMode()) message += "\n${rh.gs(app.aaps.plugins.configuration.R.string.engineering_mode_enabled)}" if (config.isEngineeringMode()) message += "\n${rh.gs(app.aaps.plugins.configuration.R.string.engineering_mode_enabled)}"
@ -215,7 +215,7 @@ class MainActivity : DaggerAppCompatActivityWithResult() {
val messageSpanned = SpannableString(message) val messageSpanned = SpannableString(message)
Linkify.addLinks(messageSpanned, Linkify.WEB_URLS) Linkify.addLinks(messageSpanned, Linkify.WEB_URLS)
MaterialAlertDialogBuilder(this@MainActivity, app.aaps.core.ui.R.style.DialogTheme) MaterialAlertDialogBuilder(this@MainActivity, app.aaps.core.ui.R.style.DialogTheme)
.setTitle(rh.gs(R.string.app_name) + " " + BuildConfig.VERSION) .setTitle(rh.gs(R.string.app_name) + " " + config.VERSION)
.setIcon(iconsProvider.getIcon()) .setIcon(iconsProvider.getIcon())
.setMessage(messageSpanned) .setMessage(messageSpanned)
.setPositiveButton(rh.gs(app.aaps.core.ui.R.string.ok), null) .setPositiveButton(rh.gs(app.aaps.core.ui.R.string.ok), null)
@ -448,16 +448,16 @@ class MainActivity : DaggerAppCompatActivityWithResult() {
if (!fabricPrivacy.fabricEnabled()) return if (!fabricPrivacy.fabricEnabled()) return
val closedLoopEnabled = if (constraintChecker.isClosedLoopAllowed().value()) "CLOSED_LOOP_ENABLED" else "CLOSED_LOOP_DISABLED" val closedLoopEnabled = if (constraintChecker.isClosedLoopAllowed().value()) "CLOSED_LOOP_ENABLED" else "CLOSED_LOOP_DISABLED"
// Size is limited to 36 chars // Size is limited to 36 chars
val remote = BuildConfig.REMOTE.lowercase(Locale.getDefault()) val remote = config.REMOTE.lowercase(Locale.getDefault())
.replace("https://", "") .replace("https://", "")
.replace("http://", "") .replace("http://", "")
.replace(".git", "") .replace(".git", "")
.replace(".com/", ":") .replace(".com/", ":")
.replace(".org/", ":") .replace(".org/", ":")
.replace(".net/", ":") .replace(".net/", ":")
fabricPrivacy.firebaseAnalytics.setUserProperty("Mode", BuildConfig.APPLICATION_ID + "-" + closedLoopEnabled) fabricPrivacy.firebaseAnalytics.setUserProperty("Mode", config.APPLICATION_ID + "-" + closedLoopEnabled)
fabricPrivacy.firebaseAnalytics.setUserProperty("Language", sp.getString(app.aaps.core.ui.R.string.key_language, Locale.getDefault().language)) fabricPrivacy.firebaseAnalytics.setUserProperty("Language", sp.getString(app.aaps.core.ui.R.string.key_language, Locale.getDefault().language))
fabricPrivacy.firebaseAnalytics.setUserProperty("Version", BuildConfig.VERSION) fabricPrivacy.firebaseAnalytics.setUserProperty("Version", config.VERSION_NAME)
fabricPrivacy.firebaseAnalytics.setUserProperty("HEAD", BuildConfig.HEAD) fabricPrivacy.firebaseAnalytics.setUserProperty("HEAD", BuildConfig.HEAD)
fabricPrivacy.firebaseAnalytics.setUserProperty("Remote", remote) fabricPrivacy.firebaseAnalytics.setUserProperty("Remote", remote)
val hashes: List<String> = signatureVerifierPlugin.shortHashes() val hashes: List<String> = signatureVerifierPlugin.shortHashes()
@ -471,9 +471,9 @@ class MainActivity : DaggerAppCompatActivityWithResult() {
activePlugin.activeInsulin.let { fabricPrivacy.firebaseAnalytics.setUserProperty("Insulin", it::class.java.simpleName) } activePlugin.activeInsulin.let { fabricPrivacy.firebaseAnalytics.setUserProperty("Insulin", it::class.java.simpleName) }
// Add to crash log too // Add to crash log too
FirebaseCrashlytics.getInstance().setCustomKey("HEAD", BuildConfig.HEAD) FirebaseCrashlytics.getInstance().setCustomKey("HEAD", BuildConfig.HEAD)
FirebaseCrashlytics.getInstance().setCustomKey("Version", BuildConfig.VERSION) FirebaseCrashlytics.getInstance().setCustomKey("Version", config.VERSION_NAME)
FirebaseCrashlytics.getInstance().setCustomKey("BuildType", BuildConfig.BUILD_TYPE) FirebaseCrashlytics.getInstance().setCustomKey("BuildType", config.BUILD_TYPE)
FirebaseCrashlytics.getInstance().setCustomKey("BuildFlavor", BuildConfig.FLAVOR) FirebaseCrashlytics.getInstance().setCustomKey("BuildFlavor", config.FLAVOR)
FirebaseCrashlytics.getInstance().setCustomKey("Remote", remote) FirebaseCrashlytics.getInstance().setCustomKey("Remote", remote)
FirebaseCrashlytics.getInstance().setCustomKey("Committed", BuildConfig.COMMITTED) FirebaseCrashlytics.getInstance().setCustomKey("Committed", BuildConfig.COMMITTED)
FirebaseCrashlytics.getInstance().setCustomKey("Hash", hashes[0]) FirebaseCrashlytics.getInstance().setCustomKey("Hash", hashes[0])

View file

@ -100,7 +100,7 @@ class MainApp : DaggerApplication() {
setRxErrorHandler() setRxErrorHandler()
LocaleHelper.update(this@MainApp) LocaleHelper.update(this@MainApp)
var gitRemote: String? = BuildConfig.REMOTE var gitRemote: String? = config.REMOTE
var commitHash: String? = BuildConfig.HEAD var commitHash: String? = BuildConfig.HEAD
if (gitRemote?.contains("NoGitSystemAvailable") == true) { if (gitRemote?.contains("NoGitSystemAvailable") == true) {
gitRemote = null gitRemote = null
@ -109,9 +109,9 @@ class MainApp : DaggerApplication() {
disposable += compatDBHelper.dbChangeDisposable() disposable += compatDBHelper.dbChangeDisposable()
registerActivityLifecycleCallbacks(activityMonitor) registerActivityLifecycleCallbacks(activityMonitor)
runOnUiThread { themeSwitcherPlugin.setThemeMode() } runOnUiThread { themeSwitcherPlugin.setThemeMode() }
aapsLogger.debug("Version: " + BuildConfig.VERSION_NAME) aapsLogger.debug("Version: " + config.VERSION_NAME)
aapsLogger.debug("BuildVersion: " + BuildConfig.BUILDVERSION) aapsLogger.debug("BuildVersion: " + config.BUILD_VERSION)
aapsLogger.debug("Remote: " + BuildConfig.REMOTE) aapsLogger.debug("Remote: " + config.REMOTE)
registerLocalBroadcastReceiver() registerLocalBroadcastReceiver()
// trigger here to see the new version on app start after an update // trigger here to see the new version on app start after an update
@ -128,7 +128,7 @@ class MainApp : DaggerApplication() {
if (config.isDev() && sp.getStringOrNull(app.aaps.core.utils.R.string.key_email_for_crash_report, null).isNullOrBlank()) if (config.isDev() && sp.getStringOrNull(app.aaps.core.utils.R.string.key_email_for_crash_report, null).isNullOrBlank())
notificationStore.add(Notification(Notification.IDENTIFICATION_NOT_SET, rh.get().gs(R.string.identification_not_set), Notification.INFO)) notificationStore.add(Notification(Notification.IDENTIFICATION_NOT_SET, rh.get().gs(R.string.identification_not_set), Notification.INFO))
// log version // log version
disposable += repository.runTransaction(VersionChangeTransaction(BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE, gitRemote, commitHash)).subscribe() disposable += repository.runTransaction(VersionChangeTransaction(config.VERSION_NAME, BuildConfig.VERSION_CODE, gitRemote, commitHash)).subscribe()
// log app start // log app start
if (sp.getBoolean(app.aaps.plugins.sync.R.string.key_ns_log_app_started_event, config.APS)) if (sp.getBoolean(app.aaps.plugins.sync.R.string.key_ns_log_app_started_event, config.APS))
disposable += repository disposable += repository

View file

@ -47,8 +47,8 @@ class ConfigImpl @Inject constructor(
engineeringMode = engineeringModeSemaphore.exists() && engineeringModeSemaphore.isFile engineeringMode = engineeringModeSemaphore.exists() && engineeringModeSemaphore.isFile
unfinishedMode = unfinishedModeSemaphore.exists() && unfinishedModeSemaphore.isFile unfinishedMode = unfinishedModeSemaphore.exists() && unfinishedModeSemaphore.isFile
devBranch = BuildConfig.VERSION.contains("-") || BuildConfig.VERSION.matches(Regex(".*[a-zA-Z]+.*")) devBranch = VERSION.contains("-") || VERSION.matches(Regex(".*[a-zA-Z]+.*"))
if (BuildConfig.VERSION.contains("-beta") || BuildConfig.VERSION.contains("-rc")) if (VERSION.contains("-beta") || VERSION.contains("-rc"))
devBranch = false devBranch = false
} }

View file

@ -60,7 +60,7 @@ buildscript {
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath("com.android.tools.build:gradle:8.1.1") classpath("com.android.tools.build:gradle:8.1.2")
classpath("com.google.gms:google-services:4.4.0") classpath("com.google.gms:google-services:4.4.0")
classpath("com.google.firebase:firebase-crashlytics-gradle:2.9.9") classpath("com.google.firebase:firebase-crashlytics-gradle:2.9.9")

View file

@ -1,6 +1,6 @@
object Versions { object Versions {
const val appVersion = "3.2.0-dev-k" const val appVersion = "3.2.0-dev-m"
const val versionCode = 1500 const val versionCode = 1500
const val ndkVersion = "21.1.6352462" const val ndkVersion = "21.1.6352462"

View file

@ -1,4 +1,4 @@
// in order to use internet's versions you'd need to enable Jetifier again // in order to use internet's versions you'd need to enable Jetifier again
// https://github.com/nightscout/iconify.git // https://github.com/nightscout/iconify.git
configurations.create("default") configurations.create("default")
artifacts.add("default", file('libs/iconify.aar')) artifacts.add("default", file("libs/iconify.aar"))