forked from getsentry/sentry-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
91 lines (83 loc) · 2.83 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
91 lines (83 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import net.ltgt.gradle.errorprone.errorprone
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
`java-library`
id("io.sentry.javadoc")
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.errorprone)
alias(libs.plugins.gradle.versions)
alias(libs.plugins.buildconfig)
id("io.sentry.animalsniffer.android")
}
tasks.withType<KotlinCompile>().configureEach {
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
}
dependencies {
errorprone(libs.errorprone.core)
errorprone(libs.nopen.checker)
errorprone(libs.nullaway)
compileOnly(libs.jetbrains.annotations)
compileOnly(libs.nopen.annotations)
// tests
testImplementation(kotlin(Config.kotlinStdLib))
testImplementation(libs.awaitility.kotlin)
testImplementation(libs.google.truth)
testImplementation(libs.javafaker)
testImplementation(libs.kotlin.test.junit)
testImplementation(libs.mockito.kotlin)
testImplementation(libs.mockito.inline)
testImplementation(libs.msgpack)
testImplementation(libs.okio)
testImplementation(projects.sentryTestSupport)
}
sentryAnimalSniffer {
// We manually check on Android if it's available (API 26+).
ignoreClasses("java.time.Instant")
// Uses java.util.function.Supplier, but must be manually invoked.
mainExcludes("**/io/sentry/SentryWrapper.class")
}
tasks {
test {
// java.lang open is needed by tests that reflectively rewrite Class names; it was previously
// provided implicitly by the jacoco test agent, which has been removed.
jvmArgs(
"--add-opens",
"java.base/java.util.concurrent=ALL-UNNAMED",
"--add-opens",
"java.base/java.lang=ALL-UNNAMED",
)
environment["SENTRY_TEST_PROPERTY"] = "\"some-value\""
environment["SENTRY_TEST_MAP_KEY1"] = "\"value1\""
environment["SENTRY_TEST_MAP_KEY2"] = "value2"
}
}
buildConfig {
useJavaOutput()
packageName("io.sentry")
buildConfigField("String", "SENTRY_JAVA_SDK_NAME", "\"${Config.Sentry.SENTRY_JAVA_SDK_NAME}\"")
buildConfigField("String", "VERSION_NAME", "\"${project.version}\"")
}
tasks.withType<JavaCompile>().configureEach {
dependsOn(tasks.generateBuildConfig)
options.errorprone {
check("NullAway", net.ltgt.gradle.errorprone.CheckSeverity.ERROR)
option("NullAway:AnnotatedPackages", "io.sentry")
}
options.errorprone.errorproneArgs.add("-XepExcludedPaths:.*/io/sentry/vendor/.*")
}
tasks.jar {
from(rootProject.file("THIRD_PARTY_NOTICES.md")) {
into("META-INF")
rename { "SENTRY_THIRD_PARTY_NOTICES.md" }
}
manifest {
attributes(
"Sentry-Version-Name" to project.version,
"Sentry-SDK-Name" to Config.Sentry.SENTRY_JAVA_SDK_NAME,
"Sentry-SDK-Package-Name" to "maven:io.sentry:sentry",
"Implementation-Vendor" to "Sentry",
"Implementation-Title" to project.name,
"Implementation-Version" to project.version,
)
}
}