Skip to content

Commit a797a46

Browse files
committed
KTOR-8901 Remove @KtorDsl from functions
1 parent 9e5326e commit a797a46

File tree

17 files changed

+31
-89
lines changed

17 files changed

+31
-89
lines changed

ktor-client/ktor-client-core/common/src/io/ktor/client/HttpClient.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,6 @@ import kotlin.coroutines.CoroutineContext
329329
*
330330
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.HttpClient)
331331
*/
332-
@KtorDsl
333332
public expect fun HttpClient(
334333
block: HttpClientConfig<*>.() -> Unit = {}
335334
): HttpClient
@@ -642,7 +641,6 @@ public expect fun HttpClient(
642641
*
643642
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.HttpClient)
644643
*/
645-
@KtorDsl
646644
public fun <T : HttpClientEngineConfig> HttpClient(
647645
engineFactory: HttpClientEngineFactory<T>,
648646
block: HttpClientConfig<T>.() -> Unit = {}
@@ -968,7 +966,6 @@ public fun <T : HttpClientEngineConfig> HttpClient(
968966
*
969967
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.HttpClient)
970968
*/
971-
@KtorDsl
972969
public fun HttpClient(
973970
engine: HttpClientEngine,
974971
block: HttpClientConfig<*>.() -> Unit

ktor-client/ktor-client-core/jsAndWasmShared/src/io/ktor/client/HttpClientJs.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import io.ktor.utils.io.*
1616
*
1717
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.HttpClient)
1818
*/
19-
@KtorDsl
2019
public actual fun HttpClient(
2120
block: HttpClientConfig<*>.() -> Unit
2221
): HttpClient = HttpClient(FACTORY, block)

ktor-client/ktor-client-core/jvm/src/io/ktor/client/HttpClientJvm.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import java.util.*
2020
*
2121
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.HttpClient)
2222
*/
23-
@KtorDsl
2423
public actual fun HttpClient(
2524
block: HttpClientConfig<*>.() -> Unit
2625
): HttpClient = HttpClient(FACTORY, block)

ktor-client/ktor-client-core/posix/src/io/ktor/client/HttpClient.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import io.ktor.utils.io.*
1515
*
1616
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.HttpClient)
1717
*/
18-
@KtorDsl
1918
public actual fun HttpClient(
2019
block: HttpClientConfig<*>.() -> Unit
2120
): HttpClient = HttpClient(FACTORY, block)

