Skip to content

Commit 202759f

Browse files
authored
Merge branch 'main' into feat/user-feedback-widget
2 parents d0ba126 + 0285c02 commit 202759f

67 files changed

Lines changed: 420 additions & 431 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build.gradle.kts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,23 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent
1010

1111
plugins {
1212
`java-library`
13-
id(Config.QualityPlugins.spotless) version Config.QualityPlugins.spotlessVersion apply true
13+
alias(libs.plugins.spotless)
1414
jacoco
15-
id(Config.QualityPlugins.detekt) version Config.QualityPlugins.detektVersion
15+
alias(libs.plugins.detekt)
1616
`maven-publish`
17-
id(Config.QualityPlugins.binaryCompatibilityValidator) version Config.QualityPlugins.binaryCompatibilityValidatorVersion
18-
id(Config.QualityPlugins.jacocoAndroid) version Config.QualityPlugins.jacocoAndroidVersion apply false
19-
id(Config.QualityPlugins.kover) version Config.QualityPlugins.koverVersion apply false
20-
id(Config.BuildPlugins.gradleMavenPublishPlugin) version Config.BuildPlugins.gradleMavenPublishPluginVersion apply false
17+
alias(libs.plugins.binary.compatibility.validator)
18+
alias(libs.plugins.jacoco.android) apply false
19+
alias(libs.plugins.kover) apply false
20+
alias(libs.plugins.vanniktech.maven.publish) apply false
2121
alias(libs.plugins.kotlin.android) apply false
22+
alias(libs.plugins.buildconfig) apply false
23+
// dokka is required by gradle-maven-publish-plugin.
24+
alias(libs.plugins.dokka) apply false
25+
alias(libs.plugins.dokka.javadoc) apply false
26+
alias(libs.plugins.compose.compiler) apply false
27+
alias(libs.plugins.errorprone) apply false
28+
alias(libs.plugins.gradle.versions) apply false
29+
alias(libs.plugins.spring.dependency.management) apply false
2230
}
2331

2432
buildscript {
@@ -27,16 +35,10 @@ buildscript {
2735
}
2836
dependencies {
2937
classpath(Config.BuildPlugins.androidGradle)
30-
// dokka is required by gradle-maven-publish-plugin.
31-
classpath(Config.BuildPlugins.dokkaPlugin)
32-
classpath(Config.QualityPlugins.errorpronePlugin)
33-
classpath(Config.QualityPlugins.gradleVersionsPlugin)
3438

3539
// add classpath of sentry android gradle plugin
3640
// classpath("io.sentry:sentry-android-gradle-plugin:{version}")
3741

38-
classpath(Config.QualityPlugins.binaryCompatibilityValidatorPlugin)
39-
classpath(Config.BuildPlugins.composeGradlePlugin)
4042
classpath(Config.BuildPlugins.commonsCompressOverride)
4143
}
4244
}

buildSrc/src/main/java/Config.kt

