Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump: AGP to 4.2.0 #1460

Merged
merged 8 commits into from
May 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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

Breaking Changes:

Expand Down
3 changes: 0 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ plugins {
buildscript {
repositories {
google()
jcenter()
maven { setUrl("https://kotlin.bintray.com/kotlinx") }
}
dependencies {
classpath(Config.BuildPlugins.androidGradle)
Expand All @@ -43,7 +41,6 @@ apply(plugin = Config.QualityPlugins.binaryCompatibilityValidator)
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
group = Config.Sentry.group
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

repositories {
jcenter()
mavenCentral()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rip

}

// Disabling the warning about the use of experimental Kotlin compiler features
Expand Down
5 changes: 3 additions & 2 deletions buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ object Config {
val springKotlinCompatibleLanguageVersion = "1.3"

object BuildPlugins {
val androidGradle = "com.android.tools.build:gradle:4.1.3"
val androidGradle = "com.android.tools.build:gradle:4.2.0"
val kotlinGradlePlugin = "gradle-plugin"
val buildConfig = "com.github.gmazzo.buildconfig"
val buildConfigVersion = "3.0.0"
Expand Down Expand Up @@ -116,7 +116,8 @@ object Config {
val gradleVersionsPlugin = "com.github.ben-manes:gradle-versions-plugin:0.36.0"
val gradleVersions = "com.github.ben-manes.versions"
val detekt = "io.gitlab.arturbosch.detekt"
val detektVersion = "1.16.0"
// use RC2 to drop jcenter because of kotlinx-html
val detektVersion = "1.17.0-RC2"
val detektPlugin = "io.gitlab.arturbosch.detekt"
val binaryCompatibilityValidatorPlugin = "org.jetbrains.kotlinx:binary-compatibility-validator:0.5.0"
val binaryCompatibilityValidator = "binary-compatibility-validator"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Daemon’s heap size
org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=512m -XX:MaxMetaspaceSize=1536m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=512m -XX:MaxMetaspaceSize=1536m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC

# AndroidX required by AGP >= 3.6.x
android.useAndroidX=true
Expand Down
5 changes: 0 additions & 5 deletions sentry-android-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ android {
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
Expand Down
5 changes: 0 additions & 5 deletions sentry-android-ndk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ android {
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
Expand Down
5 changes: 0 additions & 5 deletions sentry-android-okhttp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ android {
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,19 @@ class SentryOkHttpInterceptorTest {
whenever(hub.options).thenReturn(SentryOptions())
}

fun getSut(isSpanActive: Boolean = true, httpStatusCode: Int = 201, responseBody: String = "success", socketPolicy: SocketPolicy = SocketPolicy.KEEP_OPEN): OkHttpClient {
fun getSut(
isSpanActive: Boolean = true,
httpStatusCode: Int = 201,
responseBody: String = "success",
socketPolicy: SocketPolicy = SocketPolicy.KEEP_OPEN
): OkHttpClient {
if (isSpanActive) {
whenever(hub.span).thenReturn(sentryTracer)
}
server.enqueue(MockResponse().setBody(responseBody).setSocketPolicy(socketPolicy).setResponseCode(httpStatusCode))
server.enqueue(MockResponse()
.setBody(responseBody)
.setSocketPolicy(socketPolicy)
.setResponseCode(httpStatusCode))
server.start()
return OkHttpClient.Builder().addInterceptor(interceptor).build()
}
Expand All @@ -53,7 +61,9 @@ class SentryOkHttpInterceptorTest {
private val fixture = Fixture()

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

@Test
fun `when there is an active span, adds sentry trace header to the request`() {
Expand Down Expand Up @@ -117,6 +127,7 @@ class SentryOkHttpInterceptorTest {
})
}

@SuppressWarnings("SwallowedException")
@Test
fun `adds breadcrumb when http calls results in exception`() {
val chain = mock<Interceptor.Chain>()
Expand All @@ -126,19 +137,24 @@ class SentryOkHttpInterceptorTest {
try {
fixture.interceptor.intercept(chain)
fail()
} catch (e: IOException) {}

} catch (e: IOException) {
// ignore me
}
verify(fixture.hub).addBreadcrumb(check<Breadcrumb> {
assertEquals("http", it.type)
})
}

@SuppressWarnings("SwallowedException")
@Test
fun `sets status and throwable when call results in IOException`() {
val sut = fixture.getSut(socketPolicy = SocketPolicy.DISCONNECT_AT_START)
try {
sut.newCall(getRequest()).execute()
} catch (e: IOException) {}
fail()
} catch (e: IOException) {
// ignore
}
val httpClientSpan = fixture.sentryTracer.children.first()
assertEquals(SpanStatus.INTERNAL_ERROR, httpClientSpan.status)
assertTrue(httpClientSpan.throwable is IOException)
Expand Down
5 changes: 0 additions & 5 deletions sentry-android-timber/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ android {
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
Expand Down
5 changes: 0 additions & 5 deletions sentry-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ android {
versionCode = project.properties[Config.Sentry.buildVersionCodeProp].toString().toInt()
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

buildFeatures {
// Determines whether to generate a BuildConfig class.
buildConfig = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public ITransport create(
// the time to wait for a connection from the connection manager/pool
.setConnectionRequestTimeout(
options.getConnectionTimeoutMillis(), TimeUnit.MILLISECONDS)
// the time waiting for data after establishing the connection; maximum time
// the time waiting for data, after establishing the connection; maximum time
// of inactivity between two data packets
.setResponseTimeout(options.getReadTimeoutMillis(), TimeUnit.MILLISECONDS)
.build())
Expand Down
5 changes: 0 additions & 5 deletions sentry-samples/sentry-samples-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,6 @@ android {
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
Expand Down
4 changes: 2 additions & 2 deletions sentry-servlet/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ repositories {
}
val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_1_8.toString()
languageVersion = Config.springKotlinCompatibleLanguageVersion
}
val compileTestKotlin: KotlinCompile by tasks
compileTestKotlin.kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_1_8.toString()
languageVersion = Config.springKotlinCompatibleLanguageVersion
}