Loading .gitlab-ci.yml +3 −0 Original line number Diff line number Diff line image: registry.gitlab.e.foundation/e/os/docker-android-apps-cicd:55-workshop-auto-release variables: SENTRY_DSN: $SENTRY_DSN stages: - debug - release Loading app/build.gradle +18 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,21 @@ def getDate = { -> return new Date().format('yyyyMMddHHmmss') } def getSentryDsn = { -> def sentryDsnEnv = System.getenv("SENTRY_DSN") if (sentryDsnEnv != null) { return sentryDsnEnv } Properties properties = new Properties() def propertiesFile = project.rootProject.file('local.properties') if (propertiesFile.exists()) { properties.load(propertiesFile.newDataInputStream()) } return properties.getProperty('SENTRY_DSN') } android { compileSdk 31 Loading @@ -37,6 +52,7 @@ android { versionName "${versionMajor}.${versionMinor}.${versionPatch}" buildConfigField "String", "BUILD_ID", "\"${getGitHash() + "." + getDate()}\"" buildConfigField("String", "SENTRY_DSN", "\"${getSentryDsn()}\"") testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } Loading Loading @@ -133,6 +149,8 @@ dependencies { // TODO: Add splitinstall-lib to a repo https://gitlab.e.foundation/e/os/backlog/-/issues/628 api files('libs/splitinstall-lib.jar') implementation 'foundation.e.lib:telemetry:0.0.4-alpha' implementation 'foundation.e:gplayapi:3.0.1' implementation 'androidx.core:core-ktx:1.7.0' implementation 'androidx.appcompat:appcompat:1.4.1' Loading app/src/main/AndroidManifest.xml +1 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ android:supportsRtl="true" android:theme="@style/Theme.Apps" android:usesCleartextTraffic="true"> <activity android:name=".MainActivity" android:exported="true"> Loading app/src/main/java/foundation/e/apps/AppLoungeApplication.kt +8 −1 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import foundation.e.apps.manager.pkg.PkgManagerModule import foundation.e.apps.manager.workmanager.InstallWorkManager import foundation.e.apps.setup.tos.TOS_VERSION import foundation.e.apps.utils.modules.DataStoreModule import foundation.e.lib.telemetry.Telemetry import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.MainScope import kotlinx.coroutines.launch Loading Loading @@ -63,14 +64,20 @@ class AppLoungeApplication : Application(), Configuration.Provider { dataStoreModule.saveTOCStatus(false, "") } } if (BuildConfig.DEBUG) { plant(Timber.DebugTree()) } else { // Allow enabling telemetry only for release builds. Telemetry.init(BuildConfig.SENTRY_DSN, this) plant(object : Timber.Tree() { override fun log(priority: Int, tag: String?, message: String, t: Throwable?) { if (priority == Log.DEBUG || priority == Log.VERBOSE) { if (priority < Log.WARN) { return } if (priority == Log.ERROR) { Telemetry.reportMessage("$tag: $message") } Log.println(priority, tag, message) } }) Loading Loading
.gitlab-ci.yml +3 −0 Original line number Diff line number Diff line image: registry.gitlab.e.foundation/e/os/docker-android-apps-cicd:55-workshop-auto-release variables: SENTRY_DSN: $SENTRY_DSN stages: - debug - release Loading
app/build.gradle +18 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,21 @@ def getDate = { -> return new Date().format('yyyyMMddHHmmss') } def getSentryDsn = { -> def sentryDsnEnv = System.getenv("SENTRY_DSN") if (sentryDsnEnv != null) { return sentryDsnEnv } Properties properties = new Properties() def propertiesFile = project.rootProject.file('local.properties') if (propertiesFile.exists()) { properties.load(propertiesFile.newDataInputStream()) } return properties.getProperty('SENTRY_DSN') } android { compileSdk 31 Loading @@ -37,6 +52,7 @@ android { versionName "${versionMajor}.${versionMinor}.${versionPatch}" buildConfigField "String", "BUILD_ID", "\"${getGitHash() + "." + getDate()}\"" buildConfigField("String", "SENTRY_DSN", "\"${getSentryDsn()}\"") testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } Loading Loading @@ -133,6 +149,8 @@ dependencies { // TODO: Add splitinstall-lib to a repo https://gitlab.e.foundation/e/os/backlog/-/issues/628 api files('libs/splitinstall-lib.jar') implementation 'foundation.e.lib:telemetry:0.0.4-alpha' implementation 'foundation.e:gplayapi:3.0.1' implementation 'androidx.core:core-ktx:1.7.0' implementation 'androidx.appcompat:appcompat:1.4.1' Loading
app/src/main/AndroidManifest.xml +1 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ android:supportsRtl="true" android:theme="@style/Theme.Apps" android:usesCleartextTraffic="true"> <activity android:name=".MainActivity" android:exported="true"> Loading
app/src/main/java/foundation/e/apps/AppLoungeApplication.kt +8 −1 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import foundation.e.apps.manager.pkg.PkgManagerModule import foundation.e.apps.manager.workmanager.InstallWorkManager import foundation.e.apps.setup.tos.TOS_VERSION import foundation.e.apps.utils.modules.DataStoreModule import foundation.e.lib.telemetry.Telemetry import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.MainScope import kotlinx.coroutines.launch Loading Loading @@ -63,14 +64,20 @@ class AppLoungeApplication : Application(), Configuration.Provider { dataStoreModule.saveTOCStatus(false, "") } } if (BuildConfig.DEBUG) { plant(Timber.DebugTree()) } else { // Allow enabling telemetry only for release builds. Telemetry.init(BuildConfig.SENTRY_DSN, this) plant(object : Timber.Tree() { override fun log(priority: Int, tag: String?, message: String, t: Throwable?) { if (priority == Log.DEBUG || priority == Log.VERBOSE) { if (priority < Log.WARN) { return } if (priority == Log.ERROR) { Telemetry.reportMessage("$tag: $message") } Log.println(priority, tag, message) } }) Loading