diff --git a/.github/workflows/develop_ci.yml b/.github/workflows/develop_ci.yml index 7e15845b..ac2900b6 100644 --- a/.github/workflows/develop_ci.yml +++ b/.github/workflows/develop_ci.yml @@ -8,6 +8,8 @@ on: env: base_url: ${{ secrets.BASE_URL }} password: ${{ secrets.PASSWORD }} + SENTRY_DSN: ${{ secrets.SENTRY_DSN }} + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} concurrency: group: ${{ github.ref }} diff --git a/app/build.gradle.kts b/app/build.gradle.kts index ca9dda91..65698b09 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -16,6 +16,7 @@ plugins { alias(libs.plugins.kotlin.serialization) alias(libs.plugins.hilt) alias(libs.plugins.navigation.safeargs) + alias(libs.plugins.sentry) } android { @@ -70,6 +71,35 @@ android { } } + flavorDimensions += listOf("app") + productFlavors { + create("nonFree") { + dimension = "app" + manifestPlaceholders["sentryDsn"] = System.getenv("SENTRY_DSN") ?: "" + } + + create("free") { + dimension = "app" + isDefault = true + manifestPlaceholders["sentryDsn"] = "" + } + } + + sentry { + ignoredBuildTypes.set(setOf("benchmark", "debug")) + ignoredFlavors.set(setOf("free")) + } + + androidComponents { + beforeVariants { variant -> + when { + variant.name.contains("benchmark", ignoreCase = true) -> { + variant.enable = false + } + } + } + } + lint { abortOnError = true checkReleaseBuilds = false diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 75911dc9..0b659335 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -5,7 +5,8 @@ - + tools:targetApi="33" /> + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build.gradle.kts b/build.gradle.kts index b2d5afb9..4adf1590 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,6 +14,7 @@ plugins { alias(libs.plugins.navigation.safeargs) apply false alias(libs.plugins.multiplatform) apply false alias(libs.plugins.binaryCompat) apply false + alias(libs.plugins.sentry) apply false id("dev.yashgarg.qbit.spotless") id("dev.yashgarg.qbit.githooks") diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3cb34007..b9b67197 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -97,6 +97,7 @@ kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", versi multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } navigation-safeargs = { id = "androidx.navigation.safeargs", version.ref = "axNavigation" } spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } +sentry = "io.sentry.android.gradle:3.4.2" [bundles] compose = ["compose-theme-adapter", "compose-activity", "compose-foundation", "compose-material3"] diff --git a/sentry.properties b/sentry.properties new file mode 100644 index 00000000..6a2031c7 --- /dev/null +++ b/sentry.properties @@ -0,0 +1,2 @@ +defaults.project=qbittorrent-kt +defaults.org=yashgarg \ No newline at end of file