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 to Kotlin 1.5 #1815

Merged
merged 4 commits into from
Nov 23, 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
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Feat: Use float instead of Date for protocol types for higher precision (#1737)
* Ref: Bind external properties to a dedicated class. (#1750)
* Ref: Debug log serializable objects (#1795)
* Ref: catch Throwable instead of Exception to suppress internal SDK errors (#1812)

Breaking changes:

Expand All @@ -25,8 +26,7 @@ Breaking changes:
* Call `toString()` where object graphs exceed max depth.
* Remove `gson` dependency.
* Remove `IUnknownPropertiesConsumer`

* Ref: catch Throwable instead of Exception to suppress internal SDK errors (#1812)
* Bump: Kotlin to 1.5 and compatibility to 1.4 for sentry-android-timber (#1815)

## 5.4.1

Expand Down
3 changes: 2 additions & 1 deletion buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import java.math.BigDecimal

object Config {
val kotlinVersion = "1.4.32"
val kotlinVersion = "1.5.31"
marandaneto marked this conversation as resolved.
Show resolved Hide resolved
val kotlinStdLib = "stdlib-jdk8"

val springBootVersion = "2.4.4"
// Spring is currently not compatible with Kotlin 1.4
val springKotlinCompatibleLanguageVersion = "1.3"
val kotlinCompatibleLanguageVersion = "1.4"

object BuildPlugins {
val androidGradle = "com.android.tools.build:gradle:7.0.3"
Expand Down
1 change: 1 addition & 0 deletions sentry-android-okhttp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ android {

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
kotlinOptions.languageVersion = Config.kotlinCompatibleLanguageVersion
}

testOptions {
Expand Down
7 changes: 1 addition & 6 deletions sentry-android-timber/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.extensions.DetektExtension
import org.jetbrains.kotlin.config.KotlinCompilerVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("com.android.library")
Expand Down Expand Up @@ -34,6 +33,7 @@ android {

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
kotlinOptions.languageVersion = Config.kotlinCompatibleLanguageVersion
marandaneto marked this conversation as resolved.
Show resolved Hide resolved
}

testOptions {
Expand Down Expand Up @@ -69,11 +69,6 @@ kotlin {
explicitApi()
}

tasks.withType<KotlinCompile>().configureEach {
// Timber uses Kotlin 1.2
kotlinOptions.languageVersion = "1.2"
}

dependencies {
api(projects.sentry)

Expand Down
1 change: 1 addition & 0 deletions sentry-apollo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ configure<JavaPluginExtension> {

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8.toString()
kotlinOptions.languageVersion = Config.kotlinCompatibleLanguageVersion
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion sentry-graphql/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ configure<JavaPluginExtension> {

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8.toString()
kotlinOptions.languageVersion = Config.springKotlinCompatibleLanguageVersion
Copy link
Contributor Author

@marandaneto marandaneto Nov 18, 2021

Choose a reason for hiding this comment

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

@maciejwalkowiak cant use 1.3 due to the functional interfaces, would that be a problem for Spring projects? since it has to be 1.3 right now

Copy link
Contributor

Choose a reason for hiding this comment

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

Spring now supports Kotlin 1.5

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but then I guess we'd need to bump Spring versions I guess?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

since this is a separate issue, I will merge, but we could bump the springKotlinCompatibleLanguageVersion libs to 1.4 if its already supported (under the v6 branch)

kotlinOptions.languageVersion = Config.kotlinCompatibleLanguageVersion
}

dependencies {
Expand Down
1 change: 1 addition & 0 deletions sentry-kotlin-extensions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ configure<JavaPluginExtension> {

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8.toString()
kotlinOptions.languageVersion = Config.kotlinCompatibleLanguageVersion
}

dependencies {
Expand Down