Skip to content

Commit 2cfebea

Browse files
authored
Merge 8ae3c3f into ba51699
2 parents ba51699 + 8ae3c3f commit 2cfebea

File tree

93 files changed

+304
-551
lines changed

Some content is hidden

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

93 files changed

+304
-551
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- cron: '17 23 * * 3'
1111

1212
concurrency:
13-
group: ${{ github.workflow }}-${{ github.ref }}
13+
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.language }}
1414
cancel-in-progress: true
1515

1616
jobs:

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Breaking Changes
6+
7+
- The Kotlin Language version is now set to 1.6 ([#3936](https://github.com/getsentry/sentry-java/pull/3936))
8+
59
### Fixes
610

711
- Do not log if `OtelContextScopesStorage` cannot be found ([#4127](https://github.com/getsentry/sentry-java/pull/4127))

build.gradle.kts

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import com.diffplug.spotless.LineEnding
2+
import com.vanniktech.maven.publish.JavaLibrary
3+
import com.vanniktech.maven.publish.JavadocJar
24
import com.vanniktech.maven.publish.MavenPublishBaseExtension
3-
import com.vanniktech.maven.publish.MavenPublishPlugin
4-
import com.vanniktech.maven.publish.MavenPublishPluginExtension
55
import groovy.util.Node
66
import io.gitlab.arturbosch.detekt.extensions.DetektExtension
77
import kotlinx.kover.gradle.plugin.dsl.KoverReportExtension
@@ -17,6 +17,7 @@ plugins {
1717
id(Config.QualityPlugins.binaryCompatibilityValidator) version Config.QualityPlugins.binaryCompatibilityValidatorVersion
1818
id(Config.QualityPlugins.jacocoAndroid) version Config.QualityPlugins.jacocoAndroidVersion apply false
1919
id(Config.QualityPlugins.kover) version Config.QualityPlugins.koverVersion apply false
20+
id(Config.BuildPlugins.gradleMavenPublishPlugin) version Config.BuildPlugins.gradleMavenPublishPluginVersion apply false
2021
}
2122

2223
buildscript {
@@ -26,7 +27,6 @@ buildscript {
2627
dependencies {
2728
classpath(Config.BuildPlugins.androidGradle)
2829
classpath(kotlin(Config.BuildPlugins.kotlinGradlePlugin, version = Config.kotlinVersion))
29-
classpath(Config.BuildPlugins.gradleMavenPublishPlugin)
3030
// dokka is required by gradle-maven-publish-plugin.
3131
classpath(Config.BuildPlugins.dokkaPlugin)
3232
classpath(Config.QualityPlugins.errorpronePlugin)
@@ -140,7 +140,7 @@ subprojects {
140140
androidReports("release") {
141141
xml {
142142
// Change the report file name so the Codecov Github action can find it
143-
setReportFile(file("$buildDir/reports/kover/report.xml"))
143+
setReportFile(project.layout.buildDirectory.file("reports/kover/report.xml").get().asFile)
144144
}
145145
}
146146
}
@@ -157,6 +157,7 @@ subprojects {
157157

158158
if (!this.name.contains("sample") && !this.name.contains("integration-tests") && this.name != "sentry-test-support" && this.name != "sentry-compose-helper") {
159159
apply<DistributionPlugin>()
160+
apply<com.vanniktech.maven.publish.MavenPublishPlugin>()
160161

161162
val sep = File.separator
162163

@@ -179,22 +180,30 @@ subprojects {
179180
tasks.named("distZip").configure {
180181
this.dependsOn("publishToMavenLocal")
181182
this.doLast {
182-
val distributionFilePath =
183-
"${this.project.buildDir}${sep}distributions${sep}${this.project.name}-${this.project.version}.zip"
184-
val file = File(distributionFilePath)
185-
if (!file.exists()) throw IllegalStateException("Distribution file: $distributionFilePath does not exist")
186-
if (file.length() == 0L) throw IllegalStateException("Distribution file: $distributionFilePath is empty")
183+
val file = this.project.layout.buildDirectory.file("distributions${sep}${this.project.name}-${this.project.version}.zip").get().asFile
184+
if (!file.exists()) throw IllegalStateException("Distribution file: ${file.absolutePath} does not exist")
185+
if (file.length() == 0L) throw IllegalStateException("Distribution file: ${file.absolutePath} is empty")
187186
}
188187
}
189188

190-
afterEvaluate {
191-
apply<MavenPublishPlugin>()
189+
plugins.withId("java-library") {
190+
configure<MavenPublishBaseExtension> {
191+
// we have to disable javadoc publication in maven-publish plugin as it's not
192+
// including it in the .module file https://github.com/vanniktech/gradle-maven-publish-plugin/issues/861
193+
// and do it ourselves
194+
configure(JavaLibrary(JavadocJar.None(), sourcesJar = true))
195+
}
196+
197+
configure<JavaPluginExtension> {
198+
withJavadocJar()
192199

193-
configure<MavenPublishPluginExtension> {
194-
// signing is done when uploading files to MC
195-
// via gpg:sign-and-deploy-file (release.kts)
196-
releaseSigningEnabled = false
200+
sourceCompatibility = JavaVersion.VERSION_1_8
201+
targetCompatibility = JavaVersion.VERSION_1_8
197202
}
203+
}
204+
205+
afterEvaluate {
206+
apply<MavenPublishPlugin>()
198207

199208
@Suppress("UnstableApiUsage")
200209
configure<MavenPublishBaseExtension> {
@@ -206,7 +215,7 @@ subprojects {
206215
repositories {
207216
maven {
208217
name = "unityMaven"
209-
url = file("${rootProject.buildDir}/unityMaven").toURI()
218+
url = rootProject.layout.buildDirectory.file("unityMaven").get().asFile.toURI()
210219
}
211220
}
212221
}
@@ -243,7 +252,7 @@ spotless {
243252

244253
gradle.projectsEvaluated {
245254
tasks.create("aggregateJavadocs", Javadoc::class.java) {
246-
setDestinationDir(file("$buildDir/docs/javadoc"))
255+
setDestinationDir(project.layout.buildDirectory.file("docs/javadoc").get().asFile)
247256
title = "${project.name} $version API"
248257
val opts = options as StandardJavadocDocletOptions
249258
opts.quiet()

buildSrc/src/main/java/Config.kt

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22
import java.math.BigDecimal
33

44
object Config {
5-
val AGP = System.getenv("VERSION_AGP") ?: "7.4.2"
6-
val kotlinVersion = "1.8.0"
5+
val AGP = System.getenv("VERSION_AGP") ?: "8.6.0"
6+
val kotlinVersion = "1.9.24"
77
val kotlinStdLib = "stdlib-jdk8"
88

99
val springBootVersion = "2.7.5"
1010
val springBoot3Version = "3.4.2"
11-
val kotlinCompatibleLanguageVersion = "1.4"
11+
val kotlinCompatibleLanguageVersion = "1.6"
1212

13-
val composeVersion = "1.5.3"
14-
val androidComposeCompilerVersion = "1.4.0"
13+
// see https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-compatibility-and-versioning.html#kotlin-compatibility
14+
// see https://developer.android.com/jetpack/androidx/releases/compose-kotlin
15+
val composeVersion = "1.6.11"
16+
val androidComposeCompilerVersion = "1.5.14"
1517

1618
object BuildPlugins {
1719
val androidGradle = "com.android.tools.build:gradle:$AGP"
@@ -23,8 +25,9 @@ object Config {
2325
val springDependencyManagementVersion = "1.0.11.RELEASE"
2426
val gretty = "org.gretty"
2527
val grettyVersion = "4.0.0"
26-
val gradleMavenPublishPlugin = "com.vanniktech:gradle-maven-publish-plugin:0.18.0"
27-
val dokkaPlugin = "org.jetbrains.dokka:dokka-gradle-plugin:1.7.10"
28+
val gradleMavenPublishPlugin = "com.vanniktech.maven.publish"
29+
val gradleMavenPublishPluginVersion = "0.30.0"
30+
val dokkaPlugin = "org.jetbrains.dokka:dokka-gradle-plugin:1.9.20"
2831
val dokkaPluginAlias = "org.jetbrains.dokka"
2932
val composeGradlePlugin = "org.jetbrains.compose:compose-gradle-plugin:$composeVersion"
3033
val commonsCompressOverride = "org.apache.commons:commons-compress:1.25.0"
@@ -39,7 +42,7 @@ object Config {
3942

4043
val abiFilters = listOf("x86", "armeabi-v7a", "x86_64", "arm64-v8a")
4144

42-
fun shouldSkipDebugVariant(name: String): Boolean {
45+
fun shouldSkipDebugVariant(name: String?): Boolean {
4346
return System.getenv("CI")?.toBoolean() ?: false && name == "debug"
4447
}
4548
}
@@ -58,6 +61,7 @@ object Config {
5861
val androidxCore = "androidx.core:core:1.3.2"
5962
val androidxSqlite = "androidx.sqlite:sqlite:2.3.1"
6063
val androidxRecylerView = "androidx.recyclerview:recyclerview:1.2.1"
64+
val androidxAnnotation = "androidx.annotation:annotation:1.9.1"
6165

6266
val slf4jApi = "org.slf4j:slf4j-api:1.7.30"
6367
val slf4jApi2 = "org.slf4j:slf4j-api:2.0.5"
@@ -142,14 +146,14 @@ object Config {
142146

143147
// compose deps
144148
val composeNavigation = "androidx.navigation:navigation-compose:$navigationVersion"
145-
val composeActivity = "androidx.activity:activity-compose:1.4.0"
146-
val composeFoundation = "androidx.compose.foundation:foundation:$composeVersion"
147-
val composeUi = "androidx.compose.ui:ui:$composeVersion"
149+
val composeActivity = "androidx.activity:activity-compose:1.8.2"
150+
val composeFoundation = "androidx.compose.foundation:foundation:1.6.3"
151+
val composeUi = "androidx.compose.ui:ui:1.6.3"
152+
val composeFoundationLayout = "androidx.compose.foundation:foundation-layout:1.6.3"
153+
val composeMaterial = "androidx.compose.material3:material3:1.2.1"
148154

149155
val composeUiReplay = "androidx.compose.ui:ui:1.5.0" // Note: don't change without testing forwards compatibility
150-
val composeFoundationLayout = "androidx.compose.foundation:foundation-layout:$composeVersion"
151-
val composeMaterial = "androidx.compose.material3:material3:1.0.0-alpha13"
152-
val composeCoil = "io.coil-kt:coil-compose:2.0.0"
156+
val composeCoil = "io.coil-kt:coil-compose:2.6.0"
153157

154158
val apolloKotlin = "com.apollographql.apollo3:apollo-runtime:3.8.2"
155159

@@ -193,7 +197,7 @@ object Config {
193197
val androidxTestOrchestrator = "androidx.test:orchestrator:1.5.0"
194198
val androidxJunit = "androidx.test.ext:junit:1.1.5"
195199
val androidxCoreKtx = "androidx.core:core-ktx:1.7.0"
196-
val robolectric = "org.robolectric:robolectric:4.10.3"
200+
val robolectric = "org.robolectric:robolectric:4.14"
197201
val mockitoKotlin = "org.mockito.kotlin:mockito-kotlin:4.1.0"
198202
val mockitoInline = "org.mockito:mockito-inline:4.8.0"
199203
val awaitility = "org.awaitility:awaitility-kotlin:4.1.1"
@@ -220,7 +224,7 @@ object Config {
220224
val gradleVersionsPlugin = "com.github.ben-manes:gradle-versions-plugin:0.42.0"
221225
val gradleVersions = "com.github.ben-manes.versions"
222226
val detekt = "io.gitlab.arturbosch.detekt"
223-
val detektVersion = "1.19.0"
227+
val detektVersion = "1.23.5"
224228
val detektPlugin = "io.gitlab.arturbosch.detekt"
225229
val binaryCompatibilityValidatorVersion = "0.13.0"
226230
val binaryCompatibilityValidatorPlugin = "org.jetbrains.kotlinx:binary-compatibility-validator:$binaryCompatibilityValidatorVersion"

buildSrc/src/main/java/Publication.kt

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ fun DistributionContainer.configureForMultiplatform(project: Project) {
2424
}
2525
from("build${sep}libs") {
2626
include("*android*")
27-
withJavadoc(renameTo = "compose-android")
27+
include("*androidRelease-javadoc*")
28+
rename {
29+
it.replace("androidRelease-javadoc", "android")
30+
}
2831
}
2932
}
3033
this.getByName("main").contents {
@@ -38,8 +41,8 @@ fun DistributionContainer.configureForMultiplatform(project: Project) {
3841
rename {
3942
it.replace("-kotlin", "")
4043
.replace("-metadata", "")
44+
.replace("Multiplatform-javadoc", "")
4145
}
42-
withJavadoc()
4346
}
4447
}
4548
this.maybeCreate("desktop").contents {
@@ -49,7 +52,10 @@ fun DistributionContainer.configureForMultiplatform(project: Project) {
4952
}
5053
from("build${sep}libs") {
5154
include("*desktop*")
52-
withJavadoc(renameTo = "compose-desktop")
55+
include("*desktop-javadoc*")
56+
rename {
57+
it.replace("desktop-javadoc", "desktop")
58+
}
5359
}
5460
}
5561

@@ -77,16 +83,13 @@ fun DistributionContainer.configureForJvm(project: Project) {
7783
from("build${sep}publications${sep}release") {
7884
renameModule(project.name, version = version)
7985
}
80-
}
81-
}
82-
83-
private fun CopySpec.withJavadoc(renameTo: String = "compose") {
84-
include("*javadoc*")
85-
rename {
86-
if (it.contains("javadoc")) {
87-
it.replace("compose", renameTo)
88-
} else {
89-
it
86+
from("build${sep}intermediates${sep}java_doc_jar${sep}release") {
87+
include("*javadoc*")
88+
rename { it.replace("release", "${project.name}-$version") }
89+
}
90+
from("build${sep}intermediates${sep}source_jar${sep}release") {
91+
include("*sources*")
92+
rename { it.replace("release", "${project.name}-$version") }
9093
}
9194
}
9295
}

gradle.properties

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ org.gradle.workers.max=2
99
# AndroidX required by AGP >= 3.6.x
1010
android.useAndroidX=true
1111

12-
# Required by AGP >= 8.0.x
13-
android.defaults.buildfeatures.buildconfig=true
14-
1512
# Release information
1613
versionName=8.1.0
1714

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

sentry-android-core/build.gradle.kts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ android {
1515
namespace = "io.sentry.android.core"
1616

1717
defaultConfig {
18-
targetSdk = Config.Android.targetSdkVersion
1918
minSdk = Config.Android.minSdkVersion
2019

2120
testInstrumentationRunner = Config.TestLibs.androidJUnitRunner
@@ -53,15 +52,17 @@ android {
5352
checkReleaseBuilds = false
5453
}
5554

55+
buildFeatures {
56+
buildConfig = true
57+
}
58+
5659
// needed because of Kotlin 1.4.x
5760
configurations.all {
5861
resolutionStrategy.force(Config.CompileOnly.jetbrainsAnnotations)
5962
}
6063

61-
variantFilter {
62-
if (Config.Android.shouldSkipDebugVariant(buildType.name)) {
63-
ignore = true
64-
}
64+
androidComponents.beforeVariants {
65+
it.enable = !Config.Android.shouldSkipDebugVariant(it.buildType)
6566
}
6667
}
6768

sentry-android-core/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
33
<uses-permission android:name="android.permission.INTERNET"/>
4+
45
<application>
56
<!-- 'android:authorities' must be unique in the device, across all apps -->
67
<provider

sentry-android-core/src/main/java/io/sentry/android/core/internal/util/SentryFrameMetricsCollector.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ public SentryFrameMetricsCollector(
6868
this(context, logger, buildInfoProvider, new WindowFrameMetricsManager() {});
6969
}
7070

71-
@SuppressWarnings("deprecation")
7271
@SuppressLint({"NewApi", "DiscouragedPrivateApi"})
7372
public SentryFrameMetricsCollector(
7473
final @NotNull Context context,
@@ -79,7 +78,7 @@ public SentryFrameMetricsCollector(
7978
}
8079

8180
@SuppressWarnings("deprecation")
82-
@SuppressLint({"NewApi", "DiscouragedPrivateApi"})
81+
@SuppressLint({"NewApi", "PrivateApi"})
8382
public SentryFrameMetricsCollector(
8483
final @NotNull Context context,
8584
final @NotNull ILogger logger,

0 commit comments

Comments
 (0)