|
| 1 | +plugins { |
| 2 | + id("com.android.library") |
| 3 | + alias(libs.plugins.kotlin.android) |
| 4 | + jacoco |
| 5 | + alias(libs.plugins.jacoco.android) |
| 6 | + alias(libs.plugins.gradle.versions) |
| 7 | +} |
| 8 | + |
| 9 | +android { |
| 10 | + compileSdk = libs.versions.compileSdk.get().toInt() |
| 11 | + namespace = "io.sentry.launchdarkly.android" |
| 12 | + |
| 13 | + defaultConfig { |
| 14 | + minSdk = libs.versions.minSdk.get().toInt() |
| 15 | + |
| 16 | + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" |
| 17 | + |
| 18 | + // for AGP 4.1 |
| 19 | + buildConfigField("String", "VERSION_NAME", "\"${project.version}\"") |
| 20 | + buildConfigField( |
| 21 | + "String", |
| 22 | + "SENTRY_LAUNCHDARKLY_ANDROID_SDK_NAME", |
| 23 | + "\"${Config.Sentry.SENTRY_LAUNCHDARKLY_ANDROID_SDK_NAME}\"", |
| 24 | + ) |
| 25 | + } |
| 26 | + |
| 27 | + buildTypes { |
| 28 | + getByName("debug") { consumerProguardFiles("proguard-rules.pro") } |
| 29 | + getByName("release") { consumerProguardFiles("proguard-rules.pro") } |
| 30 | + } |
| 31 | + |
| 32 | + kotlin { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8 } |
| 33 | + |
| 34 | + testOptions { |
| 35 | + animationsDisabled = true |
| 36 | + unitTests.apply { |
| 37 | + isReturnDefaultValues = true |
| 38 | + isIncludeAndroidResources = true |
| 39 | + } |
| 40 | + } |
| 41 | + |
| 42 | + lint { |
| 43 | + warningsAsErrors = true |
| 44 | + checkDependencies = true |
| 45 | + |
| 46 | + // We run a full lint analysis as build part in CI, so skip vital checks for assemble tasks. |
| 47 | + checkReleaseBuilds = false |
| 48 | + } |
| 49 | + |
| 50 | + buildFeatures { buildConfig = true } |
| 51 | + |
| 52 | + androidComponents.beforeVariants { |
| 53 | + it.enable = !Config.Android.shouldSkipDebugVariant(it.buildType) |
| 54 | + } |
| 55 | +} |
| 56 | + |
| 57 | +dependencies { |
| 58 | + api(projects.sentry) |
| 59 | + |
| 60 | + compileOnly(libs.launchdarkly.android) |
| 61 | + compileOnly(libs.jetbrains.annotations) |
| 62 | + |
| 63 | + // tests |
| 64 | + testImplementation(projects.sentry) |
| 65 | + testImplementation(projects.sentryTestSupport) |
| 66 | + testImplementation(kotlin(Config.kotlinStdLib, Config.kotlinStdLibVersionAndroid)) |
| 67 | + testImplementation(libs.androidx.test.ext.junit) |
| 68 | + testImplementation(libs.kotlin.test.junit) |
| 69 | + testImplementation(libs.mockito.kotlin) |
| 70 | + testImplementation(libs.mockito.inline) |
| 71 | + testImplementation(libs.launchdarkly.android) |
| 72 | +} |
0 commit comments