Skip to content

Commit 6d5c41b

Browse files
authored
Update kotlin and deps (#236)
1 parent 50964ff commit 6d5c41b

27 files changed

Lines changed: 82 additions & 64 deletions

descopesdk/build.gradle.kts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
13
plugins {
24
id("com.android.library")
35
id("kotlin-android")
@@ -7,16 +9,22 @@ plugins {
79

810
android {
911
namespace = "com.descope"
10-
compileSdk = 35
12+
compileSdk = 36
1113

1214
defaultConfig {
1315
minSdk = 24
14-
targetSdk = 35
15-
1616
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
1717
consumerProguardFiles("consumer-rules.pro")
1818
}
1919

20+
testOptions {
21+
targetSdk = 36
22+
}
23+
24+
lint {
25+
targetSdk = 36
26+
}
27+
2028
buildTypes {
2129
release {
2230
isMinifyEnabled = false
@@ -27,9 +35,6 @@ android {
2735
sourceCompatibility = JavaVersion.VERSION_1_8
2836
targetCompatibility = JavaVersion.VERSION_1_8
2937
}
30-
kotlinOptions {
31-
jvmTarget = JavaVersion.VERSION_1_8.toString()
32-
}
3338

3439
publishing {
3540
singleVariant("release") {
@@ -39,6 +44,10 @@ android {
3944
}
4045
}
4146

47+
kotlin {
48+
compilerOptions.jvmTarget.set(JvmTarget.JVM_1_8)
49+
}
50+
4251
dependencies {
4352
implementation(descopeLibs.kotlinx.coroutines.android)
4453
implementation(descopeLibs.androidx.lifecycle.common)

descopesdk/src/main/java/com/descope/Descope.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@file:Suppress("MemberVisibilityCanBePrivate", "unused")
1+
@file:Suppress("MemberVisibilityCanBePrivate", "unused", "DEPRECATION")
22

33
package com.descope
44

descopesdk/src/main/java/com/descope/android/DescopeFlow.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:Suppress("unused")
2+
13
package com.descope.android
24

35
import android.content.Context

descopesdk/src/main/java/com/descope/android/DescopeFlowCoordinator.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ internal fun findJwtInCookies(cookieString: String?, name: String): String? {
642642
cookieString?.split("; ")?.forEach {
643643
try {
644644
addAll(HttpCookie.parse(it))
645-
} catch (ignored: Exception) {
645+
} catch (_: Exception) {
646646
}
647647
}
648648
}
@@ -651,7 +651,7 @@ internal fun findJwtInCookies(cookieString: String?, name: String): String? {
651651
.mapNotNull { httpCookie -> // parse token
652652
try {
653653
Token(httpCookie.value)
654-
} catch (e: Exception) {
654+
} catch (_: Exception) {
655655
null
656656
}
657657
}
@@ -663,7 +663,7 @@ internal fun findJwtInCookies(cookieString: String?, name: String): String? {
663663
private fun String.toUri(): Uri? {
664664
return try {
665665
Uri.parse(this)
666-
} catch (ignored: Exception) {
666+
} catch (_: Exception) {
667667
null
668668
}
669669
}

descopesdk/src/main/java/com/descope/android/DescopeFlowHook.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:Suppress("unused")
2+
13
package com.descope.android
24

35
import android.webkit.WebView

descopesdk/src/main/java/com/descope/android/DescopeFlowView.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:Suppress("unused")
2+
13
package com.descope.android
24

35
import android.content.Context
@@ -157,7 +159,7 @@ class DescopeFlowView : ViewGroup {
157159
override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
158160
for (i in 0 until childCount) {
159161
val child = getChildAt(i)
160-
child.layout(0, 0, width, height);
162+
child.layout(0, 0, width, height)
161163
}
162164
}
163165

descopesdk/src/main/java/com/descope/android/Utils.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ package com.descope.android
33
import android.content.Context
44
import android.net.Uri
55
import androidx.browser.customtabs.CustomTabsIntent
6+
import androidx.core.net.toUri
67
import com.descope.internal.others.activityHelper
78

89
// Custom Tab
910

1011
fun launchCustomTab(context: Context, url: String, customTabsIntent: CustomTabsIntent? = null) {
11-
launchCustomTab(context, Uri.parse(url), customTabsIntent)
12+
launchCustomTab(context, url.toUri(), customTabsIntent)
1213
}
1314

1415
fun launchCustomTab(context: Context, uri: Uri, customTabsIntent: CustomTabsIntent? = null) {

descopesdk/src/main/java/com/descope/extensions/URLConnection.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:Suppress("unused")
2+
13
package com.descope.extensions
24

35
import com.descope.session.DescopeSession

descopesdk/src/main/java/com/descope/internal/http/HttpClient.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.descope.internal.http
22

3-
import android.net.Uri
3+
import androidx.core.net.toUri
44
import com.descope.internal.others.debug
55
import com.descope.internal.others.error
66
import com.descope.internal.others.info
@@ -118,7 +118,7 @@ internal open class HttpClient(
118118
private fun makeUrl(route: String, params: Map<String, String?>): URL {
119119
val composed = "$baseUrl$basePath$route"
120120
val urlString = if (params.isNotEmpty()) {
121-
Uri.parse(composed).buildUpon().apply {
121+
composed.toUri().buildUpon().apply {
122122
params
123123
.filterValues { it != null }
124124
.forEach { appendQueryParameter(it.key, it.value) }
@@ -135,7 +135,7 @@ private val Map<String, List<String>>.cookies: List<HttpCookie>
135135
this[key]?.forEach {
136136
try {
137137
cookies.addAll(HttpCookie.parse(it))
138-
} catch (ignored: Exception) {}
138+
} catch (_: Exception) {}
139139
}
140140
}
141141
return cookies.toList()

descopesdk/src/main/java/com/descope/internal/http/SystemInfo.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ internal class DescopeSystemInfo private constructor(context: Context) : SystemI
1414

1515
override val appName: String? = try {
1616
context.applicationInfo.loadLabel(context.packageManager).toString()
17-
} catch (ignored: Exception) {
17+
} catch (_: Exception) {
1818
null
1919
}
2020

2121
override val appVersion: String? = try {
2222
context.packageManager.getPackageInfo(context.packageName, 0)?.versionName
23-
} catch (ignored: Exception) {
23+
} catch (_: Exception) {
2424
null
2525
}
2626

0 commit comments

Comments
 (0)