diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 636e8956..402c1608 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -70,7 +70,7 @@ jobs: SENTRY_DSN: ${{ secrets.SENTRY_DSN }} SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} run: | - ./gradlew --no-configuration-cache collectReleaseApks collectReleaseBundle -PsentryUploadMappings + ./gradlew --no-configuration-cache collectReleaseApks collectReleaseBundle -PenableSentry - name: Clean secrets run: scripts/signing-cleanup.sh diff --git a/.github/workflows/tramline-release.yml b/.github/workflows/tramline-release.yml index bd4a71e5..47212425 100644 --- a/.github/workflows/tramline-release.yml +++ b/.github/workflows/tramline-release.yml @@ -35,7 +35,7 @@ jobs: run: | ./scripts/setup-age.sh ./scripts/signing-setup.sh "$AGE_SECRET_KEY" - ./gradlew --no-configuration-cache --stacktrace -PsentryUploadMappings collectReleaseBundle + ./gradlew --no-configuration-cache --stacktrace -PenableSentry collectReleaseBundle ./scripts/signing-cleanup.sh env: AGE_SECRET_KEY: ${{ secrets.AGE_SECRET_KEY }} diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 71be9eb8..15f52043 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -178,17 +178,19 @@ + android:value="true" /> + android:value="true" /> + android:value="true" /> + android:value="true" /> + + diff --git a/api/src/test/kotlin/dev/msfjarvis/claw/api/ApiTest.kt b/api/src/test/kotlin/dev/msfjarvis/claw/api/ApiTest.kt index 0a360973..e22b10ff 100644 --- a/api/src/test/kotlin/dev/msfjarvis/claw/api/ApiTest.kt +++ b/api/src/test/kotlin/dev/msfjarvis/claw/api/ApiTest.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2022-2023 Harsh Shandilya. + * Copyright © 2022-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. diff --git a/api/src/test/kotlin/dev/msfjarvis/claw/api/SearchApiTest.kt b/api/src/test/kotlin/dev/msfjarvis/claw/api/SearchApiTest.kt index 73382c96..850c151b 100644 --- a/api/src/test/kotlin/dev/msfjarvis/claw/api/SearchApiTest.kt +++ b/api/src/test/kotlin/dev/msfjarvis/claw/api/SearchApiTest.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2023 Harsh Shandilya. + * Copyright © 2023-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. diff --git a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/SentryPlugin.kt b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/SentryPlugin.kt index 8495c366..6d26fb9d 100644 --- a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/SentryPlugin.kt +++ b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/SentryPlugin.kt @@ -25,25 +25,33 @@ class SentryPlugin : Plugin { project.extensions.configure { onVariants(selector().all()) { variant -> val sentryDsn = project.providers.environmentVariable(SENTRY_DSN_PROPERTY) + val enableSentry = + project.providers.gradleProperty(SENTRY_ENABLE_GRADLE_PROPERTY).isPresent variant.manifestPlaceholders.put("sentryDsn", sentryDsn.getOrElse("")) - variant.manifestPlaceholders.put("enableSentry", "${variant.name == "release"}") + variant.manifestPlaceholders.put( + "sentryEnvironment", + when { + variant.name.contains("release", true) && enableSentry -> "production" + variant.name.contains("release", true) && !enableSentry -> "nightly" + else -> "dev" + }, + ) } } project.plugins.apply(io.sentry.android.gradle.SentryPlugin::class) project.extensions.configure { - val enableMappings = - project.providers.gradleProperty(SENTRY_UPLOAD_MAPPINGS_PROPERTY).isPresent - includeProguardMapping.set(enableMappings) - autoUploadProguardMapping.set(enableMappings) + includeProguardMapping.set(true) + autoUploadProguardMapping.set(true) uploadNativeSymbols.set(false) autoUploadNativeSymbols.set(false) includeNativeSources.set(false) ignoredVariants.set(emptySet()) - ignoredBuildTypes.set(setOf("benchmark", "debug")) + ignoredBuildTypes.set(setOf("benchmark")) ignoredFlavors.set(emptySet()) tracingInstrumentation { enabled.set(true) debug.set(false) + logcat.enabled.set(true) forceInstrumentDependencies.set(false) features.set(EnumSet.allOf(InstrumentationFeature::class.java)) } @@ -64,13 +72,16 @@ class SentryPlugin : Plugin { telemetry.set(false) telemetryDsn.set(null) } - with(project.dependencies) { addProvider("implementation", platform(libs.sentry.bom)) } + with(project.dependencies) { + addProvider("implementation", platform(libs.sentry.bom)) + addProvider("implementation", libs.sentry.android) + } } } private companion object { private const val SENTRY_DSN_PROPERTY = "SENTRY_DSN" - private const val SENTRY_UPLOAD_MAPPINGS_PROPERTY = "sentryUploadMappings" + private const val SENTRY_ENABLE_GRADLE_PROPERTY = "enableSentry" } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 14a8fbab..fca35065 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -93,6 +93,7 @@ okhttp-loggingInterceptor = { module = "com.squareup.okhttp3:logging-interceptor okhttp-mockwebserver = { module = "com.squareup.okhttp3:mockwebserver" } retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" } retrofit-kotlinxSerializationConverter = "com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.0" +sentry-android = { module = "io.sentry:sentry-android", version.ref = "sentry-sdk" } sentry-bom = { module = "io.sentry:sentry-bom", version.ref = "sentry-sdk" } sentry-okhttp = { module = "io.sentry:sentry-okhttp", version.ref = "sentry-sdk" } slack-compose-lints = "com.slack.lint.compose:compose-lint-checks:1.3.1"