Skip to content

Commit 06ad192

Browse files
authored
Merge pull request #328 from adamint/dev/adamint/update-gradle-deps
update gradle/dependencies
2 parents 825224f + 4132dda commit 06ad192

File tree

11 files changed

+41
-37
lines changed

11 files changed

+41
-37
lines changed

.github/workflows/ci-client.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: actions/setup-java@v2
2525
with:
2626
distribution: 'adopt'
27-
java-version: '11'
27+
java-version: '17'
2828
- name: Install curl
2929
run: sudo apt-get install -y curl libcurl4-openssl-dev
3030
- name: Verify Android

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
uses: actions/setup-java@v2
2222
with:
2323
distribution: 'adopt'
24-
java-version: '11'
24+
java-version: '17'
2525
- name: Install curl
2626
run: sudo apt-get install -y curl libcurl4-openssl-dev
2727
- name: Test android

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
uses: actions/setup-java@v2
3333
with:
3434
distribution: 'adopt'
35-
java-version: '11'
35+
java-version: '17'
3636
- name: Install curl
3737
run: sudo apt-get install -y curl libcurl4-openssl-dev
3838
- name: Verify Android
@@ -58,7 +58,7 @@ jobs:
5858
uses: actions/setup-java@v2
5959
with:
6060
distribution: 'adopt'
61-
java-version: '11'
61+
java-version: '17'
6262
- name: Publish macOS/iOS
6363
run: ./gradlew publishMacosX64PublicationToNexusRepository publishIosX64PublicationToNexusRepository publishIosArm64PublicationToNexusRepository
6464
release_windows:
@@ -72,7 +72,7 @@ jobs:
7272
uses: actions/setup-java@v2
7373
with:
7474
distribution: 'adopt'
75-
java-version: '11'
75+
java-version: '17'
7676
- run: choco install curl
7777
- name: Publish windows
7878
run: ./gradlew publishMingwX64PublicationToNexusRepository
@@ -86,7 +86,7 @@ jobs:
8686
uses: actions/setup-java@v2
8787
with:
8888
distribution: 'adopt'
89-
java-version: '11'
89+
java-version: '17'
9090
- name: Build docs
9191
run: ./gradlew dokkaHtml
9292
- name: Push docs to docs repo

build.gradle.kts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ plugins {
1212
signing
1313
id("com.android.library")
1414
kotlin("plugin.serialization")
15-
id("com.diffplug.spotless") version "6.11.0"
15+
id("com.diffplug.spotless") version "6.21.0"
1616
id("com.moowork.node") version "1.3.1"
17-
id("org.jetbrains.dokka") version "1.8.20"
17+
id("org.jetbrains.dokka") version "1.9.0"
1818
}
1919

