Skip to content

Commit

Permalink
Merge branch 'main' into feat/http-method-span-data
Browse files Browse the repository at this point in the history
  • Loading branch information
adinauer authored Aug 14, 2023
2 parents 615568f + 3fe387a commit b24972c
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .craft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ targets:
maven:io.sentry:sentry:
maven:io.sentry:sentry-spring:
maven:io.sentry:sentry-spring-jakarta:
#maven:io.sentry:sentry-spring-boot:
#maven:io.sentry:sentry-spring-boot-jakarta:
maven:io.sentry:sentry-spring-boot:
maven:io.sentry:sentry-spring-boot-jakarta:
maven:io.sentry:sentry-spring-boot-starter:
maven:io.sentry:sentry-spring-boot-starter-jakarta:
maven:io.sentry:sentry-servlet:
Expand Down
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: all clean compile javadocs dryRelease update stop checkFormat format api assembleBenchmarkTestRelease assembleUiTestRelease
.PHONY: all clean compile javadocs dryRelease update stop checkFormat format api assembleBenchmarkTestRelease assembleUiTestRelease createCoverageReports

all: stop clean javadocs compile
all: stop clean javadocs compile createCoverageReports
assembleBenchmarks: stop clean assembleBenchmarkTestRelease
assembleUiTests: stop clean assembleUiTestRelease

Expand Down Expand Up @@ -50,3 +50,10 @@ assembleBenchmarkTestRelease:
assembleUiTestRelease:
./gradlew :sentry-android-integration-tests:sentry-uitest-android:assembleRelease
./gradlew :sentry-android-integration-tests:sentry-uitest-android:assembleAndroidTest -DtestBuildType=release

# Create coverage reports
# - Jacoco for Java & Android modules
# - Kover for KMP modules e.g sentry-compose
createCoverageReports:
./gradlew jacocoTestReport
./gradlew koverXmlReportRelease
41 changes: 41 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.vanniktech.maven.publish.MavenPublishPlugin
import com.vanniktech.maven.publish.MavenPublishPluginExtension
import groovy.util.Node
import io.gitlab.arturbosch.detekt.extensions.DetektExtension
import kotlinx.kover.gradle.plugin.dsl.KoverReportExtension
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent

Expand All @@ -14,6 +15,8 @@ plugins {
id(Config.QualityPlugins.detekt) version Config.QualityPlugins.detektVersion
`maven-publish`
id(Config.QualityPlugins.binaryCompatibilityValidator) version Config.QualityPlugins.binaryCompatibilityValidatorVersion
id(Config.QualityPlugins.jacocoAndroid) version Config.QualityPlugins.jacocoAndroidVersion apply false
id(Config.QualityPlugins.kover) version Config.QualityPlugins.koverVersion apply false
}

