-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add test-kit - Add samples - Move HttpEngine to common
- Loading branch information
1 parent
f8e71b3
commit 07d8aae
Showing
54 changed files
with
333 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package dev.kord.common | ||
|
||
import dev.kord.common.annotation.KordInternal | ||
|
||
@KordInternal | ||
public expect object Platform { | ||
public val IS_JVM: Boolean | ||
public val IS_NODE: Boolean | ||
public val IS_BROWSER: Boolean | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package dev.kord.common.http | ||
|
||
import dev.kord.common.annotation.KordInternal | ||
import io.ktor.client.engine.* | ||
|
||
@KordInternal | ||
public expect object HttpEngine : HttpClientEngineFactory<HttpClientEngineConfig> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
package dev.kord.common | ||
|
||
expect suspend fun readFile(prefix: String, name: String): String | ||
import dev.kord.test.file | ||
suspend fun readFile(prefix: String, name: String): String = | ||
file("common", "json/$prefix/$name.json") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package dev.kord.common | ||
|
||
public actual object Platform { | ||
public actual val IS_JVM: Boolean = false | ||
public actual val IS_NODE: Boolean | ||
get() = js( | ||
"typeof process !== 'undefined' && process.versions != null && process.versions.node != null" | ||
) as Boolean | ||
public actual val IS_BROWSER: Boolean | ||
get() = js( | ||
"typeof window !== 'undefined' && typeof window.document !== 'undefined' || typeof self !== 'undefined' && typeof self.location !== 'undefined'" | ||
) as Boolean | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package dev.kord.common.http | ||
|
||
import io.ktor.client.engine.js.* | ||
|
||
public actual typealias HttpEngine = Js |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
@file:JvmName("ColorJvm" | ||
) | ||
@file:JvmName("ColorJvm") | ||
package dev.kord.common | ||
|
||
import java.awt.Color as AwtColor | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package dev.kord.common | ||
|
||
public actual object Platform { | ||
public actual val IS_JVM: Boolean = true | ||
public actual val IS_NODE: Boolean = false | ||
public actual val IS_BROWSER: Boolean = false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package dev.kord.common.http | ||
|
||
import io.ktor.client.engine.* | ||
import io.ktor.client.engine.cio.* | ||
|
||
public actual object HttpEngine : HttpClientEngineFactory<HttpClientEngineConfig> by CIO |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
plugins { | ||
`kord-module` | ||
`kord-publishing` | ||
} | ||
|
||
dependencies { | ||
api(projects.core) | ||
api(projects.voice) | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,26 @@ | ||
plugins { | ||
java | ||
`kord-module` | ||
`kord-sampled-module` | ||
`kord-multiplatform-module` | ||
`kord-publishing` | ||
} | ||
|
||
val voice: SourceSet by sourceSets.creating | ||
val voiceApi: Configuration by configurations.getting | ||
kotlin { | ||
sourceSets { | ||
commonMain { | ||
dependencies { | ||
compileOnly(projects.kspAnnotations) | ||
api(projects.common) | ||
api(projects.rest) | ||
api(projects.gateway) | ||
|
||
configurations { | ||
getByName("voiceImplementation") { | ||
extendsFrom(implementation.get()) | ||
} | ||
} | ||
|
||
dependencies { | ||
api(projects.common) | ||
api(projects.rest) | ||
api(projects.gateway) | ||
voiceApi(projects.core) | ||
voiceApi(projects.voice) | ||
|
||
api(libs.kord.cache.api) | ||
api(libs.kord.cache.map) | ||
|
||
samplesImplementation(libs.slf4j.simple) | ||
|
||
testImplementation(libs.bundles.test.implementation) | ||
testRuntimeOnly(libs.bundles.test.runtime) | ||
} | ||
api(libs.kord.cache.api) | ||
api(libs.kord.cache.map) | ||
} | ||
} | ||
|
||
java { | ||
registerFeature("voice") { | ||
usingSourceSet(voice) | ||
withJavadocJar() | ||
withSourcesJar() | ||
capability("dev.kord", "core-voice", version as String) | ||
jvmTest { | ||
dependencies { | ||
implementation(libs.mockk) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.