From 0093a0385f685b5cb5e754dc827abfa446db82b5 Mon Sep 17 00:00:00 2001 From: Antoine Promerova Date: Fri, 6 Jan 2023 19:38:13 +0100 Subject: [PATCH] Update java kotlin gradle --- .github/workflows/publish.yml | 6 +++--- build.gradle.kts | 6 ++---- .../io/kotless/dsl/cloud/aws/CloudWatch.kt | 1 - .../dsl/cloud/aws/model/AwsHttpRequest.kt | 3 +-- .../src/main/kotlin/io/kotless/dsl/utils/JSON.kt | 1 - dsl/common/dsl-parser-common/build.gradle.kts | 5 ----- .../src/main/kotlin/io/kotless/dsl/HandlerAWS.kt | 1 - .../kotless/dsl/app/events/EventsDispatcher.kt | 1 - .../dsl/app/events/EventsReflectionScanner.kt | 1 - .../io/kotless/dsl/app/events/EventsStorage.kt | 2 +- .../main/kotlin/io/kotless/dsl/HandlerAzure.kt | 2 +- .../dsl/events/EventsReflectionScanner.kt | 2 +- .../io/kotless/dsl/events/EventsStorage.kt | 2 -- dsl/kotless/kotless-lang-local/build.gradle.kts | 5 ----- dsl/kotless/kotless-lang-parser/build.gradle.kts | 5 ----- .../main/kotlin/io/kotless/dsl/Application.kt | 2 +- .../io/kotless/dsl/app/http/RoutesDispatcher.kt | 2 +- .../io/kotless/dsl/app/http/RoutesStorage.kt | 2 +- .../io/kotless/dsl/config/KotlessAppConfig.kt | 2 +- .../dsl/conversion/DefaultConversionService.kt | 2 +- .../kotlin/io/kotless/dsl/lang/KotlessContext.kt | 2 +- .../io/kotless/dsl/reflection/FunctionCaller.kt | 2 +- .../kotless/dsl/reflection/ReflectionScanner.kt | 2 +- .../kotlin/io/kotless/dsl/ktor/KotlessAzure.kt | 3 +-- dsl/ktor/ktor-lang-local/build.gradle.kts | 5 ----- dsl/ktor/ktor-lang-parser/build.gradle.kts | 5 ----- .../io/kotless/dsl/ktor/app/KotlessRequest.kt | 16 ++++++++++++++++ .../spring-boot-lang-local/build.gradle.kts | 5 ----- .../main/kotlin/io/kotless/dsl/spring/Kotless.kt | 1 - dsl/spring/spring-lang-parser/build.gradle.kts | 5 ----- engine/build.gradle.kts | 5 ----- gradle/wrapper/gradle-wrapper.properties | 2 +- model/src/main/kotlin/io/kotless/Constants.kt | 8 +++++--- model/src/main/kotlin/io/kotless/Event.kt | 1 - model/src/main/kotlin/io/kotless/Permission.kt | 2 +- .../src/main/kotlin/io/kotless/utils/Storage.kt | 1 - .../main/kotlin/io/kotless/utils/TypedStorage.kt | 3 --- .../main/kotlin/io/kotless/utils/Visitable.kt | 3 --- .../gradle/tasks/local/LocalStackRunner.kt | 4 ++-- schema/build.gradle.kts | 5 ----- .../src/main/kotlin/io/kotless/KotlessConfig.kt | 2 -- 41 files changed, 43 insertions(+), 92 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 978f5265..4381518e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,11 +16,11 @@ jobs: - name: Get latest tag id: latesttag uses: "WyriHaximus/github-action-get-previous-tag@v1" - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - java-version: '11' - distribution: 'adopt' + java-version: '17' + distribution: 'temurin' - name: Validate Gradle wrapper uses: gradle/wrapper-validation-action@v1 - name: Publish kotless to github packages diff --git a/build.gradle.kts b/build.gradle.kts index f2f0369e..5fdacdb1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,11 +1,10 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompile group = "io.kotless" -version = "0.3.0" plugins { id("io.gitlab.arturbosch.detekt") version ("1.15.0") apply true - kotlin("jvm") version "1.5.31" apply false + kotlin("jvm") version "1.8.0" apply false `maven-publish` } @@ -49,8 +48,7 @@ subprojects { } tasks.withType { kotlinOptions { - jvmTarget = "11" - freeCompilerArgs = freeCompilerArgs + listOf("-Xuse-experimental=kotlin.Experimental") + jvmTarget = "17" } } diff --git a/dsl/common/cloud/dsl-common-aws/src/main/kotlin/io/kotless/dsl/cloud/aws/CloudWatch.kt b/dsl/common/cloud/dsl-common-aws/src/main/kotlin/io/kotless/dsl/cloud/aws/CloudWatch.kt index c8259328..f325ab89 100644 --- a/dsl/common/cloud/dsl-common-aws/src/main/kotlin/io/kotless/dsl/cloud/aws/CloudWatch.kt +++ b/dsl/common/cloud/dsl-common-aws/src/main/kotlin/io/kotless/dsl/cloud/aws/CloudWatch.kt @@ -4,6 +4,5 @@ import io.kotless.InternalAPI import kotlinx.serialization.Serializable /** AWS CloudWatch event representation */ -@InternalAPI @Serializable data class CloudWatch(val source: String, val `detail-type`: String, val resources: Set) diff --git a/dsl/common/cloud/dsl-common-aws/src/main/kotlin/io/kotless/dsl/cloud/aws/model/AwsHttpRequest.kt b/dsl/common/cloud/dsl-common-aws/src/main/kotlin/io/kotless/dsl/cloud/aws/model/AwsHttpRequest.kt index 11ed0b82..7eab2fa2 100644 --- a/dsl/common/cloud/dsl-common-aws/src/main/kotlin/io/kotless/dsl/cloud/aws/model/AwsHttpRequest.kt +++ b/dsl/common/cloud/dsl-common-aws/src/main/kotlin/io/kotless/dsl/cloud/aws/model/AwsHttpRequest.kt @@ -8,7 +8,6 @@ import kotlinx.serialization.Serializable import java.util.* /** HTTP's request ApiGateway representation */ -@InternalAPI @Serializable data class AwsHttpRequest( val resource: String, @@ -55,7 +54,7 @@ data class AwsHttpRequest( data class RequestIdentity(val sourceIp: String, val userAgent: String?) } - @InternalAPI + fun toRequest(): HttpRequest { return HttpRequest( path, method, params.orEmpty(), diff --git a/dsl/common/dsl-common/src/main/kotlin/io/kotless/dsl/utils/JSON.kt b/dsl/common/dsl-common/src/main/kotlin/io/kotless/dsl/utils/JSON.kt index 323b72c6..1681325c 100644 --- a/dsl/common/dsl-common/src/main/kotlin/io/kotless/dsl/utils/JSON.kt +++ b/dsl/common/dsl-common/src/main/kotlin/io/kotless/dsl/utils/JSON.kt @@ -4,7 +4,6 @@ import io.kotless.InternalAPI import kotlinx.serialization.KSerializer import kotlinx.serialization.json.Json -@InternalAPI object JSON { val json = Json { ignoreUnknownKeys = true diff --git a/dsl/common/dsl-parser-common/build.gradle.kts b/dsl/common/dsl-parser-common/build.gradle.kts index 2e6378d9..80df618e 100644 --- a/dsl/common/dsl-parser-common/build.gradle.kts +++ b/dsl/common/dsl-parser-common/build.gradle.kts @@ -18,8 +18,3 @@ dependencies { implementation(project(":dsl:kotless:cloud:kotless-lang-azure")) } -tasks.withType { - kotlinOptions { - freeCompilerArgs = freeCompilerArgs + listOf("-Xuse-experimental=io.kotless.InternalAPI") - } -} diff --git a/dsl/kotless/cloud/kotless-lang-aws/src/main/kotlin/io/kotless/dsl/HandlerAWS.kt b/dsl/kotless/cloud/kotless-lang-aws/src/main/kotlin/io/kotless/dsl/HandlerAWS.kt index fc05d2a7..378f229a 100644 --- a/dsl/kotless/cloud/kotless-lang-aws/src/main/kotlin/io/kotless/dsl/HandlerAWS.kt +++ b/dsl/kotless/cloud/kotless-lang-aws/src/main/kotlin/io/kotless/dsl/HandlerAWS.kt @@ -25,7 +25,6 @@ import java.io.OutputStream * * ApiGateway Post and Get requests * * CloudWatch events (used for warming and scheduling) */ -@InternalAPI class HandlerAWS : RequestStreamHandler { companion object { private val logger = LoggerFactory.getLogger(HandlerAWS::class.java) diff --git a/dsl/kotless/cloud/kotless-lang-aws/src/main/kotlin/io/kotless/dsl/app/events/EventsDispatcher.kt b/dsl/kotless/cloud/kotless-lang-aws/src/main/kotlin/io/kotless/dsl/app/events/EventsDispatcher.kt index ed066573..230e70c6 100644 --- a/dsl/kotless/cloud/kotless-lang-aws/src/main/kotlin/io/kotless/dsl/app/events/EventsDispatcher.kt +++ b/dsl/kotless/cloud/kotless-lang-aws/src/main/kotlin/io/kotless/dsl/app/events/EventsDispatcher.kt @@ -7,7 +7,6 @@ import io.kotless.dsl.cloud.aws.CloudWatch import io.kotless.dsl.reflection.FunctionCaller import org.slf4j.LoggerFactory -@InternalAPI object EventsDispatcher { private val logger = LoggerFactory.getLogger(EventsDispatcher::class.java) diff --git a/dsl/kotless/cloud/kotless-lang-aws/src/main/kotlin/io/kotless/dsl/app/events/EventsReflectionScanner.kt b/dsl/kotless/cloud/kotless-lang-aws/src/main/kotlin/io/kotless/dsl/app/events/EventsReflectionScanner.kt index 12e4d1d5..a7079daf 100644 --- a/dsl/kotless/cloud/kotless-lang-aws/src/main/kotlin/io/kotless/dsl/app/events/EventsReflectionScanner.kt +++ b/dsl/kotless/cloud/kotless-lang-aws/src/main/kotlin/io/kotless/dsl/app/events/EventsReflectionScanner.kt @@ -10,7 +10,6 @@ import kotlin.reflect.KFunction import kotlin.reflect.full.findAnnotation import kotlin.reflect.jvm.kotlinFunction -@InternalAPI object EventsReflectionScanner { data class Data(val ids: Set, val method: Method, val annotation: Scheduled) diff --git a/dsl/kotless/cloud/kotless-lang-aws/src/main/kotlin/io/kotless/dsl/app/events/EventsStorage.kt b/dsl/kotless/cloud/kotless-lang-aws/src/main/kotlin/io/kotless/dsl/app/events/EventsStorage.kt index a444821d..98610b79 100644 --- a/dsl/kotless/cloud/kotless-lang-aws/src/main/kotlin/io/kotless/dsl/app/events/EventsStorage.kt +++ b/dsl/kotless/cloud/kotless-lang-aws/src/main/kotlin/io/kotless/dsl/app/events/EventsStorage.kt @@ -7,7 +7,7 @@ import kotlin.reflect.KFunction import kotlin.reflect.jvm.kotlinFunction -@InternalAPI + internal object EventsStorage { private val logger = LoggerFactory.getLogger(EventsStorage::class.java) diff --git a/dsl/kotless/cloud/kotless-lang-azure/src/main/kotlin/io/kotless/dsl/HandlerAzure.kt b/dsl/kotless/cloud/kotless-lang-azure/src/main/kotlin/io/kotless/dsl/HandlerAzure.kt index e81def7d..133efac4 100644 --- a/dsl/kotless/cloud/kotless-lang-azure/src/main/kotlin/io/kotless/dsl/HandlerAzure.kt +++ b/dsl/kotless/cloud/kotless-lang-azure/src/main/kotlin/io/kotless/dsl/HandlerAzure.kt @@ -13,7 +13,7 @@ import io.kotless.dsl.reflection.FunctionCaller import org.slf4j.LoggerFactory import java.util.* -@InternalAPI + class HandlerAzure : AzureRequestHandler { companion object { private val logger = LoggerFactory.getLogger(HandlerAzure::class.java) diff --git a/dsl/kotless/cloud/kotless-lang-azure/src/main/kotlin/io/kotless/dsl/events/EventsReflectionScanner.kt b/dsl/kotless/cloud/kotless-lang-azure/src/main/kotlin/io/kotless/dsl/events/EventsReflectionScanner.kt index 12e4d1d5..01e82ab1 100644 --- a/dsl/kotless/cloud/kotless-lang-azure/src/main/kotlin/io/kotless/dsl/events/EventsReflectionScanner.kt +++ b/dsl/kotless/cloud/kotless-lang-azure/src/main/kotlin/io/kotless/dsl/events/EventsReflectionScanner.kt @@ -10,7 +10,7 @@ import kotlin.reflect.KFunction import kotlin.reflect.full.findAnnotation import kotlin.reflect.jvm.kotlinFunction -@InternalAPI + object EventsReflectionScanner { data class Data(val ids: Set, val method: Method, val annotation: Scheduled) diff --git a/dsl/kotless/cloud/kotless-lang-azure/src/main/kotlin/io/kotless/dsl/events/EventsStorage.kt b/dsl/kotless/cloud/kotless-lang-azure/src/main/kotlin/io/kotless/dsl/events/EventsStorage.kt index a444821d..57fc5395 100644 --- a/dsl/kotless/cloud/kotless-lang-azure/src/main/kotlin/io/kotless/dsl/events/EventsStorage.kt +++ b/dsl/kotless/cloud/kotless-lang-azure/src/main/kotlin/io/kotless/dsl/events/EventsStorage.kt @@ -1,13 +1,11 @@ package io.kotless.dsl.app.events -import io.kotless.InternalAPI import io.kotless.dsl.lang.event.Scheduled import org.slf4j.LoggerFactory import kotlin.reflect.KFunction import kotlin.reflect.jvm.kotlinFunction -@InternalAPI internal object EventsStorage { private val logger = LoggerFactory.getLogger(EventsStorage::class.java) diff --git a/dsl/kotless/kotless-lang-local/build.gradle.kts b/dsl/kotless/kotless-lang-local/build.gradle.kts index 553d45fa..fd7ad73d 100644 --- a/dsl/kotless/kotless-lang-local/build.gradle.kts +++ b/dsl/kotless/kotless-lang-local/build.gradle.kts @@ -14,8 +14,3 @@ dependencies { } -tasks.withType { - kotlinOptions { - freeCompilerArgs = freeCompilerArgs + listOf("-Xuse-experimental=io.kotless.InternalAPI") - } -} diff --git a/dsl/kotless/kotless-lang-parser/build.gradle.kts b/dsl/kotless/kotless-lang-parser/build.gradle.kts index 266df73a..3d6f78fd 100644 --- a/dsl/kotless/kotless-lang-parser/build.gradle.kts +++ b/dsl/kotless/kotless-lang-parser/build.gradle.kts @@ -10,8 +10,3 @@ dependencies { } -tasks.withType { - kotlinOptions { - freeCompilerArgs = freeCompilerArgs + listOf("-Xuse-experimental=io.kotless.InternalAPI") - } -} diff --git a/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/Application.kt b/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/Application.kt index 74035163..05541586 100644 --- a/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/Application.kt +++ b/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/Application.kt @@ -7,7 +7,7 @@ import io.kotless.dsl.lang.LambdaWarming import io.kotless.dsl.reflection.ReflectionScanner import org.slf4j.LoggerFactory -@InternalAPI + object Application { private val logger = LoggerFactory.getLogger(Application::class.java) diff --git a/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/app/http/RoutesDispatcher.kt b/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/app/http/RoutesDispatcher.kt index 3f7e99cb..e557454a 100644 --- a/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/app/http/RoutesDispatcher.kt +++ b/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/app/http/RoutesDispatcher.kt @@ -10,7 +10,7 @@ import io.kotless.dsl.reflection.ReflectionScanner import org.slf4j.LoggerFactory import java.lang.reflect.InvocationTargetException -@InternalAPI + object RoutesDispatcher { private val logger = LoggerFactory.getLogger(RoutesDispatcher::class.java) diff --git a/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/app/http/RoutesStorage.kt b/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/app/http/RoutesStorage.kt index 48eddb74..03b145f5 100644 --- a/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/app/http/RoutesStorage.kt +++ b/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/app/http/RoutesStorage.kt @@ -7,7 +7,7 @@ import org.slf4j.LoggerFactory import kotlin.reflect.KFunction import kotlin.reflect.full.findAnnotation -@InternalAPI + internal object RoutesStorage { data class Descriptor(val func: KFunction<*>, val mime: MimeType) diff --git a/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/config/KotlessAppConfig.kt b/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/config/KotlessAppConfig.kt index c1ac348a..cac0a4be 100644 --- a/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/config/KotlessAppConfig.kt +++ b/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/config/KotlessAppConfig.kt @@ -2,7 +2,7 @@ package io.kotless.dsl.config import io.kotless.InternalAPI -@InternalAPI + object KotlessAppConfig { const val PACKAGE_ENV_NAME = "KOTLESS_PACKAGES" diff --git a/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/conversion/DefaultConversionService.kt b/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/conversion/DefaultConversionService.kt index 33963e96..e3634ed9 100644 --- a/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/conversion/DefaultConversionService.kt +++ b/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/conversion/DefaultConversionService.kt @@ -12,7 +12,7 @@ import java.net.URLEncoder /** The default conversion service that supports only basic types and enums */ @Suppress("ComplexMethod") -@InternalAPI + internal object DefaultConversionService : ConversionService() { override fun convertTo(value: Any): String { return when (val type = value.javaClass) { diff --git a/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/lang/KotlessContext.kt b/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/lang/KotlessContext.kt index af67d270..ab40f2b4 100644 --- a/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/lang/KotlessContext.kt +++ b/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/lang/KotlessContext.kt @@ -13,7 +13,7 @@ object KotlessContext { object HTTP { private var currentRequest: ThreadLocal = ThreadLocal.withInitial { null } - @InternalAPI + internal fun reset() { currentRequest.remove() } diff --git a/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/reflection/FunctionCaller.kt b/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/reflection/FunctionCaller.kt index 3b3993b5..cb601583 100644 --- a/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/reflection/FunctionCaller.kt +++ b/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/reflection/FunctionCaller.kt @@ -6,7 +6,7 @@ import kotlin.jvm.internal.FunctionReference import kotlin.reflect.* import kotlin.reflect.jvm.isAccessible -@InternalAPI + object FunctionCaller { private object NULL diff --git a/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/reflection/ReflectionScanner.kt b/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/reflection/ReflectionScanner.kt index 7fa9857e..29f03554 100644 --- a/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/reflection/ReflectionScanner.kt +++ b/dsl/kotless/kotless-lang/src/main/kotlin/io/kotless/dsl/reflection/ReflectionScanner.kt @@ -19,7 +19,7 @@ import kotlin.reflect.jvm.kotlinFunction * * For example, it is used to find HTTP handlers and @Scheduled functions */ -@InternalAPI + object ReflectionScanner { private val reflections by lazy { val configurationBuilder = ConfigurationBuilder() diff --git a/dsl/ktor/cloud/ktor-lang-azure/src/main/kotlin/io/kotless/dsl/ktor/KotlessAzure.kt b/dsl/ktor/cloud/ktor-lang-azure/src/main/kotlin/io/kotless/dsl/ktor/KotlessAzure.kt index 3332d8e7..6c3641e3 100644 --- a/dsl/ktor/cloud/ktor-lang-azure/src/main/kotlin/io/kotless/dsl/ktor/KotlessAzure.kt +++ b/dsl/ktor/cloud/ktor-lang-azure/src/main/kotlin/io/kotless/dsl/ktor/KotlessAzure.kt @@ -21,7 +21,6 @@ import java.util.Optional * Override [prepare] method and setup your application */ @Suppress("unused") -@InternalAPI abstract class KotlessAzure : AzureRequestHandler { companion object { private val logger = LoggerFactory.getLogger(KotlessAzure::class.java) @@ -37,7 +36,7 @@ abstract class KotlessAzure : AzureRequestHandler { abstract fun prepare(app: Application) - @InternalAPI + override fun run( @HttpTrigger( name = "req", diff --git a/dsl/ktor/ktor-lang-local/build.gradle.kts b/dsl/ktor/ktor-lang-local/build.gradle.kts index a463b6e2..ecd6bda8 100644 --- a/dsl/ktor/ktor-lang-local/build.gradle.kts +++ b/dsl/ktor/ktor-lang-local/build.gradle.kts @@ -13,8 +13,3 @@ dependencies { api("io.ktor", "ktor-server-netty", Versions.ktor) } -tasks.withType { - kotlinOptions { - freeCompilerArgs = freeCompilerArgs + listOf("-Xuse-experimental=io.kotless.InternalAPI") - } -} diff --git a/dsl/ktor/ktor-lang-parser/build.gradle.kts b/dsl/ktor/ktor-lang-parser/build.gradle.kts index 4a23af4e..c6641736 100644 --- a/dsl/ktor/ktor-lang-parser/build.gradle.kts +++ b/dsl/ktor/ktor-lang-parser/build.gradle.kts @@ -12,8 +12,3 @@ dependencies { } -tasks.withType { - kotlinOptions { - freeCompilerArgs = freeCompilerArgs + listOf("-Xuse-experimental=io.kotless.InternalAPI") - } -} diff --git a/dsl/ktor/ktor-lang/src/main/kotlin/io/kotless/dsl/ktor/app/KotlessRequest.kt b/dsl/ktor/ktor-lang/src/main/kotlin/io/kotless/dsl/ktor/app/KotlessRequest.kt index e243445c..688c20ca 100644 --- a/dsl/ktor/ktor-lang/src/main/kotlin/io/kotless/dsl/ktor/app/KotlessRequest.kt +++ b/dsl/ktor/ktor-lang/src/main/kotlin/io/kotless/dsl/ktor/app/KotlessRequest.kt @@ -26,13 +26,29 @@ class KotlessRequest(val query: HttpRequest, call: ApplicationCall) : BaseApplic } override val local: RequestConnectionPoint = object : RequestConnectionPoint { + @Deprecated("Use localHost or serverHost instead") override val host: String = query.context.domain + override val localAddress: String + get() = TODO("Not yet implemented") + override val localHost: String + get() = TODO("Not yet implemented") + override val localPort: Int + get() = TODO("Not yet implemented") override val method: HttpMethod = HttpMethod.parse(query.method.name) //Port is not applicable in case of Serverless execution + @Deprecated("Use localPort or serverPort instead") override val port: Int = -1 + override val remoteAddress: String + get() = TODO("Not yet implemented") override val remoteHost: String = query.context.sourceIp + override val remotePort: Int + get() = TODO("Not yet implemented") override val scheme: String = query.context.protocol + override val serverHost: String + get() = TODO("Not yet implemented") + override val serverPort: Int + get() = TODO("Not yet implemented") override val uri: String = query.path override val version: String = query.context.protocol } diff --git a/dsl/spring/spring-boot-lang-local/build.gradle.kts b/dsl/spring/spring-boot-lang-local/build.gradle.kts index eaa0927a..90851249 100644 --- a/dsl/spring/spring-boot-lang-local/build.gradle.kts +++ b/dsl/spring/spring-boot-lang-local/build.gradle.kts @@ -14,8 +14,3 @@ dependencies { } } -tasks.withType { - kotlinOptions { - freeCompilerArgs = freeCompilerArgs + listOf("-Xuse-experimental=io.kotless.InternalAPI") - } -} diff --git a/dsl/spring/spring-boot-lang/src/main/kotlin/io/kotless/dsl/spring/Kotless.kt b/dsl/spring/spring-boot-lang/src/main/kotlin/io/kotless/dsl/spring/Kotless.kt index 0306b143..1691e2c1 100644 --- a/dsl/spring/spring-boot-lang/src/main/kotlin/io/kotless/dsl/spring/Kotless.kt +++ b/dsl/spring/spring-boot-lang/src/main/kotlin/io/kotless/dsl/spring/Kotless.kt @@ -29,7 +29,6 @@ abstract class Kotless : RequestStreamHandler { private var handler: SpringBootLambdaContainerHandler? = null } - @InternalAPI override fun handleRequest(input: InputStream, output: OutputStream, context: Context) { if (!prepared) { handler = SpringBootLambdaContainerHandler.getAwsProxyHandler(bootKlass.java) diff --git a/dsl/spring/spring-lang-parser/build.gradle.kts b/dsl/spring/spring-lang-parser/build.gradle.kts index db976517..3ffad6c9 100644 --- a/dsl/spring/spring-lang-parser/build.gradle.kts +++ b/dsl/spring/spring-lang-parser/build.gradle.kts @@ -12,8 +12,3 @@ dependencies { api(project(":dsl:common:dsl-parser-common")) } -tasks.withType { - kotlinOptions { - freeCompilerArgs = freeCompilerArgs + listOf("-Xuse-experimental=io.kotless.InternalAPI") - } -} diff --git a/engine/build.gradle.kts b/engine/build.gradle.kts index 616d04a2..247a086e 100644 --- a/engine/build.gradle.kts +++ b/engine/build.gradle.kts @@ -12,8 +12,3 @@ dependencies { } -tasks.withType { - kotlinOptions { - freeCompilerArgs = freeCompilerArgs + listOf("-Xuse-experimental=io.kotless.InternalAPI") - } -} diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1c4bcc29..f42e62f3 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/model/src/main/kotlin/io/kotless/Constants.kt b/model/src/main/kotlin/io/kotless/Constants.kt index 220ffffe..cd5fca39 100644 --- a/model/src/main/kotlin/io/kotless/Constants.kt +++ b/model/src/main/kotlin/io/kotless/Constants.kt @@ -1,6 +1,8 @@ package io.kotless -@InternalAPI +import java.util.Locale + + object Constants { object LocalStack { const val enabled = "LOCALSTACK_ENABLED" @@ -8,8 +10,8 @@ object Constants { const val accessKey = "LOCALSTACK_ACCESSKEY" const val secretKey = "LOCALSTACK_SECRETKEY" - fun url(resource: AwsResource) = "LOCALSTACK_${resource.prefix.toUpperCase()}_URL" - fun region(resource: AwsResource) = "LOCALSTACK_${resource.prefix.toUpperCase()}_REGION" + fun url(resource: AwsResource) = "LOCALSTACK_${resource.prefix.uppercase(Locale.getDefault())}_URL" + fun region(resource: AwsResource) = "LOCALSTACK_${resource.prefix.uppercase(Locale.getDefault())}_REGION" } object Local { diff --git a/model/src/main/kotlin/io/kotless/Event.kt b/model/src/main/kotlin/io/kotless/Event.kt index b46d4fb5..91562b7d 100644 --- a/model/src/main/kotlin/io/kotless/Event.kt +++ b/model/src/main/kotlin/io/kotless/Event.kt @@ -1,6 +1,5 @@ package io.kotless -@InternalAPI /** Type of scheduled event -- either user one [ScheduledEventType.General] or autowarm [ScheduledEventType.Autowarm] */ enum class ScheduledEventType(val prefix: String) { General("general"), diff --git a/model/src/main/kotlin/io/kotless/Permission.kt b/model/src/main/kotlin/io/kotless/Permission.kt index 6b46433b..85c446ad 100644 --- a/model/src/main/kotlin/io/kotless/Permission.kt +++ b/model/src/main/kotlin/io/kotless/Permission.kt @@ -52,7 +52,7 @@ enum class AwsResource( companion object { /** Resources that can be created during local start */ - @InternalAPI + val forLocalStart = setOf(S3, SSM, DynamoDB) } } diff --git a/model/src/main/kotlin/io/kotless/utils/Storage.kt b/model/src/main/kotlin/io/kotless/utils/Storage.kt index 422cd561..0d19f8c2 100644 --- a/model/src/main/kotlin/io/kotless/utils/Storage.kt +++ b/model/src/main/kotlin/io/kotless/utils/Storage.kt @@ -3,7 +3,6 @@ package io.kotless.utils import io.kotless.InternalAPI /** Interface for type-full singleton storage */ -@InternalAPI class Storage { private val myStorage = HashMap, Any>() diff --git a/model/src/main/kotlin/io/kotless/utils/TypedStorage.kt b/model/src/main/kotlin/io/kotless/utils/TypedStorage.kt index deddc3a3..893aead2 100644 --- a/model/src/main/kotlin/io/kotless/utils/TypedStorage.kt +++ b/model/src/main/kotlin/io/kotless/utils/TypedStorage.kt @@ -1,9 +1,6 @@ package io.kotless.utils -import io.kotless.InternalAPI - /** Interface for type-full singleton storage */ -@InternalAPI class TypedStorage(private val storage: MutableMap, T> = HashMap()) { class Key diff --git a/model/src/main/kotlin/io/kotless/utils/Visitable.kt b/model/src/main/kotlin/io/kotless/utils/Visitable.kt index 9d933e11..88b3e124 100644 --- a/model/src/main/kotlin/io/kotless/utils/Visitable.kt +++ b/model/src/main/kotlin/io/kotless/utils/Visitable.kt @@ -1,9 +1,6 @@ package io.kotless.utils -import io.kotless.InternalAPI - /** Defines entity that can be walked by visitor */ -@InternalAPI interface Visitable { fun visit(visitor: (Any) -> Unit) { visitor(this) diff --git a/plugins/gradle/src/main/kotlin/io/kotless/plugin/gradle/tasks/local/LocalStackRunner.kt b/plugins/gradle/src/main/kotlin/io/kotless/plugin/gradle/tasks/local/LocalStackRunner.kt index 806229e8..fd3fcf6e 100644 --- a/plugins/gradle/src/main/kotlin/io/kotless/plugin/gradle/tasks/local/LocalStackRunner.kt +++ b/plugins/gradle/src/main/kotlin/io/kotless/plugin/gradle/tasks/local/LocalStackRunner.kt @@ -91,6 +91,6 @@ internal class LocalStackRunner(private val isEnabled: Boolean, resources: Set { - kotlinOptions { - freeCompilerArgs = freeCompilerArgs + listOf("-Xuse-experimental=io.kotless.InternalAPI") - } -} diff --git a/schema/src/main/kotlin/io/kotless/KotlessConfig.kt b/schema/src/main/kotlin/io/kotless/KotlessConfig.kt index f55b8569..3b214c5d 100644 --- a/schema/src/main/kotlin/io/kotless/KotlessConfig.kt +++ b/schema/src/main/kotlin/io/kotless/KotlessConfig.kt @@ -17,11 +17,9 @@ data class KotlessConfig( val optimization: Optimization = Optimization(), ) : Visitable { - @InternalAPI val aws: Cloud.AWS get() = cloud as Cloud.AWS - @InternalAPI val azure: Cloud.Azure get() = cloud as Cloud.Azure