Skip to content

Commit c52239d

Browse files
authored
Merge c253fe1 into ce09ad4
2 parents ce09ad4 + c253fe1 commit c52239d

File tree

70 files changed

+292
-410
lines changed

Some content is hidden

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

70 files changed

+292
-410
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#078)
2424
- [diff](https://github.com/getsentry/sentry-native/compare/0.7.2...0.7.8)
2525

26+
### Breaking Changes
27+
28+
- The Kotlin Language version is now set to 1.6 ([#3839](https://github.com/getsentry/sentry-java/pull/3839))
29+
2630
## 7.17.0
2731

2832
### Features

build.gradle.kts

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import com.diffplug.spotless.LineEnding
22
import com.vanniktech.maven.publish.MavenPublishBaseExtension
3-
import com.vanniktech.maven.publish.MavenPublishPlugin
4-
import com.vanniktech.maven.publish.MavenPublishPluginExtension
53
import groovy.util.Node
64
import io.gitlab.arturbosch.detekt.extensions.DetektExtension
75
import kotlinx.kover.gradle.plugin.dsl.KoverReportExtension
@@ -17,6 +15,7 @@ plugins {
1715
id(Config.QualityPlugins.binaryCompatibilityValidator) version Config.QualityPlugins.binaryCompatibilityValidatorVersion
1816
id(Config.QualityPlugins.jacocoAndroid) version Config.QualityPlugins.jacocoAndroidVersion apply false
1917
id(Config.QualityPlugins.kover) version Config.QualityPlugins.koverVersion apply false
18+
id(Config.BuildPlugins.gradleMavenPublishPlugin) version Config.BuildPlugins.gradleMavenPublishPluginVersion apply false
2019
}
2120

2221
buildscript {
@@ -26,7 +25,6 @@ buildscript {
2625
dependencies {
2726
classpath(Config.BuildPlugins.androidGradle)
2827
classpath(kotlin(Config.BuildPlugins.kotlinGradlePlugin, version = Config.kotlinVersion))
29-
classpath(Config.BuildPlugins.gradleMavenPublishPlugin)
3028
// dokka is required by gradle-maven-publish-plugin.
3129
classpath(Config.BuildPlugins.dokkaPlugin)
3230
classpath(Config.QualityPlugins.errorpronePlugin)
@@ -139,7 +137,7 @@ subprojects {
139137
androidReports("release") {
140138
xml {
141139
// Change the report file name so the Codecov Github action can find it
142-
setReportFile(file("$buildDir/reports/kover/report.xml"))
140+
setReportFile(project.layout.buildDirectory.file("reports/kover/report.xml").get().asFile)
143141
}
144142
}
145143
}
@@ -156,6 +154,7 @@ subprojects {
156154

157155
if (!this.name.contains("sample") && !this.name.contains("integration-tests") && this.name != "sentry-test-support" && this.name != "sentry-compose-helper") {
158156
apply<DistributionPlugin>()
157+
apply<com.vanniktech.maven.publish.MavenPublishPlugin>()
159158

160159
val sep = File.separator
161160

@@ -178,23 +177,15 @@ subprojects {
178177
tasks.named("distZip").configure {
179178
this.dependsOn("publishToMavenLocal")
180179
this.doLast {
181-
val distributionFilePath =
182-
"${this.project.buildDir}${sep}distributions${sep}${this.project.name}-${this.project.version}.zip"
183-
val file = File(distributionFilePath)
184-
if (!file.exists()) throw IllegalStateException("Distribution file: $distributionFilePath does not exist")
185-
if (file.length() == 0L) throw IllegalStateException("Distribution file: $distributionFilePath is empty")
180+
val file = this.project.layout.buildDirectory.file("distributions${sep}${this.project.name}-${this.project.version}.zip").get().asFile
181+
if (!file.exists()) throw IllegalStateException("Distribution file: ${file.absolutePath} does not exist")
182+
if (file.length() == 0L) throw IllegalStateException("Distribution file: ${file.absolutePath} is empty")
186183
}
187184
}
188185

189186
afterEvaluate {
190187
apply<MavenPublishPlugin>()
191188

192-
configure<MavenPublishPluginExtension> {
193-
// signing is done when uploading files to MC
194-
// via gpg:sign-and-deploy-file (release.kts)
195-
releaseSigningEnabled = false
196-
}
197-
198189
@Suppress("UnstableApiUsage")
199190
configure<MavenPublishBaseExtension> {
200191
assignAarTypes()
@@ -205,7 +196,7 @@ subprojects {
205196
repositories {
206197
maven {
207198
name = "unityMaven"
208-
url = file("${rootProject.buildDir}/unityMaven").toURI()
199+
url = rootProject.layout.buildDirectory.file("unityMaven").get().asFile.toURI()
209200
}
210201
}
211202
}
@@ -242,7 +233,7 @@ spotless {
242233

243234
gradle.projectsEvaluated {
244235
tasks.create("aggregateJavadocs", Javadoc::class.java) {
245-
setDestinationDir(file("$buildDir/docs/javadoc"))
236+
setDestinationDir(project.layout.buildDirectory.file("docs/javadoc").get().asFile)
246237
title = "${project.name} $version API"
247238
val opts = options as StandardJavadocDocletOptions
248239
opts.quiet()

buildSrc/src/main/java/Config.kt

Lines changed: 18 additions & 15 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.3.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.28.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"
@@ -43,7 +46,7 @@ object Config {
4346

4447
val abiFilters = listOf("x86", "armeabi-v7a", "x86_64", "arm64-v8a")
4548

46-
fun shouldSkipDebugVariant(name: String): Boolean {
49+
fun shouldSkipDebugVariant(name: String?): Boolean {
4750
return System.getenv("CI")?.toBoolean() ?: false && name == "debug"
4851
}
4952
}
@@ -144,13 +147,13 @@ object Config {
144147

145148
// compose deps
146149
val composeNavigation = "androidx.navigation:navigation-compose:$navigationVersion"
147-
val composeActivity = "androidx.activity:activity-compose:1.4.0"
148-
val composeFoundation = "androidx.compose.foundation:foundation:$composeVersion"
149-
val composeUi = "androidx.compose.ui:ui:$composeVersion"
150+
val composeActivity = "androidx.activity:activity-compose:1.8.2"
151+
val composeFoundation = "androidx.compose.foundation:foundation:1.6.3"
152+
val composeUi = "androidx.compose.ui:ui:1.6.3"
153+
val composeFoundationLayout = "androidx.compose.foundation:foundation-layout:1.6.3"
154+
val composeMaterial = "androidx.compose.material3:material3:1.2.1"
150155

151156
val composeUiReplay = "androidx.compose.ui:ui:1.5.0" // Note: don't change without testing forwards compatibility
152-
val composeFoundationLayout = "androidx.compose.foundation:foundation-layout:$composeVersion"
153-
val composeMaterial = "androidx.compose.material3:material3:1.0.0-alpha13"
154157
val composeCoil = "io.coil-kt:coil-compose:2.6.0"
155158

156159
val apolloKotlin = "com.apollographql.apollo3:apollo-runtime:3.8.2"
@@ -190,7 +193,7 @@ object Config {
190193
val androidxTestOrchestrator = "androidx.test:orchestrator:1.5.0"
191194
val androidxJunit = "androidx.test.ext:junit:1.1.5"
192195
val androidxCoreKtx = "androidx.core:core-ktx:1.7.0"
193-
val robolectric = "org.robolectric:robolectric:4.10.3"
196+
val robolectric = "org.robolectric:robolectric:4.14"
194197
val mockitoKotlin = "org.mockito.kotlin:mockito-kotlin:4.1.0"
195198
val mockitoInline = "org.mockito:mockito-inline:4.8.0"
196199
val awaitility = "org.awaitility:awaitility-kotlin:4.1.1"
@@ -214,7 +217,7 @@ object Config {
214217
val gradleVersionsPlugin = "com.github.ben-manes:gradle-versions-plugin:0.42.0"
215218
val gradleVersions = "com.github.ben-manes.versions"
216219
val detekt = "io.gitlab.arturbosch.detekt"
217-
val detektVersion = "1.19.0"
220+
val detektVersion = "1.23.5"
218221
val detektPlugin = "io.gitlab.arturbosch.detekt"
219222
val binaryCompatibilityValidatorVersion = "0.13.0"
220223
val binaryCompatibilityValidatorPlugin = "org.jetbrains.kotlinx:binary-compatibility-validator:$binaryCompatibilityValidatorVersion"

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=7.17.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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
34
<uses-permission android:name="android.permission.INTERNET"/>
5+
46
<application>
57
<!-- 'android:authorities' must be unique in the device, across all apps -->
68
<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,

sentry-android-core/src/test/java/io/sentry/android/core/ContextUtilsTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.sentry.android.core
22

3+
import android.annotation.SuppressLint
34
import android.app.ActivityManager
45
import android.app.ActivityManager.MemoryInfo
56
import android.app.ActivityManager.RunningAppProcessInfo
@@ -174,6 +175,7 @@ class ContextUtilsTest {
174175
assertNull(memInfo)
175176
}
176177

178+
@SuppressLint("UnspecifiedRegisterReceiverFlag")
177179
@Test
178180
fun `registerReceiver calls context_registerReceiver without exported flag on API 32-`() {
179181
val buildInfo = mock<BuildInfoProvider>()

sentry-android-core/src/test/java/io/sentry/android/core/SystemEventsBreadcrumbsIntegrationTest.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package io.sentry.android.core
33
import android.content.Context
44
import android.content.Intent
55
import android.os.BatteryManager
6+
import android.os.Build
67
import androidx.test.ext.junit.runners.AndroidJUnit4
78
import io.sentry.Breadcrumb
89
import io.sentry.IHub
@@ -19,13 +20,15 @@ import org.mockito.kotlin.never
1920
import org.mockito.kotlin.verify
2021
import org.mockito.kotlin.verifyNoMoreInteractions
2122
import org.mockito.kotlin.whenever
23+
import org.robolectric.annotation.Config
2224
import kotlin.test.Test
2325
import kotlin.test.assertEquals
2426
import kotlin.test.assertFalse
2527
import kotlin.test.assertNotNull
2628
import kotlin.test.assertNull
2729

2830
@RunWith(AndroidJUnit4::class)
31+
@Config(sdk = [Build.VERSION_CODES.TIRAMISU])
2932
class SystemEventsBreadcrumbsIntegrationTest {
3033

3134
private class Fixture {
@@ -50,7 +53,7 @@ class SystemEventsBreadcrumbsIntegrationTest {
5053

5154
sut.register(fixture.hub, fixture.options)
5255

53-
verify(fixture.context).registerReceiver(any(), any())
56+
verify(fixture.context).registerReceiver(any(), any(), any())
5457
assertNotNull(sut.receiver)
5558
}
5659

@@ -69,7 +72,7 @@ class SystemEventsBreadcrumbsIntegrationTest {
6972

7073
sut.register(fixture.hub, fixture.options)
7174

72-
verify(fixture.context, never()).registerReceiver(any(), any())
75+
verify(fixture.context, never()).registerReceiver(any(), any(), any())
7376
assertNull(sut.receiver)
7477
}
7578

@@ -174,7 +177,7 @@ class SystemEventsBreadcrumbsIntegrationTest {
174177
@Test
175178
fun `Do not crash if registerReceiver throws exception`() {
176179
val sut = fixture.getSut()
177-
whenever(fixture.context.registerReceiver(any(), any())).thenThrow(SecurityException())
180+
whenever(fixture.context.registerReceiver(any(), any(), any())).thenThrow(SecurityException())
178181

179182
sut.register(fixture.hub, fixture.options)
180183

0 commit comments

Comments
 (0)