Skip to content

Commit d2ee867

Browse files
authored
Merge pull request #97 from LouisCAD/update-dependencies
Update dependencies
2 parents 7342456 + a6dfad2 commit d2ee867

File tree

20 files changed

+141
-158
lines changed

20 files changed

+141
-158
lines changed

README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,25 @@ Also the official sample for [gradle refreshVersions](https://github.com/jmfayar
66

77
[![](https://user-images.githubusercontent.com/459464/93568735-ddcc9300-f990-11ea-952b-1c9a461f8e14.png)](http://www.youtube.com/watch?v=VhYERonB8co "Gradle refreshVersions")
88

9+
## Usage
10+
11+
Run all the samples
12+
13+
```
14+
$ ./gradlew :kotlin-jvm:run
15+
```
16+
17+
Run all the tests
18+
19+
```
20+
$ ./gradlew :kotlin-testing:test
21+
```
22+
23+
Test tests called FailingXXX are expected to fail
24+
25+
<img width="522" alt="kotlin-libraries-playground_–_versions_properties__kotlin-libraries-playground__and_GitHub_Desktop" src="https://user-images.githubusercontent.com/459464/116738577-edb25800-a9f2-11eb-9a63-96805bb59cf4.png">
26+
27+
928
## ❤️ Contributors welcome! #hacktoberfest
1029

1130
We want to collect sample usage of Kotlin libraries, and the more the better!
@@ -16,7 +35,7 @@ You are very welcome to contribute your own library sample.
1635

1736
### 🤔How do you keep up with all the new stuff?
1837

19-
There are [great resources to learn Kotlin](https://dev.to/jmfayard/best-ways-to-learn-kotlin-from-scratch-or-from-java-with-books-or-tutorials-online-or-in-the-ide-52cm).
38+
There are [great resources to learn Kotlin](https://dev.to/jmfayard/best-ways-to-learn-kotlin-from-scratch-or-from-java-with-books-or-tutorials-online-or-in-the-ide-52cm).
2039

2140
But once you master the language, you are not done just yet.
2241

@@ -35,8 +54,8 @@ There are several inefficient ways to do that:
3554

3655
### 🦅Widening your knowledge of libraries
3756

38-
The `kotlin-libraries-playgound` contains samples for a growing number of good Kotlin libraries including
39-
[Moshi, Okio, OkHttp, Retrofit, Kotlinx Serialization, Ktor-client, ...](https://github.com/LouisCAD/kotlin-libraries-playground/tree/main/kotlin-jvm/src/main/kotlin/playground),
57+
The `kotlin-libraries-playgound` contains samples for a growing number of good Kotlin libraries including
58+
[Apollo, CliKt, Kodein DI, Kodein DB, Exposed, Fuel, Hoplite, Klaxon, Konad, Konf, Kotlin Collections, Kotlin Faker, Kotlin IO, Kotlinpoet, Kotlin Statistics, Kotlinx Serialization, Ktor Client, Mordant, Moshi, OkHttp, OkIO, Picnic, Retrofit, Skrapeit, SqlDelight, Statemachine, ...](https://github.com/LouisCAD/kotlin-libraries-playground/tree/main/kotlin-jvm/src/main/kotlin/playground),
4059
[KoTest, Mockk, Spek, Strikt, Mockito, Junit-Jupiter, ...](https://github.com/LouisCAD/kotlin-libraries-playground/tree/main/kotlin-jvm/src/test/kotlin/framework) ...
4160

4261
You are very welcome to contribute new samples (see contributing section below).

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ allprojects {
1818
maven("https://dl.bintray.com/kotlin/kotlin-eap/")
1919
maven("https://kotlin.bintray.com/kotlinx/")
2020
maven("https://dl.bintray.com/kodein-framework/Kodein-DB") // TODO: Remove when Kodein DB exits beta
21+
maven("https://dl.bintray.com/jetbrains/markdown")
2122
}
2223

2324
tasks.withType<KotlinCompile> {

kotlin-codegen/build.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
plugins {
22
kotlin("jvm")
33
kotlin("kapt")
4-
54
}
65

7-
86
dependencies {
97
// Keep dependencies sorted to minimize merge conflicts on pull-requests!
108
implementation("com.google.dagger:dagger:_")

kotlin-jvm/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,14 @@ dependencies {
3939
implementation("io.github.lucapiccinelli:konad:_")
4040
implementation("io.github.serpro69:kotlin-faker:_")
4141
implementation("it.skrape:skrapeit-core:_")
42+
implementation("it.skrape:skrapeit-http-fetcher:_")
4243
implementation("org.jetbrains.exposed:exposed-core:_")
4344
implementation("org.jetbrains.exposed:exposed-dao:_")
4445
implementation("org.jetbrains.exposed:exposed-java-time:_")
4546
implementation("org.jetbrains.exposed:exposed-jdbc:_")
4647
implementation("org.jetbrains.kotlin:kotlin-reflect:_")
4748
implementation("org.jetbrains.kotlinx:kotlinx-datetime:_")
49+
implementation("org.jetbrains:markdown-jvm:_")
4850
implementation("org.kodein.db:kodein-db-jvm:_")
4951
implementation("org.kodein.db:kodein-db-serializer-kotlinx:_")
5052
implementation( "org.kodein.db:kodein-leveldb-jni-jvm-linux:_")

kotlin-jvm/src/main/kotlin/playground/KodeinDB.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ internal class UnsupportedCountryListener : DBListener<City> {
6767

6868
override fun didPut(
6969
model: City,
70-
key: Key<*>,
70+
key: Key<City>,
7171
typeName: ReadMemory,
7272
metadata: Metadata,
7373
size: Int,

kotlin-jvm/src/main/kotlin/playground/Koin.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
package playground.di.koin
44

5-
import org.koin.core.KoinComponent
5+
import org.koin.core.component.KoinComponent
6+
import org.koin.core.component.inject
67
import org.koin.core.context.startKoin
7-
import org.koin.core.inject
88
import org.koin.core.qualifier.named
99
import org.koin.dsl.bind
1010
import org.koin.dsl.module

kotlin-jvm/src/main/kotlin/playground/KotlinPoet.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import playground.shouldBe
1313
* [Website](https://square.github.io/kotlinpoet)
1414
* [GitHub](https://github.com/square/kotlinpoet)
1515
*/
16-
1716
fun main() {
1817
println()
1918
println("# Kotlin Poet")
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
@file:Suppress("PackageDirectoryMismatch")
2+
3+
package playground.markdown
4+
5+
import org.intellij.markdown.IElementType
6+
import org.intellij.markdown.ast.ASTNode
7+
import org.intellij.markdown.ast.accept
8+
import org.intellij.markdown.ast.acceptChildren
9+
import org.intellij.markdown.ast.getTextInNode
10+
import org.intellij.markdown.ast.visitors.Visitor
11+
import org.intellij.markdown.flavours.commonmark.CommonMarkFlavourDescriptor
12+
import org.intellij.markdown.html.HtmlGenerator
13+
import org.intellij.markdown.parser.MarkdownParser
14+
import playground.shouldBe
15+
16+
17+
/**
18+
* jetbrains/markdown : Multiplatform Markdown processor written in Kotlin
19+
*
20+
* - [Website](https://github.com/JetBrains/markdown)
21+
* - [Github](https://github.com/JetBrains/markdown)
22+
*/
23+
fun main(){
24+
generateHtml()
25+
}
26+
27+
28+
fun generateHtml() {
29+
val src = "Some *Markdown*"
30+
val flavour = CommonMarkFlavourDescriptor()
31+
val parsedTree = MarkdownParser(flavour).buildMarkdownTreeFromString(src)
32+
val html = HtmlGenerator(src, parsedTree, flavour).generateHtml()
33+
html shouldBe """<body><p>Some <em>Markdown</em></p></body>"""
34+
}

kotlin-jvm/src/main/kotlin/playground/SkrapeIt.kt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
package playground.skrapeit
44

5+
import it.skrape.core.fetcher.HttpFetcher
56
import it.skrape.core.htmlDocument
67
import it.skrape.expect
7-
import it.skrape.matchers.ContentTypes
8-
import it.skrape.matchers.toBe
9-
import it.skrape.matchers.toBePresentTimes
10-
import it.skrape.matchers.toContain
8+
import it.skrape.fetcher.Result
9+
import it.skrape.fetcher.skrape
10+
import it.skrape.matchers.*
1111
import it.skrape.selects.and
1212
import it.skrape.selects.html5.*
1313
import it.skrape.skrape
@@ -173,11 +173,12 @@ private fun `Build CSS selectors`() {
173173
* [Testing an Endpoint that is returning HTML](https://docs.skrape.it/docs/dsl/basic-test-scenario#testing-an-endpoint-that-is-returning-html)
174174
*/
175175
private fun `Parse and verify response of url`() {
176-
skrape {
177-
url = "https://github.com/skrapeit/skrape.it"
176+
skrape(HttpFetcher) {
177+
request {
178+
url = "https://github.com/skrapeit/skrape.it"
179+
}
178180
expect {
179-
statusCode toBe 200
180-
statusMessage toBe "OK"
181+
responseStatus.code toBe 200
181182
contentType toBe ContentTypes.TEXT_HTML_UTF8
182183

183184
htmlDocument {

kotlin-jvm/src/main/kotlin/playground/_main.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ fun main() {
3030
playground.kotlinx.html.main()
3131
playground.kotlinx.serialization.main()
3232
playground.ktor.client.main()
33+
playground.markdown.main()
3334
playground.mordant.main()
3435
playground.moshi.main()
3536
playground.okhttp.main()

0 commit comments

Comments
 (0)