Skip to content

Commit

Permalink
Update java kotlin gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Promerova committed Jan 6, 2023
1 parent bcb960a commit 0093a03
Show file tree
Hide file tree
Showing 41 changed files with 43 additions and 92 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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`
}

Expand Down Expand Up @@ -49,8 +48,7 @@ subprojects {
}
tasks.withType<KotlinJvmCompile> {
kotlinOptions {
jvmTarget = "11"
freeCompilerArgs = freeCompilerArgs + listOf("-Xuse-experimental=kotlin.Experimental")
jvmTarget = "17"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import kotlinx.serialization.Serializable
import java.util.*

/** HTTP's request ApiGateway representation */
@InternalAPI
@Serializable
data class AwsHttpRequest(
val resource: String,
Expand Down Expand Up @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions dsl/common/dsl-parser-common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,3 @@ dependencies {
implementation(project(":dsl:kotless:cloud:kotless-lang-azure"))
}

tasks.withType<KotlinJvmCompile> {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + listOf("-Xuse-experimental=io.kotless.InternalAPI")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>, val method: Method, val annotation: Scheduled)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>, val method: Method, val annotation: Scheduled)

Expand Down
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
5 changes: 0 additions & 5 deletions dsl/kotless/kotless-lang-local/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,3 @@ dependencies {
}


tasks.withType<KotlinJvmCompile> {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + listOf("-Xuse-experimental=io.kotless.InternalAPI")
}
}
5 changes: 0 additions & 5 deletions dsl/kotless/kotless-lang-parser/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,3 @@ dependencies {
}


tasks.withType<KotlinJvmCompile> {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + listOf("-Xuse-experimental=io.kotless.InternalAPI")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.kotless.dsl.config

import io.kotless.InternalAPI

@InternalAPI

object KotlessAppConfig {
const val PACKAGE_ENV_NAME = "KOTLESS_PACKAGES"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ object KotlessContext {
object HTTP {
private var currentRequest: ThreadLocal<HttpRequest?> = ThreadLocal.withInitial { null }

@InternalAPI

internal fun reset() {
currentRequest.remove()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import kotlin.jvm.internal.FunctionReference
import kotlin.reflect.*
import kotlin.reflect.jvm.isAccessible

@InternalAPI

object FunctionCaller {
private object NULL

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -37,7 +36,7 @@ abstract class KotlessAzure : AzureRequestHandler {

abstract fun prepare(app: Application)

@InternalAPI

override fun run(
@HttpTrigger(
name = "req",
Expand Down
5 changes: 0 additions & 5 deletions dsl/ktor/ktor-lang-local/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,3 @@ dependencies {
api("io.ktor", "ktor-server-netty", Versions.ktor)
}

tasks.withType<KotlinJvmCompile> {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + listOf("-Xuse-experimental=io.kotless.InternalAPI")
}
}
5 changes: 0 additions & 5 deletions dsl/ktor/ktor-lang-parser/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,3 @@ dependencies {
}


tasks.withType<KotlinJvmCompile> {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + listOf("-Xuse-experimental=io.kotless.InternalAPI")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
5 changes: 0 additions & 5 deletions dsl/spring/spring-boot-lang-local/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,3 @@ dependencies {
}
}

tasks.withType<KotlinJvmCompile> {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + listOf("-Xuse-experimental=io.kotless.InternalAPI")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ abstract class Kotless : RequestStreamHandler {
private var handler: SpringBootLambdaContainerHandler<AwsProxyRequest, AwsProxyResponse>? = null
}

@InternalAPI
override fun handleRequest(input: InputStream, output: OutputStream, context: Context) {
if (!prepared) {
handler = SpringBootLambdaContainerHandler.getAwsProxyHandler(bootKlass.java)
Expand Down
5 changes: 0 additions & 5 deletions dsl/spring/spring-lang-parser/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,3 @@ dependencies {
api(project(":dsl:common:dsl-parser-common"))
}

tasks.withType<KotlinJvmCompile> {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + listOf("-Xuse-experimental=io.kotless.InternalAPI")
}
}
5 changes: 0 additions & 5 deletions engine/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,3 @@ dependencies {
}


tasks.withType<KotlinJvmCompile> {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + listOf("-Xuse-experimental=io.kotless.InternalAPI")
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
8 changes: 5 additions & 3 deletions model/src/main/kotlin/io/kotless/Constants.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
package io.kotless

@InternalAPI
import java.util.Locale


object Constants {
object LocalStack {
const val enabled = "LOCALSTACK_ENABLED"

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 {
Expand Down
1 change: 0 additions & 1 deletion model/src/main/kotlin/io/kotless/Event.kt
Original file line number Diff line number Diff line change
@@ -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"),
Expand Down
2 changes: 1 addition & 1 deletion model/src/main/kotlin/io/kotless/Permission.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ enum class AwsResource(

companion object {
/** Resources that can be created during local start */
@InternalAPI

val forLocalStart = setOf(S3, SSM, DynamoDB)
}
}
Expand Down
1 change: 0 additions & 1 deletion model/src/main/kotlin/io/kotless/utils/Storage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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<Key<*>, Any>()

Expand Down
3 changes: 0 additions & 3 deletions model/src/main/kotlin/io/kotless/utils/TypedStorage.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package io.kotless.utils

import io.kotless.InternalAPI

/** Interface for type-full singleton storage */
@InternalAPI
class TypedStorage<T>(private val storage: MutableMap<Key<T>, T> = HashMap()) {
class Key<T>

Expand Down
Loading

0 comments on commit 0093a03

Please sign in to comment.