Skip to content

Commit dc58590

Browse files
authored
Bump: AGP to 4.2.0 (getsentry#1460)
1 parent d89dce1 commit dc58590

13 files changed

Lines changed: 30 additions & 45 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
* Fix: sentry-android-timber package sets sentry.java.android.timber as SDK name (#1456)
44
* Fix: When AppLifecycleIntegration is closed, it should remove observer using UI thread (#1459)
5+
* Bump: AGP to 4.2.0 (#1460)
56

67
Breaking Changes:
78

build.gradle.kts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ plugins {
1515
buildscript {
1616
repositories {
1717
google()
18-
jcenter()
19-
maven { setUrl("https://kotlin.bintray.com/kotlinx") }
2018
}
2119
dependencies {
2220
classpath(Config.BuildPlugins.androidGradle)
@@ -43,7 +41,6 @@ apply(plugin = Config.QualityPlugins.binaryCompatibilityValidator)
4341
allprojects {
4442
repositories {
4543
google()
46-
jcenter()
4744
mavenCentral()
4845
}
4946
group = Config.Sentry.group

buildSrc/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
}
44

55
repositories {
6-
jcenter()
6+
mavenCentral()
77
}
88

99
// Disabling the warning about the use of experimental Kotlin compiler features

buildSrc/src/main/java/Config.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ object Config {
1010
val springKotlinCompatibleLanguageVersion = "1.3"
1111

1212
object BuildPlugins {
13-
val androidGradle = "com.android.tools.build:gradle:4.1.3"
13+
val androidGradle = "com.android.tools.build:gradle:4.2.0"
1414
val kotlinGradlePlugin = "gradle-plugin"
1515
val buildConfig = "com.github.gmazzo.buildconfig"
1616
val buildConfigVersion = "3.0.0"
@@ -116,7 +116,8 @@ object Config {
116116
val gradleVersionsPlugin = "com.github.ben-manes:gradle-versions-plugin:0.36.0"
117117
val gradleVersions = "com.github.ben-manes.versions"
118118
val detekt = "io.gitlab.arturbosch.detekt"
119-
val detektVersion = "1.16.0"
119+
// use RC2 to drop jcenter because of kotlinx-html
120+
val detektVersion = "1.17.0-RC2"
120121
val detektPlugin = "io.gitlab.arturbosch.detekt"
121122
val binaryCompatibilityValidatorPlugin = "org.jetbrains.kotlinx:binary-compatibility-validator:0.5.0"
122123
val binaryCompatibilityValidator = "binary-compatibility-validator"

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Daemon’s heap size
2-
org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=512m -XX:MaxMetaspaceSize=1536m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
2+
org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=512m -XX:MaxMetaspaceSize=1536m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC
33

44
# AndroidX required by AGP >= 3.6.x
55
android.useAndroidX=true

sentry-android-core/build.gradle.kts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ android {
3333
}
3434
}
3535

36-
compileOptions {
37-
sourceCompatibility = JavaVersion.VERSION_1_8
38-
targetCompatibility = JavaVersion.VERSION_1_8
39-
}
40-
4136
kotlinOptions {
4237
jvmTarget = JavaVersion.VERSION_1_8.toString()
4338
}

sentry-android-ndk/build.gradle.kts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ android {
6060
}
6161
}
6262

63-
compileOptions {
64-
sourceCompatibility = JavaVersion.VERSION_1_8
65-
targetCompatibility = JavaVersion.VERSION_1_8
66-
}
67-
6863
kotlinOptions {
6964
jvmTarget = JavaVersion.VERSION_1_8.toString()
7065
}

sentry-android-okhttp/build.gradle.kts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ android {
3131
}
3232
}
3333

34-
compileOptions {
35-
sourceCompatibility = JavaVersion.VERSION_1_8
36-
targetCompatibility = JavaVersion.VERSION_1_8
37-
}
38-
3934
kotlinOptions {
4035
jvmTarget = JavaVersion.VERSION_1_8.toString()
4136
}

sentry-android-okhttp/src/test/java/io/sentry/android/okhttp/SentryOkHttpInterceptorTest.kt

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,19 @@ class SentryOkHttpInterceptorTest {
4040
whenever(hub.options).thenReturn(SentryOptions())
4141
}
4242

43-
fun getSut(isSpanActive: Boolean = true, httpStatusCode: Int = 201, responseBody: String = "success", socketPolicy: SocketPolicy = SocketPolicy.KEEP_OPEN): OkHttpClient {
43+
fun getSut(
44+
isSpanActive: Boolean = true,
45+
httpStatusCode: Int = 201,
46+
responseBody: String = "success",
47+
socketPolicy: SocketPolicy = SocketPolicy.KEEP_OPEN
48+
): OkHttpClient {
4449
if (isSpanActive) {
4550
whenever(hub.span).thenReturn(sentryTracer)
4651
}
47-
server.enqueue(MockResponse().setBody(responseBody).setSocketPolicy(socketPolicy).setResponseCode(httpStatusCode))
52+
server.enqueue(MockResponse()
53+
.setBody(responseBody)
54+
.setSocketPolicy(socketPolicy)
55+
.setResponseCode(httpStatusCode))
4856
server.start()
4957
return OkHttpClient.Builder().addInterceptor(interceptor).build()
5058
}
@@ -53,7 +61,9 @@ class SentryOkHttpInterceptorTest {
5361
private val fixture = Fixture()
5462

5563
private val getRequest = { Request.Builder().get().url(fixture.server.url("/hello")).build() }
56-
private val postRequest = { Request.Builder().post("request-body".toRequestBody("text/plain".toMediaType())).url(fixture.server.url("/hello")).build() }
64+
private val postRequest = { Request.Builder().post("request-body"
65+
.toRequestBody("text/plain"
66+
.toMediaType())).url(fixture.server.url("/hello")).build() }
5767

5868
@Test
5969
fun `when there is an active span, adds sentry trace header to the request`() {
@@ -117,6 +127,7 @@ class SentryOkHttpInterceptorTest {
117127
})
118128
}
119129

130+
@SuppressWarnings("SwallowedException")
120131
@Test
121132
fun `adds breadcrumb when http calls results in exception`() {
122133
val chain = mock<Interceptor.Chain>()
@@ -126,19 +137,24 @@ class SentryOkHttpInterceptorTest {
126137
try {
127138
fixture.interceptor.intercept(chain)
128139
fail()
129-
} catch (e: IOException) {}
130-
140+
} catch (e: IOException) {
141+
// ignore me
142+
}
131143
verify(fixture.hub).addBreadcrumb(check<Breadcrumb> {
132144
assertEquals("http", it.type)
133145
})
134146
}
135147

148+
@SuppressWarnings("SwallowedException")
136149
@Test
137150
fun `sets status and throwable when call results in IOException`() {
138151
val sut = fixture.getSut(socketPolicy = SocketPolicy.DISCONNECT_AT_START)
139152
try {
140153
sut.newCall(getRequest()).execute()
141-
} catch (e: IOException) {}
154+
fail()
155+
} catch (e: IOException) {
156+
// ignore
157+
}
142158
val httpClientSpan = fixture.sentryTracer.children.first()
143159
assertEquals(SpanStatus.INTERNAL_ERROR, httpClientSpan.status)
144160
assertTrue(httpClientSpan.throwable is IOException)

sentry-android-timber/build.gradle.kts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ android {
3535
}
3636
}
3737

38-
compileOptions {
39-
sourceCompatibility = JavaVersion.VERSION_1_8
40-
targetCompatibility = JavaVersion.VERSION_1_8
41-
}
42-
4338
kotlinOptions {
4439
jvmTarget = JavaVersion.VERSION_1_8.toString()
4540
}

0 commit comments

Comments
 (0)