|
| 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 | + |
| 21 | + buildTypes { |
| 22 | + getByName("release") { consumerProguardFiles("proguard-rules.pro") } |
| 23 | + } |
| 24 | + |
| 25 | + // AGP 9 only generates unit tests for the testBuildType. The debug variant is |
| 26 | + // disabled, so unit tests must target release to run at all. |
| 27 | + testBuildType = "release" |
| 28 | + |
| 29 | + kotlin { |
| 30 | + compilerOptions.jvmTarget = JVM_1_8 |
| 31 | + compilerOptions.languageVersion = KotlinVersion.KOTLIN_1_9 |
| 32 | + compilerOptions.apiVersion = KotlinVersion.KOTLIN_1_9 |
| 33 | + } |
| 34 | + |
| 35 | + lint { |
| 36 | + warningsAsErrors = true |
| 37 | + checkDependencies = true |
| 38 | + |
| 39 | + // We run a full lint analysis as build part in CI, so skip vital checks for assemble tasks. |
| 40 | + checkReleaseBuilds = false |
| 41 | + } |
| 42 | + |
| 43 | + androidComponents.beforeVariants { |
| 44 | + it.enable = !Config.Android.shouldSkipDebugVariant(it.buildType) |
| 45 | + } |
| 46 | +} |
| 47 | + |
| 48 | +kotlin { explicitApi() } |
| 49 | + |
| 50 | +tasks.withType<Detekt>().configureEach { |
| 51 | + // Target version of the generated JVM bytecode. It is used for type resolution. |
| 52 | + jvmTarget = JavaVersion.VERSION_1_8.toString() |
| 53 | +} |
0 commit comments