Skip to content

Commit 6897bb7

Browse files
chore(deps): Updated Kotlin from v1.7.0 to v1.9.10, Gradle from v6.7.… (#1379)
…1 to v8.3 and upgraded linter (#1343) * chore(deps): Updated Kotlin from v1.7.0 to v1.9.10, Gradle from v6.7.1 to v8.3 and upgraded linter * chore(deps): upgraded kotlin linter formatted code * chore(deps): Updated Kotlin from v1.7.0 to v1.9.10, Gradle from v6.7.1 to v8.3 and upgraded linter adding foojay-resolver-convention gradle plugin * chore(deps): Updated Kotlin from v1.7.0 to v1.9.10, Gradle from v6.7.1 to v8.3 and upgraded linter setting gradle jvm toolchain version from 8 to 17 * chore(deps): upgraded kotlin linter formatted code from #1343
2 parents 680c7ec + 71808f6 commit 6897bb7

19 files changed

+5756
-5435
lines changed

.editorconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ end_of_line = lf
44
insert_final_newline = true
55
trim_trailing_whitespace = true
66

7-
[*.{kt,gradle}]
7+
[*.{kt,kts}]
88
indent_style = space
99
indent_size = 4
10+
ktlint_standard_no-wildcard-imports = disabled
11+
ktlint_standard_filename = disabled
12+
ktlint_standard_enum-entry-name-case = disabled

kotlin/build.gradle

Lines changed: 0 additions & 83 deletions
This file was deleted.

kotlin/build.gradle.kts

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
group = "com.looker.sdk"
2+
defaultTasks = mutableListOf("jar")
3+
4+
val kotlinVersion = providers.gradleProperty("kotlinVersion").get()
5+
val googleHttpVersion = providers.gradleProperty("googleHttpVersion").get()
6+
7+
plugins {
8+
kotlin("jvm")
9+
id("com.diffplug.spotless")
10+
}
11+
12+
sourceSets {
13+
main {
14+
kotlin {
15+
setSrcDirs(listOf("src/main/"))
16+
}
17+
}
18+
test {
19+
kotlin {
20+
setSrcDirs(listOf("src/test"))
21+
}
22+
}
23+
}
24+
25+
repositories {
26+
mavenCentral()
27+
maven { url = uri("https://dl.bintray.com/kotlin/ktor") }
28+
maven { url = uri("https://dl.bintray.com/kotlin/kotlinx") }
29+
maven { url = uri("https://jitpack.io") }
30+
}
31+
32+
dependencies {
33+
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
34+
35+
implementation("io.github.cdimascio:dotenv-kotlin:6.2.2")
36+
implementation("org.ini4j:ini4j:0.5.4")
37+
38+
implementation("commons-configuration:commons-configuration:1.10")
39+
40+
implementation(platform("com.google.http-client:google-http-client-bom:$googleHttpVersion"))
41+
implementation("com.google.http-client:google-http-client")
42+
implementation("com.google.http-client:google-http-client-apache-v2")
43+
implementation("com.google.http-client:google-http-client-gson")
44+
45+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
46+
implementation("com.google.code.gson:gson:2.8.5")
47+
48+
testImplementation("org.junit.jupiter:junit-jupiter-api:5.3.1")
49+
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.3.1")
50+
testImplementation("org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion")
51+
}
52+
53+
spotless {
54+
kotlin {
55+
ktlint("0.50.0").setEditorConfigPath("$projectDir/../.editorconfig")
56+
}
57+
}
58+
59+
kotlin {
60+
jvmToolchain(17)
61+
}
62+
63+
tasks.test {
64+
testLogging {
65+
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
66+
}
67+
}

kotlin/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
kotlinVersion=1.7.10
1+
kotlinVersion=1.9.10
22
googleHttpVersion=1.43.3
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

kotlin/settings.gradle

Lines changed: 0 additions & 7 deletions
This file was deleted.

kotlin/settings.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
rootProject.name = "looker-kotlin-sdk"
2+
3+
pluginManagement {
4+
val kotlinVersion = providers.gradleProperty("kotlinVersion").get()
5+
plugins {
6+
kotlin("jvm") version kotlinVersion
7+
id("com.diffplug.spotless") version "6.20.0"
8+
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
9+
}
10+
}

kotlin/src/main/com/looker/rtl/AuthToken.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ data class AuthToken(
4040
@SerializedName("expires_in")
4141
var expiresIn: Long = 0L,
4242
@SerializedName("refresh_token")
43-
var refreshToken: String? = null
43+
var refreshToken: String? = null,
4444
) {
4545

4646
var expiresAt: LocalDateTime = LocalDateTime.now()
@@ -53,7 +53,7 @@ data class AuthToken(
5353
token.access_token!!,
5454
token.token_type!!,
5555
token.expires_in!!.toLong(),
56-
token.refresh_token
56+
token.refresh_token,
5757
)
5858

5959
init {

kotlin/src/main/com/looker/rtl/Constants.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ fun unQuote(value: String?): String {
9696
enum class ResponseMode {
9797
String,
9898
Binary,
99-
Unknown
99+
Unknown,
100100
}
101101

102102
fun responseMode(contentType: String): ResponseMode {

kotlin/src/main/com/looker/rtl/ErrorDoc.kt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,13 @@ typealias ErrorCodeIndex = HashMap<String, ErrorDocItem>
3333
interface IErrorDocLink {
3434
/** base redirector url */
3535
var redirector: String
36+
3637
/** api version of the error link */
3738
var apiVersion: String
39+
3840
/** HTTP status code */
3941
var statusCode: String
42+
4043
/** REST API Path */
4144
var apiPath: String
4245
}
@@ -143,7 +146,7 @@ class ErrorDoc(val sdk: APIMethods, val cdnUrl: String = ErrorCodesUrl) : IError
143146
match.groupValues[1],
144147
match.groupValues[2],
145148
match.groupValues[3],
146-
match.groupValues[4]
149+
match.groupValues[4],
147150
)
148151
}
149152

@@ -182,7 +185,10 @@ class ErrorDoc(val sdk: APIMethods, val cdnUrl: String = ErrorCodesUrl) : IError
182185

183186
override fun specPath(path: String): String {
184187
val rx = Regex("""(:\w+)""")
185-
val result = path.replace(rx) { val x = it.value.substring(1); "{$x}" }
188+
val result = path.replace(rx) {
189+
val x = it.value.substring(1)
190+
"{$x}"
191+
}
186192
return result
187193
}
188194

@@ -220,5 +226,5 @@ class ErrorDocLink(
220226
override var redirector: String = "",
221227
override var apiVersion: String = "",
222228
override var statusCode: String = "",
223-
override var apiPath: String = ""
229+
override var apiPath: String = "",
224230
) : IErrorDocLink

0 commit comments

Comments
 (0)