buildscript {
Expand Down Expand Up @@ -97,6 +100,44 @@ allprojects {
}

subprojects {
val jacocoAndroidModules = listOf(
"sentry-android-core",
"sentry-android-fragment",
"sentry-android-navigation",
"sentry-android-ndk",
"sentry-android-okhttp",
"sentry-android-sqlite",
"sentry-android-timber"
)
if (jacocoAndroidModules.contains(name)) {
afterEvaluate {
jacoco {
toolVersion = "0.8.10"
}

tasks.withType<Test> {
configure<JacocoTaskExtension> {
isIncludeNoLocationClasses = true
excludes = listOf("jdk.internal.*")
}
}
}
}

val koverKmpModules = listOf("sentry-compose")
if (koverKmpModules.contains(name)) {
afterEvaluate {
configure<KoverReportExtension> {
androidReports("release") {
xml {
// Change the report file name so the Codecov Github action can find it
setReportFile(file("$buildDir/reports/kover/report.xml"))
}
}
}
}
}

plugins.withId(Config.QualityPlugins.detektPlugin) {
configure<DetektExtension> {
buildUponDefaultConfig = true
Expand Down
5 changes: 5 additions & 0 deletions buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

import java.math.BigDecimal

object Config {
Expand Down Expand Up @@ -205,6 +206,10 @@ object Config {
val binaryCompatibilityValidatorVersion = "0.13.0"
val binaryCompatibilityValidatorPlugin = "org.jetbrains.kotlinx:binary-compatibility-validator:$binaryCompatibilityValidatorVersion"
val binaryCompatibilityValidator = "org.jetbrains.kotlinx.binary-compatibility-validator"
val jacocoAndroid = "com.mxalbert.gradle.jacoco-android"
val jacocoAndroidVersion = "0.2.0"
val kover = "org.jetbrains.kotlinx.kover"
val koverVersion = "0.7.3"
}

object Sentry {
Expand Down
7 changes: 1 addition & 6 deletions sentry-android-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
id("com.android.library")
kotlin("android")
jacoco
id(Config.QualityPlugins.jacocoAndroid)
id(Config.QualityPlugins.errorProne)
id(Config.QualityPlugins.gradleVersions)
}
Expand Down Expand Up @@ -64,12 +65,6 @@ android {
}
}

tasks.withType<Test> {
configure<JacocoTaskExtension> {
isIncludeNoLocationClasses = false
}
}

tasks.withType<JavaCompile>().configureEach {
options.errorprone {
check("NullAway", net.ltgt.gradle.errorprone.CheckSeverity.ERROR)
Expand Down
7 changes: 1 addition & 6 deletions sentry-android-fragment/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
id("com.android.library")
kotlin("android")
jacoco
id(Config.QualityPlugins.jacocoAndroid)
id(Config.QualityPlugins.gradleVersions)
id(Config.QualityPlugins.detektPlugin)
}
Expand Down Expand Up @@ -54,12 +55,6 @@ android {
}
}

tasks.withType<Test> {
configure<JacocoTaskExtension> {
isIncludeNoLocationClasses = false
}
}

kotlin {
explicitApi()
}
Expand Down
7 changes: 1 addition & 6 deletions sentry-android-navigation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
id("com.android.library")
kotlin("android")
jacoco
id(Config.QualityPlugins.jacocoAndroid)
id(Config.QualityPlugins.gradleVersions)
id(Config.QualityPlugins.detektPlugin)
}
Expand Down Expand Up @@ -55,12 +56,6 @@ android {
}
}

tasks.withType<Test> {
configure<JacocoTaskExtension> {
isIncludeNoLocationClasses = false
}
}

kotlin {
explicitApi()
}
Expand Down
7 changes: 1 addition & 6 deletions sentry-android-ndk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
id("com.android.library")
kotlin("android")
jacoco
id(Config.QualityPlugins.jacocoAndroid)
id(Config.NativePlugins.nativeBundleExport)
id(Config.QualityPlugins.gradleVersions)
}
Expand Down Expand Up @@ -96,12 +97,6 @@ android {
}
}

tasks.withType<Test> {
configure<JacocoTaskExtension> {
isIncludeNoLocationClasses = false
}
}

dependencies {
api(projects.sentry)
api(projects.sentryAndroidCore)
Expand Down
7 changes: 1 addition & 6 deletions sentry-android-okhttp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
id("com.android.library")
kotlin("android")
jacoco
id(Config.QualityPlugins.jacocoAndroid)
id(Config.QualityPlugins.gradleVersions)
id(Config.QualityPlugins.detektPlugin)
}
Expand Down Expand Up @@ -56,12 +57,6 @@ android {
}
}

tasks.withType<Test> {
configure<JacocoTaskExtension> {
isIncludeNoLocationClasses = false
}
}

kotlin {
explicitApi()
}
Expand Down
7 changes: 1 addition & 6 deletions sentry-android-sqlite/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
id("com.android.library")
kotlin("android")
jacoco
id(Config.QualityPlugins.jacocoAndroid)
id(Config.QualityPlugins.gradleVersions)
id(Config.QualityPlugins.detektPlugin)
}
Expand Down Expand Up @@ -56,12 +57,6 @@ android {
}
}

tasks.withType<Test> {
configure<JacocoTaskExtension> {
isIncludeNoLocationClasses = false
}
}

kotlin {
explicitApi()
}
Expand Down
7 changes: 1 addition & 6 deletions sentry-android-timber/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
id("com.android.library")
kotlin("android")
jacoco
id(Config.QualityPlugins.jacocoAndroid)
id(Config.QualityPlugins.gradleVersions)
id(Config.QualityPlugins.detektPlugin)
}
Expand Down Expand Up @@ -59,12 +60,6 @@ android {
}
}

tasks.withType<Test> {
configure<JacocoTaskExtension> {
isIncludeNoLocationClasses = false
}
}

kotlin {
explicitApi()
}
Expand Down
8 changes: 1 addition & 7 deletions sentry-compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
kotlin("multiplatform")
id("com.android.library")
id("org.jetbrains.compose")
jacoco
id(Config.QualityPlugins.kover)
id(Config.QualityPlugins.gradleVersions)
id(Config.QualityPlugins.detektPlugin)
id(Config.BuildPlugins.dokkaPluginAlias)
Expand Down Expand Up @@ -113,12 +113,6 @@ android {
}
}

tasks.withType<Test> {
configure<JacocoTaskExtension> {
isIncludeNoLocationClasses = false
}
}

tasks.withType<Detekt> {
// Target version of the generated JVM bytecode. It is used for type resolution.
jvmTarget = JavaVersion.VERSION_1_8.toString()
Expand Down

0 comments on commit b24972c

Please sign in to comment.