Lines changed: 2 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,14 @@ object Config {
99
val springBoot3Version = "3.4.2"
1010
val kotlinCompatibleLanguageVersion = "1.6"
1111

12-
// see https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-compatibility-and-versioning.html#kotlin-compatibility
13-
// see https://developer.android.com/jetpack/androidx/releases/compose-kotlin
14-
val composeVersion = "1.6.11"
1512
val androidComposeCompilerVersion = "1.5.14"
1613

1714
object BuildPlugins {
1815
val androidGradle = "com.android.tools.build:gradle:$AGP"
19-
val buildConfig = "com.github.gmazzo.buildconfig"
20-
val buildConfigVersion = "5.6.5"
21-
val springBoot = "org.springframework.boot"
22-
val springDependencyManagement = "io.spring.dependency-management"
23-
val springDependencyManagementVersion = "1.0.11.RELEASE"
24-
val gretty = "org.gretty"
25-
val grettyVersion = "4.0.0"
26-
val gradleMavenPublishPlugin = "com.vanniktech.maven.publish"
27-
val gradleMavenPublishPluginVersion = "0.30.0"
28-
val dokkaPlugin = "org.jetbrains.dokka:dokka-gradle-plugin:2.0.0"
29-
val dokkaPluginAlias = "org.jetbrains.dokka"
30-
val dokkaPluginJavadocAlias = "org.jetbrains.dokka-javadoc"
31-
val composeGradlePlugin = "org.jetbrains.compose:compose-gradle-plugin:$composeVersion"
3216
val commonsCompressOverride = "org.apache.commons:commons-compress:1.25.0"
3317
}
3418

3519
object Android {
36-
private val sdkVersion = 34
37-
38-
val minSdkVersion = 21
39-
val targetSdkVersion = sdkVersion
40-
val compileSdkVersion = sdkVersion
41-
4220
val abiFilters = listOf("x86", "armeabi-v7a", "x86_64", "arm64-v8a")
4321

4422
fun shouldSkipDebugVariant(name: String?): Boolean {
@@ -57,7 +35,6 @@ object Config {
5735
private val lifecycleVersion = "2.2.0"
5836
val lifecycleProcess = "androidx.lifecycle:lifecycle-process:$lifecycleVersion"
5937
val lifecycleCommonJava8 = "androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion"
60-
val androidxCore = "androidx.core:core:1.3.2"
6138
val androidxSqlite = "androidx.sqlite:sqlite:2.3.1"
6239
val androidxRecylerView = "androidx.recyclerview:recyclerview:1.2.1"
6340
val androidxAnnotation = "androidx.annotation:annotation:1.9.1"
@@ -144,20 +121,6 @@ object Config {
144121
val kotlinReflect = "org.jetbrains.kotlin:kotlin-reflect"
145122
val kotlinStdLib = "org.jetbrains.kotlin:kotlin-stdlib"
146123

147-
private val navigationVersion = "2.4.2"
148-
val navigationRuntime = "androidx.navigation:navigation-runtime:$navigationVersion"
149-
150-
// compose deps
151-
val composeNavigation = "androidx.navigation:navigation-compose:$navigationVersion"
152-
val composeActivity = "androidx.activity:activity-compose:1.8.2"
153-
val composeFoundation = "androidx.compose.foundation:foundation:1.6.3"
154-
val composeUi = "androidx.compose.ui:ui:1.6.3"
155-
val composeFoundationLayout = "androidx.compose.foundation:foundation-layout:1.6.3"
156-
val composeMaterial = "androidx.compose.material3:material3:1.2.1"
157-
158-
val composeUiReplay = "androidx.compose.ui:ui:1.5.0" // Note: don't change without testing forwards compatibility
159-
val composeCoil = "io.coil-kt:coil-compose:2.6.0"
160-
161124
val apolloKotlin = "com.apollographql.apollo3:apollo-runtime:3.8.2"
162125
val apolloKotlin4 = "com.apollographql.apollo:apollo-runtime:4.1.1"
163126

@@ -188,57 +151,25 @@ object Config {
188151
}
189152

190153
object TestLibs {
191-
private val espressoVersion = "3.5.0"
192-
193154
val androidJUnitRunner = "androidx.test.runner.AndroidJUnitRunner"
194-
val androidxCore = "androidx.test:core:1.6.1"
195-
val androidxRunner = "androidx.test:runner:1.6.2"
196-
val androidxTestCoreKtx = "androidx.test:core-ktx:1.6.1"
197-
val androidxTestRules = "androidx.test:rules:1.6.1"
198-
val espressoCore = "androidx.test.espresso:espresso-core:$espressoVersion"
199-
val espressoIdlingResource = "androidx.test.espresso:espresso-idling-resource:$espressoVersion"
200-
val androidxTestOrchestrator = "androidx.test:orchestrator:1.5.0"
201-
val androidxJunit = "androidx.test.ext:junit:1.1.5"
202-
val androidxCoreKtx = "androidx.core:core-ktx:1.7.0"
203-
val robolectric = "org.robolectric:robolectric:4.14"
204-
val mockitoKotlin = "org.mockito.kotlin:mockito-kotlin:4.1.0"
205-
val mockitoInline = "org.mockito:mockito-inline:4.8.0"
206155
val awaitility = "org.awaitility:awaitility-kotlin:4.1.1"
207156
val awaitility3 = "org.awaitility:awaitility-kotlin:3.1.6" // need this due to a conflict of awaitility4+ and espresso on hamcrest
208-
val mockWebserver = "com.squareup.okhttp3:mockwebserver:${Libs.okHttpVersion}"
209-
val jsonUnit = "net.javacrumbs.json-unit:json-unit:2.32.0"
210157
val hsqldb = "org.hsqldb:hsqldb:2.6.1"
211158
val javaFaker = "com.github.javafaker:javafaker:1.0.2"
212159
val msgpack = "org.msgpack:msgpack-core:0.9.8"
213160
val leakCanaryInstrumentation = "com.squareup.leakcanary:leakcanary-android-instrumentation:2.14"
214161
val composeUiTestJunit4 = "androidx.compose.ui:ui-test-junit4:1.6.8"
215162
val okio = "com.squareup.okio:okio:1.13.0"
216-
val coroutinesTest = "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.1"
217163
}
218164

219165
object QualityPlugins {
220166
object Jacoco {
221-
val version = "0.8.7"
222-
223167
// TODO [POTEL] add tests and restore
224168
val minimumCoverage = BigDecimal.valueOf(0.1)
225169
}
226-
val spotless = "com.diffplug.spotless"
227-
val spotlessVersion = "6.11.0"
228-
val errorProne = "net.ltgt.errorprone"
229-
val errorpronePlugin = "net.ltgt.gradle:gradle-errorprone-plugin:3.0.1"
230-
val gradleVersionsPlugin = "com.github.ben-manes:gradle-versions-plugin:0.42.0"
231-
val gradleVersions = "com.github.ben-manes.versions"
232-
val detekt = "io.gitlab.arturbosch.detekt"
233-
val detektVersion = "1.23.8"
170+
171+
// this can be removed when we upgrade to Gradle 8, which allows us to use a getter for the plugin ID
234172
val detektPlugin = "io.gitlab.arturbosch.detekt"
235-
val binaryCompatibilityValidatorVersion = "0.13.0"
236-
val binaryCompatibilityValidatorPlugin = "org.jetbrains.kotlinx:binary-compatibility-validator:$binaryCompatibilityValidatorVersion"
237-
val binaryCompatibilityValidator = "org.jetbrains.kotlinx.binary-compatibility-validator"
238-
val jacocoAndroid = "com.mxalbert.gradle.jacoco-android"
239-
val jacocoAndroidVersion = "0.2.0"
240-
val kover = "org.jetbrains.kotlinx.kover"
241-
val koverVersion = "0.7.3"
242173
}
243174

244175
object Sentry {

gradle/libs.versions.toml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,66 @@
11
[versions]
2+
androidxNavigation = "2.4.2"
3+
androidxTestCore = "1.6.1"
4+
androidxComposeVersion = "1.6.3"
5+
jetbrainsComposeVersion = "1.6.11"
6+
espresso = "3.5.0"
27
kotlin = "1.9.24"
8+
# see https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-compatibility-and-versioning.html#kotlin-compatibility
9+
# see https://developer.android.com/jetpack/androidx/releases/compose-kotlin
10+
okhttp = "4.9.2"
11+
springTwo = "2.7.18"
12+
springThree = "3.4.2"
13+
targetSdk = "34"
14+
compileSdk = "34"
15+
minSdk = "21"
16+
jacoco = "0.8.7"
317

418
[plugins]
519
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
620
kotlin-spring = { id = "org.jetbrains.kotlin.plugin.spring", version.ref = "kotlin" }
21+
buildconfig = { id = "com.github.gmazzo.buildconfig", version = "5.6.5" }
22+
dokka = { id = "org.jetbrains.dokka", version = "2.0.0" }
23+
dokka-javadoc = { id = "org.jetbrains.dokka-javadoc", version = "2.0.0" }
24+
binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.13.0" }
25+
compose-compiler = { id = "org.jetbrains.compose", version.ref = "jetbrainsComposeVersion" }
26+
errorprone = { id = "net.ltgt.errorprone", version = "3.0.1" }
27+
gradle-versions = { id = "com.github.ben-manes.versions", version = "0.42.0" }
28+
spotless = { id = "com.diffplug.spotless", version = "6.11.0" }
29+
detekt = { id = "io.gitlab.arturbosch.detekt", version = "1.23.8" }
30+
jacoco-android = { id = "com.mxalbert.gradle.jacoco-android", version = "0.2.0" }
31+
kover = { id = "org.jetbrains.kotlinx.kover", version = "0.7.3" }
32+
vanniktech-maven-publish = { id = "com.vanniktech.maven.publish", version = "0.30.0" }
33+
spring-boot-two = { id = "org.springframework.boot", version.ref = "springTwo" }
34+
spring-boot-three = { id = "org.springframework.boot", version.ref = "springThree" }
35+
spring-dependency-management = { id = "io.spring.dependency-management", version = "1.0.11.RELEASE" }
36+
gretty = { id = "org.gretty", version = "4.0.0" }
737

838
[libraries]
39+
androidx-activity-compose = { module = "androidx.activity:activity-compose", version = "1.8.2" }
40+
androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "androidxComposeVersion" }
41+
androidx-compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout", version.ref = "androidxComposeVersion" }
42+
androidx-compose-material3 = { module = "androidx.compose.material3:material3", version = "1.2.1" }
43+
androidx-compose-ui = { module = "androidx.compose.ui:ui", version.ref = "androidxComposeVersion" }
44+
# Note: don't change without testing forwards compatibility
45+
androidx-compose-ui-replay = { module = "androidx.compose.ui:ui", version = "1.5.0" }
46+
androidx-core = { module = "androidx.core:core", version = "1.3.2"}
47+
androidx-core-ktx = { module = "androidx.core:core-ktx", version = "1.7.0" }
48+
androidx-navigation-runtime = { module = "androidx.navigation:navigation-runtime", version.ref = "androidxNavigation" }
49+
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "androidxNavigation" }
50+
coil-compose = { module = "io.coil-kt:coil-compose", version = "2.6.0" }
951
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
52+
53+
# test libraries
54+
androidx-test-core = { module = "androidx.test:core", version.ref = "androidxTestCore" }
55+
androidx-test-core-ktx = { module = "androidx.test:core-ktx", version.ref = "androidxTestCore" }
56+
androidx-test-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espresso" }
57+
androidx-test-espresso-idling-resource = { module = "androidx.test.espresso:espresso-idling-resource", version.ref = "espresso" }
58+
androidx-test-ext-junit = { module = "androidx.test.ext:junit", version = "1.1.5" }
59+
androidx-test-orchestrator = { module = "androidx.test:orchestrator", version = "1.5.0" }
60+
androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidxTestCore" }
61+
androidx-test-runner = { module = "androidx.test:runner", version = "1.6.2" }
62+
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version = "1.6.1" }
63+
mockito-kotlin = { module = "org.mockito.kotlin:mockito-kotlin", version = "4.1.0" }
64+
mockito-inline = { module = "org.mockito:mockito-inline", version = "4.8.0" }
65+
okhttp-mockwebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "okhttp" }
66+
roboelectric = { module = "org.robolectric:robolectric", version = "4.14" }

sentry-android-core/build.gradle.kts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ plugins {
55
id("com.android.library")
66
kotlin("android")
77
jacoco
8-
id(Config.QualityPlugins.jacocoAndroid)
9-
id(Config.QualityPlugins.errorProne)
10-
id(Config.QualityPlugins.gradleVersions)
8+
alias(libs.plugins.jacoco.android)
9+
alias(libs.plugins.errorprone)
10+
alias(libs.plugins.gradle.versions)
1111
}
1212

1313
android {
14-
compileSdk = Config.Android.compileSdkVersion
14+
compileSdk = libs.versions.compileSdk.get().toInt()
1515
namespace = "io.sentry.android.core"
1616

1717
defaultConfig {
18-
minSdk = Config.Android.minSdkVersion
18+
minSdk = libs.versions.minSdk.get().toInt()
1919

2020
testInstrumentationRunner = Config.TestLibs.androidJUnitRunner
2121

@@ -85,7 +85,7 @@ dependencies {
8585
// lifecycle processor, session tracking
8686
implementation(Config.Libs.lifecycleProcess)
8787
implementation(Config.Libs.lifecycleCommonJava8)
88-
implementation(Config.Libs.androidxCore)
88+
implementation(libs.androidx.core)
8989

9090
compileOnly(Config.CompileOnly.nopen)
9191
errorprone(Config.CompileOnly.nopenChecker)
@@ -95,22 +95,22 @@ dependencies {
9595

9696
// tests
9797
testImplementation(kotlin(Config.kotlinStdLib, KotlinCompilerVersion.VERSION))
98-
testImplementation(Config.TestLibs.robolectric)
98+
testImplementation(libs.roboelectric)
9999
testImplementation(libs.kotlin.test.junit)
100-
testImplementation(Config.TestLibs.androidxCore)
101-
testImplementation(Config.TestLibs.androidxRunner)
102-
testImplementation(Config.TestLibs.androidxJunit)
103-
testImplementation(Config.TestLibs.androidxCoreKtx)
104-
testImplementation(Config.TestLibs.mockitoKotlin)
105-
testImplementation(Config.TestLibs.mockitoInline)
100+
testImplementation(libs.androidx.core.ktx)
101+
testImplementation(libs.androidx.test.core)
102+
testImplementation(libs.androidx.test.ext.junit)
103+
testImplementation(libs.androidx.test.runner)
104+
testImplementation(libs.mockito.kotlin)
105+
testImplementation(libs.mockito.inline)
106106
testImplementation(Config.TestLibs.awaitility)
107107
testImplementation(projects.sentryTestSupport)
108108
testImplementation(projects.sentryAndroidFragment)
109109
testImplementation(projects.sentryAndroidTimber)
110110
testImplementation(projects.sentryAndroidReplay)
111111
testImplementation(projects.sentryCompose)
112112
testImplementation(projects.sentryAndroidNdk)
113-
testRuntimeOnly(Config.Libs.composeUi)
113+
testRuntimeOnly(libs.androidx.compose.ui)
114114
testRuntimeOnly(Config.Libs.timber)
115115
testRuntimeOnly(Config.Libs.fragment)
116116
}

sentry-android-fragment/build.gradle.kts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ plugins {
44
id("com.android.library")
55
kotlin("android")
66
jacoco
7-
id(Config.QualityPlugins.jacocoAndroid)
8-
id(Config.QualityPlugins.gradleVersions)
9-
id(Config.QualityPlugins.detektPlugin)
7+
alias(libs.plugins.jacoco.android)
8+
alias(libs.plugins.gradle.versions)
9+
alias(libs.plugins.detekt)
1010
}
1111

1212
android {
13-
compileSdk = Config.Android.compileSdkVersion
13+
compileSdk = libs.versions.compileSdk.get().toInt()
1414
namespace = "io.sentry.android.fragment"
1515

1616
defaultConfig {
17-
minSdk = Config.Android.minSdkVersion
17+
minSdk = libs.versions.minSdk.get().toInt()
1818

1919
// for AGP 4.1
2020
buildConfigField("String", "VERSION_NAME", "\"${project.version}\"")
@@ -70,8 +70,8 @@ dependencies {
7070
// tests
7171
testImplementation(Config.Libs.fragment)
7272
testImplementation(libs.kotlin.test.junit)
73-
testImplementation(Config.TestLibs.mockitoKotlin)
74-
testImplementation(Config.TestLibs.mockitoInline)
73+
testImplementation(libs.mockito.kotlin)
74+
testImplementation(libs.mockito.inline)
7575
}
7676

7777
tasks.withType<Detekt>().configureEach {

sentry-android-integration-tests/sentry-uitest-android-benchmark/build.gradle.kts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ import net.ltgt.gradle.errorprone.errorprone
44
plugins {
55
id("com.android.application")
66
kotlin("android")
7-
id(Config.QualityPlugins.errorProne)
8-
id(Config.QualityPlugins.gradleVersions)
9-
id(Config.QualityPlugins.detektPlugin)
7+
alias(libs.plugins.errorprone)
8+
alias(libs.plugins.gradle.versions)
9+
alias(libs.plugins.detekt)
1010
}
1111

1212
android {
13-
compileSdk = Config.Android.compileSdkVersion
13+
compileSdk = libs.versions.compileSdk.get().toInt()
1414
namespace = "io.sentry.uitest.android.benchmark"
1515

1616
defaultConfig {
1717
applicationId = "io.sentry.uitest.android.benchmark"
18-
minSdk = Config.Android.minSdkVersion
19-
targetSdk = Config.Android.targetSdkVersion
18+
minSdk = libs.versions.minSdk.get().toInt()
19+
targetSdk = libs.versions.targetSdk.get().toInt()
2020
versionCode = 1
2121
versionName = "1.0.0"
2222

@@ -89,24 +89,24 @@ dependencies {
8989

9090
implementation(projects.sentryAndroid)
9191
implementation(Config.Libs.appCompat)
92-
implementation(Config.Libs.androidxCore)
92+
implementation(libs.androidx.core)
9393
implementation(Config.Libs.androidxRecylerView)
9494
implementation(Config.Libs.constraintLayout)
95-
implementation(Config.TestLibs.espressoIdlingResource)
95+
implementation(libs.androidx.test.espresso.idling.resource)
9696

9797
compileOnly(Config.CompileOnly.nopen)
9898
errorprone(Config.CompileOnly.nopenChecker)
9999
errorprone(Config.CompileOnly.errorprone)
100100
errorprone(Config.CompileOnly.errorProneNullAway)
101101

102+
androidTestUtil(libs.androidx.test.orchestrator)
102103
androidTestImplementation(projects.sentryTestSupport)
103104
androidTestImplementation(libs.kotlin.test.junit)
104-
androidTestImplementation(Config.TestLibs.espressoCore)
105-
androidTestImplementation(Config.TestLibs.androidxTestCoreKtx)
106-
androidTestImplementation(Config.TestLibs.androidxRunner)
107-
androidTestImplementation(Config.TestLibs.androidxTestRules)
108-
androidTestImplementation(Config.TestLibs.androidxJunit)
109-
androidTestUtil(Config.TestLibs.androidxTestOrchestrator)
105+
androidTestImplementation(libs.androidx.test.espresso.core)
106+
androidTestImplementation(libs.androidx.test.core.ktx)
107+
androidTestImplementation(libs.androidx.test.ext.junit)
108+
androidTestImplementation(libs.androidx.test.rules)
109+
androidTestImplementation(libs.androidx.test.runner)
110110
}
111111

112112
tasks.withType<JavaCompile>().configureEach {

0 commit comments

Comments
 (0)