Skip to content

Commit d9c49aa

Browse files
authored
Merge pull request #259 from adamint/dev
3.5.05 release
2 parents d0e7142 + 52d9b6e commit d9c49aa

File tree

81 files changed

+2540
-631
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+2540
-631
lines changed

README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ supporting Kotlin/JS, Kotlin/Android, Kotlin/JVM, and Kotlin/Native
3030
+ [SpotifyApiBuilder block & setting API options](#spotifyapibuilder-block--setting-api-options)
3131
* [API options](#api-options)
3232
+ [Using the API](#using-the-api)
33+
* [Platform-specific wrappers and information]("#platform-specific-wrappers-and-information")
34+
+ [JavaScript: Spotify Web Playback SDK wrapper](#js-spotify-web-playback-sdk-wrapper)
3335
* [Tips](#tips)
3436
+ [Building the API](#building-the-api)
3537
* [Notes](#notes)
@@ -52,6 +54,9 @@ repositories {
5254
implementation("com.adamratzman:spotify-api-kotlin-core:VERSION")
5355
```
5456

57+
### JS
58+
Please see
59+
5560
### Android
5661
**If you declare any release types not named debug or release, you may see "Could not resolve com.adamratzman:spotify-api-kotlin-android:VERSION". You need to do the following for each release type not named debug or release:**
5762
```
@@ -91,8 +96,6 @@ If you have a question, you can:
9196
## Unsupported features on each platform:
9297
| Feature | JVM | Android | JS | Native (Mac/Windows/Linux) |
9398
|-----------------------------|--------------------|--------------------|--------------------|----------------------------|
94-
| Images (Playlist covers) | :heavy_check_mark: | :heavy_check_mark: | Unsupported | Unsupported |
95-
| getSpotifyPkceCodeChallenge | :heavy_check_mark: | :heavy_check_mark: | Unsupported | Unsupported |
9699
| Edit client playlist | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | Unsupported |
97100
| Remove playlist tracks | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | Unsupported |
98101

@@ -183,7 +186,7 @@ hash the code verifier using the SHA256 algorithm. Then, base64url encode the ha
183186
the code challenge used to authorize the user.
184187

185188
This library contains helpful methods that can be used to simplify the PKCE authorization process.
186-
This includes `getSpotifyPkceCodeChallenge` (not available in the Kotlin/JS target), which SHA256 hashes and base64url encodes the code
189+
This includes `getSpotifyPkceCodeChallenge`, which SHA256 hashes and base64url encodes the code
187190
challenge, and `getPkceAuthorizationUrl`, which allows you to generate an easy authorization url for PKCE flow.
188191

189192
Please see the [spotifyClientPkceApi builder docs](https://adamint.github.io/spotify-web-api-kotlin-docs/spotify-web-api-kotlin/com.adamratzman.spotify/spotify-client-pkce-api.html) for a full list of available builders.
@@ -372,6 +375,21 @@ APIs available only in `SpotifyClientApi` and `SpotifyImplicitGrantApi` instance
372375
- `ClientLibraryApi` (get and manage saved tracks and albums)
373376
- `ClientPlayerApi` (view and control Spotify playback)
374377

378+
## Platform-specific wrappers and information
379+
### Android authentication
380+
381+
### JS Spotify Web Playback SDK wrapper
382+
`spotify-web-api-kotlin` provides a wrapper around Spotify's [Web Playback SDK](https://developer.spotify.com/documentation/web-playback-sdk/reference/)
383+
for playing music via Spotify in the browser on your own site.
384+
385+
To do this, you need to create a `Player` instance and then use the associated methods to register listeners, play,
386+
and get current context.
387+
388+
**Please see an example of how to do this [here](https://github.com/adamint/spotify-web-api-browser-example/blob/95df60810611ddb961a7a2cb0c874a76d4471aa7/src/main/kotlin/com/adamratzman/layouts/HomePageComponent.kt#L38)**.
389+
An example project, [spotify-web-api-browser-example](https://github.com/adamint/spotify-web-api-browser-example),
390+
demonstrates how to create a frontend JS Kotlin application with Spotify integration and
391+
that will play music in the browser.
392+
375393
## Tips
376394

377395
### Building the API

build.gradle.kts

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ plugins {
77
signing
88
id("io.codearte.nexus-staging") version "0.22.0"
99
id("com.android.library")
10-
kotlin("multiplatform") version "1.4.21"
11-
kotlin("plugin.serialization") version "1.4.20"
10+
kotlin("multiplatform") version "1.4.30"
11+
kotlin("plugin.serialization") version "1.4.30"
1212
id("com.diffplug.spotless") version "5.9.0"
1313
id("com.moowork.node") version "1.3.1"
1414
id("org.jetbrains.dokka") version "1.4.20"
@@ -27,7 +27,7 @@ buildscript {
2727
}
2828
dependencies {
2929
classpath("com.android.tools.build:gradle:3.5.4")
30-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21")
30+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.30")
3131
}
3232
}
3333

@@ -132,6 +132,7 @@ kotlin {
132132
testTask {
133133
useKarma {
134134
useChromeHeadless()
135+
//useChrome()
135136
webpackConfig.cssSupport.enabled = true
136137
}
137138
}
@@ -174,15 +175,22 @@ kotlin {
174175
sourceSets {
175176
val coroutineVersion = "1.4.2-native-mt"
176177
val serializationVersion = "1.0.1"
177-
val ktorVersion = "1.5.0"
178-
val klockVersion = "2.0.3"
178+
val ktorVersion = "1.5.1"
179+
val korlibsVersion = "2.0.6"
179180

180181
val commonMain by getting {
181182
dependencies {
182-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutineVersion")
183+
implementation ("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutineVersion"){
184+
version {
185+
strictly(coroutineVersion)
186+
}
187+
}
183188
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$serializationVersion")
184189
implementation("io.ktor:ktor-client-core:$ktorVersion")
185-
implementation("com.soywiz.korlibs.klock:klock:$klockVersion")
190+
implementation("com.soywiz.korlibs.klock:klock:$korlibsVersion")
191+
implementation("com.soywiz.korlibs.krypto:krypto:$korlibsVersion")
192+
implementation("com.soywiz.korlibs.korim:korim:$korlibsVersion")
193+
186194
}
187195
}
188196

@@ -226,6 +234,10 @@ kotlin {
226234
val jsTest by getting {
227235
dependencies {
228236
implementation(kotlin("test-js"))
237+
238+
// implementation("io.kotest:kotest-assertions-core-js:4.3.2")
239+
// implementation("io.kotest:kotest-framework-api-js:4.3.2")
240+
// implementation("io.kotest:kotest-framework-engine-js:4.3.2")
229241
}
230242
}
231243

@@ -394,8 +406,10 @@ fun PublishingExtension.registerPublishing() {
394406
url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl)
395407

396408
credentials {
397-
val nexusUsername: String? = System.getenv("nexus.username") ?: if (project.extra.has("nexusUsername")) project.extra["nexusUsername"] as? String else null
398-
val nexusPassword: String? = System.getenv("nexus.password") ?: if (project.extra.has("nexusPassword")) project.extra["nexusPassword"] as? String else null
409+
val nexusUsername: String? = System.getenv("nexus.username")
410+
?: if (project.extra.has("nexusUsername")) project.extra["nexusUsername"] as? String else null
411+
val nexusPassword: String? = System.getenv("nexus.password")
412+
?: if (project.extra.has("nexusPassword")) project.extra["nexusPassword"] as? String else null
399413
username = nexusUsername
400414
password = nexusPassword
401415
}

gradle/wrapper/gradle-wrapper.jar

508 Bytes
Binary file not shown.
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.6.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

gradlew

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ esac
8282

8383
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
8484

85+
8586
# Determine the Java command to use to start the JVM.
8687
if [ -n "$JAVA_HOME" ] ; then
8788
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -129,6 +130,7 @@ fi
129130
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
130131
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131132
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133+
132134
JAVACMD=`cygpath --unix "$JAVACMD"`
133135

134136
# We build the pattern for arguments to be converted via cygpath

gradlew.bat

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
2929
set APP_BASE_NAME=%~n0
3030
set APP_HOME=%DIRNAME%
3131

32+
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
33+
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34+
3235
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
3336
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
3437

@@ -37,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
3740

3841
set JAVA_EXE=java.exe
3942
%JAVA_EXE% -version >NUL 2>&1
40-
if "%ERRORLEVEL%" == "0" goto init
43+
if "%ERRORLEVEL%" == "0" goto execute
4144

4245
echo.
4346
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -51,7 +54,7 @@ goto fail
5154
set JAVA_HOME=%JAVA_HOME:"=%
5255
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5356

54-
if exist "%JAVA_EXE%" goto init
57+
if exist "%JAVA_EXE%" goto execute
5558

5659
echo.
5760
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -61,28 +64,14 @@ echo location of your Java installation.
6164

6265
goto fail
6366

64-
:init
65-
@rem Get command-line arguments, handling Windows variants
66-
67-
if not "%OS%" == "Windows_NT" goto win9xME_args
68-
69-
:win9xME_args
70-
@rem Slurp the command line arguments.
71-
set CMD_LINE_ARGS=
72-
set _SKIP=2
73-
74-
:win9xME_args_slurp
75-
if "x%~1" == "x" goto execute
76-
77-
set CMD_LINE_ARGS=%*
78-
7967
:execute
8068
@rem Setup the command line
8169

8270
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
8371

72+
8473
@rem Execute Gradle
85-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
74+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
8675

8776
:end
8877
@rem End local scope for the variables with windows NT shell

src/androidMain/kotlin/com/adamratzman/spotify/Pkce.kt

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

src/androidMain/kotlin/com/adamratzman/spotify/SpotifyLogger.kt

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

src/androidMain/kotlin/com/adamratzman/spotify/http/Endpoints.kt

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

src/androidMain/kotlin/com/adamratzman/spotify/utils/Concurrency.kt

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

0 commit comments

Comments
 (0)