ktor-client/ktor-client-plugins/ktor-client-auth/common/src/io/ktor/client/plugins/auth/providers/BasicAuthProvider.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import io.ktor.utils.io.core.*
1919
*
2020
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.plugins.auth.providers.basic)
2121
*/
22-
@KtorDsl
2322
public fun AuthConfig.basic(block: BasicAuthConfig.() -> Unit) {
2423
with(BasicAuthConfig().apply(block)) {
2524
this@basic.providers.add(BasicAuthProvider(credentials, realm, _sendWithoutRequest))

ktor-client/ktor-client-webrtc/common/src/io/ktor/client/webrtc/WebRtcClient.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ public fun interface WebRtcClientEngineFactory<out T : WebRtcConfig> {
4545
* ```
4646
* @param block configuration block for the client
4747
*/
48-
@KtorDsl
4948
@ExperimentalKtorApi
5049
public fun <T : WebRtcConfig> WebRtcClient(
5150
factory: WebRtcClientEngineFactory<T>,

ktor-io/common/src/io/ktor/utils/io/Annotations.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,6 @@ public annotation class PublicAPICandidate(val version: String)
108108
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.utils.io.KtorDsl)
109109
*/
110110
@DslMarker
111+
// TODO KTOR-8901: Remove AnnotationTarget.FUNCTION
111112
@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPEALIAS, AnnotationTarget.TYPE, AnnotationTarget.FUNCTION)
112113
public annotation class KtorDsl

ktor-server/ktor-server-core/common/src/io/ktor/server/application/Application.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ import kotlin.coroutines.EmptyCoroutineContext
2121
*
2222
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.server.application.ServerConfigBuilder)
2323
*/
24+
@Suppress("ktlint:standard:no-consecutive-comments")
25+
// TODO KTOR-8809: Uncomment the annotation
26+
// @KtorDsl
2427
public class ServerConfigBuilder(
2528
public val environment: ApplicationEnvironment
2629
) {

ktor-server/ktor-server-core/common/src/io/ktor/server/engine/ApplicationEngine.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ package io.ktor.server.engine
66

77
import io.ktor.server.application.*
88
import io.ktor.server.engine.internal.*
9-
import kotlinx.coroutines.*
9+
import kotlinx.coroutines.Dispatchers
10+
import kotlinx.coroutines.withContext
1011

1112
/**
1213
* An engine which runs an application.
@@ -20,7 +21,9 @@ public interface ApplicationEngine {
2021
*
2122
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.server.engine.ApplicationEngine.Configuration)
2223
*/
23-
@Suppress("MemberVisibilityCanBePrivate")
24+
@Suppress("MemberVisibilityCanBePrivate", "ktlint:standard:no-consecutive-comments")
25+
// TODO KTOR-8809: Uncomment the annotation
26+
// @KtorDsl
2427
public open class Configuration {
2528
/**
2629
* Returns the current parallelism level (e.g. the number of available processors).

ktor-server/ktor-server-core/common/src/io/ktor/server/routing/RegexRouting.kt

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import io.ktor.http.*
88
import io.ktor.server.application.*
99
import io.ktor.server.request.*
1010
import io.ktor.util.*
11-
import io.ktor.utils.io.*
12-
import kotlin.jvm.*
11+
import kotlin.jvm.JvmName
1312

1413
/**
1514
* Builds a route to match the specified regex [path].
@@ -27,7 +26,6 @@ import kotlin.jvm.*
2726
*
2827
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.server.routing.route)
2928
*/
30-
@KtorDsl
3129
public fun Route.route(path: Regex, build: Route.() -> Unit): Route =
3230
createRouteFromRegexPath(path).apply(build)
3331

@@ -47,7 +45,6 @@ public fun Route.route(path: Regex, build: Route.() -> Unit): Route =
4745
*
4846
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.server.routing.route)
4947
*/
50-
@KtorDsl
5148
public fun Route.route(path: Regex, method: HttpMethod, build: Route.() -> Unit): Route {
5249
val selector = HttpMethodRouteSelector(method)
5350
return createRouteFromRegexPath(path).createChild(selector).apply(build)
@@ -67,7 +64,6 @@ public fun Route.route(path: Regex, method: HttpMethod, build: Route.() -> Unit)
6764
*
6865
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.server.routing.get)
6966
*/
70-
@KtorDsl
7167
public fun Route.get(path: Regex, body: RoutingHandler): Route {
7268
return route(path, HttpMethod.Get) { handle(body) }
7369
}
@@ -86,7 +82,6 @@ public fun Route.get(path: Regex, body: RoutingHandler): Route {
8682
*
8783
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.server.routing.post)
8884
*/
89-
@KtorDsl
9085
public fun Route.post(path: Regex, body: RoutingHandler): Route {
9186
return route(path, HttpMethod.Post) { handle(body) }
9287
}
@@ -105,7 +100,6 @@ public fun Route.post(path: Regex, body: RoutingHandler): Route {
105100
*
106101
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.server.routing.post)
107102
*/
108-
@KtorDsl
109103
@JvmName("postTypedPath")
110104
public inline fun <reified R : Any> Route.post(
111105
path: Regex,
@@ -128,7 +122,6 @@ public inline fun <reified R : Any> Route.post(
128122
*
129123
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.server.routing.head)
130124
*/
131-
@KtorDsl
132125
public fun Route.head(path: Regex, body: RoutingHandler): Route {
133126
return route(path, HttpMethod.Head) { handle(body) }
134127
}
@@ -147,7 +140,6 @@ public fun Route.head(path: Regex, body: RoutingHandler): Route {
147140
*
148141
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.server.routing.put)
149142
*/
150-
@KtorDsl
151143
public fun Route.put(path: Regex, body: RoutingHandler): Route {
152144
return route(path, HttpMethod.Put) { handle(body) }
153145
}
@@ -166,7 +158,6 @@ public fun Route.put(path: Regex, body: RoutingHandler): Route {
166158
*
167159
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.server.routing.put)
168160
*/
169-
@KtorDsl
170161
@JvmName("putTypedPath")
171162
public inline fun <reified R : Any> Route.put(
172163
path: Regex,
@@ -189,7 +180,6 @@ public inline fun <reified R : Any> Route.put(
189180
*
190181
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.server.routing.patch)
191182
*/
192-
@KtorDsl
193183
public fun Route.patch(path: Regex, body: RoutingHandler): Route {
194184
return route(path, HttpMethod.Patch) { handle(body) }
195185
}
@@ -208,7 +198,6 @@ public fun Route.patch(path: Regex, body: RoutingHandler): Route {
208198
*
209199
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.server.routing.patch)
210200
*/
211-
@KtorDsl
212201
@JvmName("patchTypedPath")
213202
public inline fun <reified R : Any> Route.patch(
214203
path: Regex,
@@ -231,7 +220,6 @@ public inline fun <reified R : Any> Route.patch(
231220
*
232221
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.server.routing.delete)
233222
*/
234-
@KtorDsl
235223
public fun Route.delete(path: Regex, body: RoutingHandler): Route {
236224
return route(path, HttpMethod.Delete) { handle(body) }
237225
}
@@ -250,7 +238,6 @@ public fun Route.delete(path: Regex, body: RoutingHandler): Route {
250238
*
251239
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.server.routing.options)
252240
*/
253-
@KtorDsl
254241
public fun Route.options(path: Regex, body: RoutingHandler): Route {
255242
return route(path, HttpMethod.Options) { handle(body) }
256243
}

0 commit comments

Comments
 (0)