Skip to content

Commit 84e832b

Browse files
committed
Prepare for release 0.0.7.
1 parent f45f56f commit 84e832b

File tree

6 files changed

+31
-23
lines changed

6 files changed

+31
-23
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Change log
22

3+
Version 0.0.7 *(2020-09-11)*
4+
----------------------------
5+
* Update to Kotlin 1.4.10
6+
* Fix #19 by #22 thanks to [@4uf04eG](https://github.com/4uf04eG)
7+
* Fix docs
8+
39
Version 0.0.6 *(2020-09-06)*
410
----------------------------
511
* Kotlin `1.4.0` support

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66

77
---
88

9-
![Build](https://github.com/vksdk/vk-sdk-kotlin/workflows/Release/badge.svg) ![Documentation](https://github.com/vksdk/vk-sdk-kotlin/workflows/Documentation/badge.svg) [![Kotlin 1.4.0](https://img.shields.io/badge/Kotlin-1.4.0-blue.svg?style=flat)](http://kotlinlang.org) [![API version](https://img.shields.io/badge/API%20version-5.103+-blue?style=flat&logo=vk&logoColor=white)](https://vk.com/dev/versions)
9+
![Build](https://github.com/vksdk/vk-sdk-kotlin/workflows/Release/badge.svg) ![Documentation](https://github.com/vksdk/vk-sdk-kotlin/workflows/Documentation/badge.svg) [![Kotlin 1.4.10](https://img.shields.io/badge/Kotlin-1.4.10-blue.svg?style=flat)](http://kotlinlang.org) [![API version](https://img.shields.io/badge/API%20version-5.103+-blue?style=flat&logo=vk&logoColor=white)](https://vk.com/dev/versions)
1010
[![GitHub license](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat)](https://github.com/vksdk/vk-sdk-kotlin/blob/master/LICENSE)
1111

1212
Unofficial VK.com SDK, written in Kotlin.
1313
Based on Kotlin Multiplatform project, but has Java-friendly API.
1414

1515
See the documentation: [https://vksdk.github.io/vk-sdk-kotlin](https://vksdk.github.io/vk-sdk-kotlin)
1616

17-
Latest version: [![maven-central](https://img.shields.io/badge/Maven%20Central-0.0.6-yellowgreen?style=flat)](https://search.maven.org/search?q=g:com.petersamokhin.vksdk)
17+
Latest version: [![maven-central](https://img.shields.io/badge/Maven%20Central-0.0.7-yellowgreen?style=flat)](https://search.maven.org/search?q=g:com.petersamokhin.vksdk)
1818

1919
For Kotlin 1.3.72 use version 0.0.5 and below.
2020

@@ -103,7 +103,7 @@ implementation "com.petersamokhin.vksdk:http-client-jvm-okhttp:$vkSdkVersion"
103103
104104
// Or else you can use the common HTTP client, which is based on ktor
105105
// and available for all of the platforms, including JVM.
106-
// In this case, you also should specify the ktor engine.
106+
// In this case, you also must specify the ktor engine.
107107
implementation "com.petersamokhin.vksdk:http-client-common-ktor:$vkSdkVersion"
108108
```
109109

buildSrc/src/main/kotlin/Config.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
object Config {
22
object Versions {
33
object Kotlin {
4-
const val kotlin = "1.4.0"
4+
const val kotlin = "1.4.10"
55
const val coroutines = "1.3.9"
66
const val serialization = "1.0.0-RC"
77
}

docs/http-clients.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ Configuration for clients is also optional, but may be useful.
1212
val httpClientConfig: HttpClientConfig = HttpClientConfig(
1313
connectTimeout = 30_000,
1414
readTimeout = 30_000,
15-
defaultHeaders = mapOf("User-Agent", "VK SDK Kotlin/0.0.x")
15+
defaultHeaders = mapOf("User-Agent" to "VK SDK Kotlin/0.0.x")
1616
)
1717
```
1818
Usually, this configuration is provided into HTTP client constructor.
1919

20+
!!! info "Note about the logging"
21+
It is barely possible to help you without seeing the VK responses, so you need to log it by yourself.
22+
For this, you can provide overrided client and configure this using the logging-interceptor for OkHttp, or the logging feature for ktor.
23+
2024
### Abstract HTTP client methods
2125
To implement this interface, you should override some simple methods:
2226

@@ -93,27 +97,25 @@ implementation("io.ktor:ktor-client-cio:1.3.2")
9397
### Use
9498
You can provide ktor HttpClient in constructor:
9599
```kotlin
96-
val httpClient: HttpClient = VkOkHttpClient(
97-
coroutineContext = Dispatchers.IO + SupervisorJob(),
98-
99-
// provide your http client,
100-
overrideClient = HttpClient(CIO),
101-
102-
// HTTP client configuration is optional, see the snippet above
103-
overrideConfig = HttpClientConfig()
104-
)
100+
val httpClient: HttpClient = VkKtorHttpClient(
101+
coroutineContext = Dispatchers.IO /* + job */,
102+
overrideClient = HttpClient(CIO) {
103+
engine {
104+
requestTimeout = 30_000L
105+
}
106+
}
107+
)
105108
```
106109

107110
Otherwise, override `createEngineWithConfig` method:
108111
```kotlin
109112
class CioKtorHttpClient: VkKtorHttpClient(
110-
coroutineContext = Dispatchers.IO + SupervisorJob()
113+
coroutineContext = Dispatchers.IO /* + job */
111114
) {
112115
override fun createEngineWithConfig(config: HttpClientConfig): HttpClientEngine? {
113116
return CIO.create {
114-
endpoint {
115-
connectTimeout = config.connectTimeout.toLong()
116-
requestTimeout = config.readTimeout.toLong()
117+
engine {
118+
requestTimeout = 30_000L
117119
}
118120
}
119121
}

docs/usage.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ See the [example projects](https://github.com/vksdk/vk-sdk-kotlin/tree/master/ex
66
- [https://github.com/vksdk/vk-sdk-kotlin/tree/master/examples/jvm-kotlin-example](https://github.com/vksdk/vk-sdk-kotlin/tree/master/examples/jvm-kotlin-example)
77
- Minimal example without Kotlin in dependencies:
88
- [https://github.com/vksdk/vk-sdk-kotlin/tree/master/examples/jvm-only-java-example](https://github.com/vksdk/vk-sdk-kotlin/tree/master/examples/jvm-only-java-example)
9-
- Minimal multipatform app example (single activity on Android and SwiftUI on iOS):
9+
- Minimal multiplatform app example (single activity on Android and SwiftUI on iOS):
1010
- [https://github.com/vksdk/vk-sdk-kotlin/tree/master/examples/mpp-example](https://github.com/vksdk/vk-sdk-kotlin/tree/master/examples/mpp-example)
1111

1212
### Artifacts
@@ -57,9 +57,9 @@ val vkClientSettings = VkSettings(
5757
// HTTP client is required
5858
httpClient = httpClient,
5959

60-
// Default is [VkApi.DEFAULT_VERSION], 5.103 for 0.0.2
60+
// Default is [VkApi.DEFAULT_VERSION], 5.122 for 0.0.7
6161
// See: https://vk.com/dev/versions
62-
apiVersion = 5.103,
62+
apiVersion = 5.122,
6363

6464
// Default params are empty
6565
defaultParams = paramsOf("lang" to "en"),
@@ -71,7 +71,7 @@ val vkClientSettings = VkSettings(
7171
// See the mutiplatform example and iOS note for ktor
7272
backgroundDispatcher = Dispatchers.Default,
7373

74-
json = Json { /* yours configuration */ }
74+
json = Json { /* your configuration */ }
7575
)
7676
```
7777

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
GROUP=com.petersamokhin.vksdk
2-
VERSION_NAME=0.0.6
2+
VERSION_NAME=0.0.7
33

44
POM_URL=https://github.com/vksdk/vk-sdk-kotlin/
55
POM_SCM_URL=https://github.com/vksdk/vk-sdk-kotlin/

0 commit comments

Comments
 (0)