2020
repositories {
@@ -45,17 +45,18 @@ version = libraryVersion
4545

4646

4747
android {
48+
namespace = "com.adamratzman.spotify"
4849
compileSdk = 30
4950
compileOptions {
50-
sourceCompatibility = JavaVersion.VERSION_1_8
51-
targetCompatibility = JavaVersion.VERSION_1_8
51+
sourceCompatibility = JavaVersion.VERSION_17
52+
targetCompatibility = JavaVersion.VERSION_17
5253
}
53-
packagingOptions {
54+
packaging {
5455
resources.excludes.add("META-INF/*.md") // needed to prevent android compilation errors
5556
}
5657
defaultConfig {
5758
minSdk = 23
58-
targetSdk = 30
59+
targetSdk = 31
5960
setCompileSdkVersion(30)
6061
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
6162
}
@@ -82,9 +83,10 @@ val dokkaJar: TaskProvider<Jar> by tasks.registering(Jar::class) {
8283

8384
kotlin {
8485
explicitApiWarning()
86+
jvmToolchain(17)
8587

8688
androidTarget {
87-
compilations.all { kotlinOptions.jvmTarget = "1.8" }
89+
compilations.all { kotlinOptions.jvmTarget = "17" }
8890

8991
mavenPublication { setupPom(artifactId) }
9092

gradle.properties

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,20 @@ org.gradle.jvmargs=-Xmx8000m
66
# android target settings
77
android.useAndroidX=true
88
android.enableJetifier=true
9-
android.disableAutomaticComponentCreation=false
109

1110
# language dependencies
12-
kotlinVersion=1.9.0
11+
kotlinVersion=1.9.10
1312

1413
# library dependencies
15-
kotlinxDatetimeVersion=0.4.0
16-
kotlinxSerializationVersion=1.5.1
17-
ktorVersion=2.1.3
14+
kotlinxDatetimeVersion=0.4.1
15+
kotlinxSerializationVersion=1.6.0
16+
ktorVersion=2.3.4
1817
korlibsVersion=3.4.0
19-
kotlinxCoroutinesVersion=1.7.2
18+
kotlinxCoroutinesVersion=1.7.3
2019

21-
androidBuildToolsVersion=7.2.0
22-
androidSpotifyAuthVersion=1.2.5
20+
androidBuildToolsVersion=8.1.0
21+
androidSpotifyAuthVersion=2.1.0
2322
androidCryptoVersion=1.0.0
24-
androidxCompatVersion=1.5.1
23+
androidxCompatVersion=1.6.1
2524

2625
sparkVersion=2.9.4
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-7.5.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

src/androidMain/kotlin/com/adamratzman/spotify/auth/pkce/AbstractSpotifyPkceLoginActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public abstract class AbstractSpotifyPkceLoginActivity : AppCompatActivity() {
5353
* Custom logic to invoke when loading begins ([isLoading] is true) or ends ([isLoading] is false).
5454
* You can update the view here.
5555
*/
56-
public open fun setLoadingContent(isLoading: Boolean) = {}
56+
public open fun setLoadingContent(isLoading: Boolean): () -> Unit = {}
5757

5858
private lateinit var authorizationIntent: Intent
5959
private lateinit var credentialStore: SpotifyDefaultCredentialStore

src/commonJvmLikeTest/kotlin/com/adamratzman/spotify/CommonImpl.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ private suspend fun buildSpotifyApiInternal(): GenericSpotifyApi? {
3838

3939
val optionsCreator: (SpotifyApiOptions.() -> Unit) = {
4040
this.enableDebugMode = logHttp
41-
this.enableLogger = logHttp
4241
}
4342

4443
return when {

src/commonMain/kotlin/com.adamratzman.spotify/SpotifyApiBuilder.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -663,12 +663,6 @@ public class SpotifyApiBuilder(
663663
public fun retryWhenRateLimited(retryWhenRateLimited: Boolean): SpotifyApiBuilder =
664664
apply { this.options.retryWhenRateLimited = retryWhenRateLimited }
665665

666-
/**
667-
* Set whether to enable to the exception logger
668-
*/
669-
public fun enableLogger(enableLogger: Boolean): SpotifyApiBuilder =
670-
apply { this.options.enableLogger = enableLogger }
671-
672666
/**
673667
* Set the maximum time, in milliseconds, before terminating an http request
674668
*/
@@ -1133,7 +1127,6 @@ public class SpotifyUserAuthorization(
11331127
* @param cacheLimit The maximum amount of cached requests allowed at one time. Null means no limit
11341128
* @param automaticRefresh Enable or disable automatic refresh of the Spotify access token
11351129
* @param retryWhenRateLimited Set whether to block the current thread and wait until the API can retry the request
1136-
* @param enableLogger Set whether to enable to the exception logger
11371130
* @param testTokenValidity After API creation, test whether the token is valid by performing a lightweight request
11381131
* @param defaultLimit The default amount of objects to retrieve in one request
11391132
* @param json The Json serializer/deserializer instance
@@ -1155,7 +1148,6 @@ public data class SpotifyApiOptions(
11551148
public var cacheLimit: Int? = 200,
11561149
public var automaticRefresh: Boolean = true,
11571150
public var retryWhenRateLimited: Boolean = true,
1158-
public var enableLogger: Boolean = true,
11591151
public var testTokenValidity: Boolean = false,
11601152
public var defaultLimit: Int = 50,
11611153
public var allowBulkRequests: Boolean = true,

src/commonMain/kotlin/com.adamratzman.spotify/http/HttpRequest.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,16 @@ public class HttpRequest constructor(
243243
}
244244

245245
override fun toString(): String {
246-
return """HttpConnection (
246+
// we don't want to print this sensitive information
247+
val headersWithoutAuthorization = headers.filter { it.key != "Authorization" }
248+
val hasAuthorizationHeader = headersWithoutAuthorization.size != headers.size
249+
return """HttpConnection(
247250
|url=$url,
248251
|method=$method,
249252
|body=${bodyString ?: bodyMap},
250253
|contentType=$contentType,
251-
|headers=${headers.toList()}
252-
| )
254+
|headers=${headersWithoutAuthorization.toList()}
255+
|${if (hasAuthorizationHeader) "The authorization header was hidden." else "There was no authorization header."})
253256
""".trimMargin()
254257
}
255258

0 commit comments

Comments
 (0)