|
| 1 | +import net.ltgt.gradle.errorprone.errorprone |
| 2 | +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile |
| 3 | + |
| 4 | +plugins { |
| 5 | + `java-library` |
| 6 | + id("io.sentry.javadoc") |
| 7 | + alias(libs.plugins.kotlin.jvm) |
| 8 | + alias(libs.plugins.errorprone) |
| 9 | + alias(libs.plugins.gradle.versions) |
| 10 | + alias(libs.plugins.buildconfig) |
| 11 | + id("io.sentry.animalsniffer.android") |
| 12 | +} |
| 13 | + |
| 14 | +tasks.withType<KotlinCompile>().configureEach { |
| 15 | + compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8 |
| 16 | + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 |
| 17 | + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 |
| 18 | +} |
| 19 | + |
| 20 | +dependencies { |
| 21 | + api(projects.sentry) |
| 22 | + api(projects.sentryKotlinExtensions) |
| 23 | + |
| 24 | + compileOnly(libs.apollo5.kotlin) |
| 25 | + compileOnly(libs.jetbrains.annotations) |
| 26 | + compileOnly(libs.nopen.annotations) |
| 27 | + errorprone(libs.errorprone.core) |
| 28 | + errorprone(libs.nopen.checker) |
| 29 | + errorprone(libs.nullaway) |
| 30 | + |
| 31 | + // tests |
| 32 | + testImplementation(projects.sentryTestSupport) |
| 33 | + testImplementation(kotlin(Config.kotlinStdLib)) |
| 34 | + testImplementation(libs.apollo5.kotlin.latest) |
| 35 | + testImplementation(libs.google.truth) |
| 36 | + testImplementation(libs.kotlin.test.junit) |
| 37 | + testImplementation(libs.kotlinx.coroutines) |
| 38 | + testImplementation(libs.kotlinx.coroutines.test) |
| 39 | + testImplementation(libs.mockito.kotlin) |
| 40 | + testImplementation(libs.mockito.inline) |
| 41 | + testImplementation(libs.okhttp.mockwebserver5) |
| 42 | +} |
| 43 | + |
| 44 | +tasks.withType<JavaCompile>().configureEach { |
| 45 | + options.errorprone { |
| 46 | + check("NullAway", net.ltgt.gradle.errorprone.CheckSeverity.ERROR) |
| 47 | + option("NullAway:AnnotatedPackages", "io.sentry") |
| 48 | + } |
| 49 | +} |
| 50 | + |
| 51 | +buildConfig { |
| 52 | + useJavaOutput() |
| 53 | + packageName("io.sentry.apollo5") |
| 54 | + buildConfigField( |
| 55 | + "String", |
| 56 | + "SENTRY_APOLLO5_SDK_NAME", |
| 57 | + "\"${Config.Sentry.SENTRY_APOLLO5_SDK_NAME}\"", |
| 58 | + ) |
| 59 | + buildConfigField("String", "VERSION_NAME", "\"${project.version}\"") |
| 60 | +} |
| 61 | + |
| 62 | +tasks.jar { |
| 63 | + manifest { |
| 64 | + attributes( |
| 65 | + "Sentry-Version-Name" to project.version, |
| 66 | + "Sentry-SDK-Name" to Config.Sentry.SENTRY_APOLLO5_SDK_NAME, |
| 67 | + "Sentry-SDK-Package-Name" to "maven:io.sentry:sentry-apollo-5", |
| 68 | + "Implementation-Vendor" to "Sentry", |
| 69 | + "Implementation-Title" to project.name, |
| 70 | + "Implementation-Version" to project.version, |
| 71 | + ) |
| 72 | + } |
| 73 | +} |
0 commit comments