|
| 1 | +import io.gitlab.arturbosch.detekt.Detekt |
| 2 | +import org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8 |
| 3 | +import org.jetbrains.kotlin.gradle.dsl.KotlinVersion |
| 4 | + |
| 5 | +plugins { |
| 6 | + id("com.android.library") |
| 7 | + alias(libs.plugins.kotlin.android) |
| 8 | + alias(libs.plugins.kotlin.compose) |
| 9 | + alias(libs.plugins.gradle.versions) |
| 10 | + alias(libs.plugins.detekt) |
| 11 | +} |
| 12 | + |
| 13 | +android { |
| 14 | + compileSdk = libs.versions.compileSdk.get().toInt() |
| 15 | + namespace = "io.sentry.compose.navigation3" |
| 16 | + |
| 17 | + defaultConfig { |
| 18 | + minSdk = libs.versions.minSdk.get().toInt() |
| 19 | + |
| 20 | + buildConfigField("String", "VERSION_NAME", "\"${project.version}\"") |
| 21 | + } |
| 22 | + |
| 23 | + buildTypes { |
| 24 | + getByName("release") { consumerProguardFiles("proguard-rules.pro") } |
| 25 | + } |
| 26 | + |
| 27 | + // AGP 9 only generates unit tests for the testBuildType. The debug variant is |
| 28 | + // disabled, so unit tests must target release to run at all. |
| 29 | + testBuildType = "release" |
| 30 | + |
| 31 | + kotlin { |
| 32 | + compilerOptions.jvmTarget = JVM_1_8 |
| 33 | + compilerOptions.languageVersion = KotlinVersion.KOTLIN_1_9 |
| 34 | + compilerOptions.apiVersion = KotlinVersion.KOTLIN_1_9 |
| 35 | + } |
| 36 | + |
| 37 | + testOptions { |
| 38 | + unitTests.isReturnDefaultValues = true |
| 39 | + } |
| 40 | + |
| 41 | + lint { |
| 42 | + warningsAsErrors = true |
| 43 | + checkDependencies = true |
| 44 | + |
| 45 | + // We run a full lint analysis as build part in CI, so skip vital checks for assemble tasks. |
| 46 | + checkReleaseBuilds = false |
| 47 | + } |
| 48 | + |
| 49 | + buildFeatures { |
| 50 | + buildConfig = true |
| 51 | + compose = true |
| 52 | + } |
| 53 | + |
| 54 | + androidComponents.beforeVariants { |
| 55 | + it.enable = !Config.Android.shouldSkipDebugVariant(it.buildType) |
| 56 | + } |
| 57 | +} |
| 58 | + |
| 59 | +kotlin { explicitApi() } |
| 60 | + |
| 61 | +dependencies { |
| 62 | + implementation(projects.sentry) |
| 63 | + |
| 64 | + compileOnly(libs.androidx.compose.runtime) |
| 65 | + |
| 66 | + testImplementation(libs.androidx.compose.ui.test.junit4) |
| 67 | + testImplementation(libs.androidx.test.core) |
| 68 | + testImplementation(libs.androidx.test.ext.junit) |
| 69 | + testImplementation(libs.google.truth) |
| 70 | + testImplementation(libs.mockito.inline) |
| 71 | + testImplementation(libs.mockito.kotlin) |
| 72 | + testImplementation(libs.roboelectric) |
| 73 | +} |
| 74 | + |
| 75 | +tasks.withType<Detekt>().configureEach { |
| 76 | + // Target version of the generated JVM bytecode. It is used for type resolution. |
| 77 | + jvmTarget = JavaVersion.VERSION_1_8.toString() |
| 78 | +} |
0 commit comments