Skip to content

Commit

Permalink
Update misc dependencies (#57)
Browse files Browse the repository at this point in the history
* Update to Gradle 7.6

* ktfmt 0.42

* Spotless 6.12.0

* Kotlin 1.8

* Update build config

* maven publish 0.23.0

* Use prop only
  • Loading branch information
ZacSweers authored Dec 29, 2022
1 parent 2301644 commit 47cf05a
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 20 deletions.
19 changes: 10 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import io.gitlab.arturbosch.detekt.Detekt
import java.net.URL
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand All @@ -40,24 +41,24 @@ pluginManager.withPlugin("java") {
project.tasks.withType<JavaCompile>().configureEach { options.release.set(11) }
}

val tomlJvmTarget = libs.versions.jvmTarget.get()

tasks.withType<KotlinCompile>().configureEach {
val taskName = name
kotlinOptions {
jvmTarget = "11"
val argsList = mutableListOf("-progressive", "-opt-in=kotlin.RequiresOptIn")
compilerOptions {
jvmTarget.set(libs.versions.jvmTarget.map(JvmTarget::fromTarget))
if (taskName == "compileTestKotlin") {
argsList += "-opt-in=kotlin.ExperimentalStdlibApi"
argsList += "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"
freeCompilerArgs.add("-opt-in=kotlin.ExperimentalStdlibApi")
freeCompilerArgs.add("-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi")
// Enable new jvmdefault behavior
// https://blog.jetbrains.com/kotlin/2020/07/kotlin-1-4-m3-generating-default-methods-in-interfaces/
argsList += "-Xjvm-default=all"
freeCompilerArgs.add("-Xjvm-default=all")
}
@Suppress("SuspiciousCollectionReassignment")
freeCompilerArgs += argsList
freeCompilerArgs.addAll("-progressive", "-opt-in=kotlin.RequiresOptIn")
}
}

tasks.withType<Detekt>().configureEach { jvmTarget = "11" }
tasks.withType<Detekt>().configureEach { jvmTarget = tomlJvmTarget }

kotlin { explicitApi() }

Expand Down
11 changes: 6 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[versions]
coroutines = "1.6.4"
kotlin = "1.7.21"
ktfmt = "0.41"
kotlin = "1.8.0"
jvmTarget = "11"
ktfmt = "0.42"
moshi = "1.14.0"
okhttp = "4.9.0"
retrofit = "2.9.0"
Expand All @@ -10,9 +11,9 @@ retrofit = "2.9.0"
binaryCompatibilityValidator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.11.1" }
detekt = { id = "io.gitlab.arturbosch.detekt", version = "1.21.0" }
dokka = { id = "org.jetbrains.dokka", version = "1.7.20" }
ksp = { id = "com.google.devtools.ksp", version = "1.7.21-1.0.8" }
mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.22.0" }
spotless = { id = "com.diffplug.spotless", version = "6.11.0" }
ksp = { id = "com.google.devtools.ksp", version = "1.8.0-1.0.8" }
mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.23.0" }
spotless = { id = "com.diffplug.spotless", version = "6.12.0" }

[libraries]
androidProcessingApi = "com.google.android:android:4.1.1.4"
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
12 changes: 8 additions & 4 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,10 +80,10 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
Expand Down Expand Up @@ -143,12 +143,16 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down
1 change: 1 addition & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/slack/eithernet/ApiException.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ package com.slack.eithernet
* Represents a generic API error from a given endpoint.
*
* @see [ApiResult.Failure.ApiFailure] for full documentation for how this [error] property is used
* and its caveats.
* and its caveats.
*/
public class ApiException(public val error: Any?) : Exception()

0 comments on commit 47cf05a

Please sign in to comment.