Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Kotlin to 1.5.10 #49

Merged
merged 1 commit into from
Jun 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ allprojects {
repositories {
mavenCentral()
}
}

subprojects {
apply<JacocoPlugin>()

jacoco {
toolVersion = Versions.jacoco
}
Expand Down Expand Up @@ -61,7 +57,7 @@ val jacocoAggregateReport by tasks.creating(JacocoReport::class) {
listOf("scala", "kotlin").map { project.buildDir.path + "/classes/$it/main" }
}))
additionalSourceDirs(files(subprojects.flatMap { project ->
listOf("scala", "kotlin").map { project.file("src/main/$it").absolutePath }
listOf("scala", "kotlin", "kotlin-2.11", "kotlin-2.12-2.13").map { project.file("src/main/$it").absolutePath }
}))
dependsOn(jacocoAggregateMerge)
}
Expand Down
8 changes: 4 additions & 4 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
@Suppress("ObjectPropertyName")
object Versions {
const val kotlin = "1.3.70"
const val kotlin = "1.5.10"
const val scalaBinary = "2.13"
const val lagom = "1.6.1" // "1.4.13"
const val ktlint = "0.32.0"
const val `ktlint-plugin` = "8.0.0"
const val ktlint = "0.41.0"
const val `ktlint-plugin` = "10.1.0"
const val `kotlin-logging` = "1.6.10"
const val swagger = "2.0.7"
const val jacoco = "0.8.4"
const val jacoco = "0.8.7"
const val junit5 = "5.3.2"
const val assertj = "3.11.1"
const val `json-unit` = "2.6.1"
Expand Down
4 changes: 3 additions & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ configurations {
ktlint {
version.set(Versions.ktlint)
outputToConsole.set(true)
reporters.set(setOf(ReporterType.CHECKSTYLE))
reporters {
reporter(ReporterType.CHECKSTYLE)
}
}

tasks.withType<Test> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ private val OAuthFlow.passwordModel: ModelOAuthFlow? get() = common?.tokenUrl(to

private fun OAuthFlows.isEmpty() =
authorizationCode.isEmpty() &&
clientCredentials.isEmpty() &&
implicit.isEmpty() &&
password.isEmpty() &&
extensions.isNullOrEmpty()
clientCredentials.isEmpty() &&
implicit.isEmpty() &&
password.isEmpty() &&
extensions.isNullOrEmpty()

private val OAuthFlows?.model: ModelOAuthFlows? get() = when {
this == null || this.isEmpty() -> null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ data class ClassLevelInfo(
val tags: List<Tag>,
val servers: List<Server>,
val externalDocumentation: ExternalDocumentation?
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ data class LagomCallInfo(val method: Method, val path: String, val httpMethod: S
val hidden = method.getAnnotationInherited(Hidden::class.java)
return operation == null || operation.hidden || hidden != null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ package org.taymyr.lagom.internal.openapi
data class LagomServiceInfo(
val service: Class<*>,
val calls: List<LagomCallInfo>
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,16 @@ object OperationMethodProcessor {
else ModelRequestBody()
.description(requestBody.description.ifBlank { null })
.required(if (requestBody.required) requestBody.required else null)
.content(AnnotationsUtils.getContent(
requestBody.content,
null,
null,
null,
spec.components,
null
).orElse(null))
.content(
AnnotationsUtils.getContent(
requestBody.content,
null,
null,
null,
spec.components,
null
).orElse(null)
)
.`$ref`(requestBody.ref.ifBlank { null })
)

Expand Down Expand Up @@ -113,14 +115,16 @@ object OperationMethodProcessor {
response.responseCode to ModelApiResponse()
.description(response.description)
.headers(AnnotationsUtils.getHeaders(response.headers, null).orElse(null))
.content(AnnotationsUtils.getContent(
response.content,
null,
null,
null,
spec.components,
null
).orElse(null))
.content(
AnnotationsUtils.getContent(
response.content,
null,
null,
null,
spec.components,
null
).orElse(null)
)
.`$ref`(response.ref.ifBlank { null })
.apply {
links = AnnotationsUtils.getLinks(response.links).ifEmpty { null }
Expand All @@ -140,8 +144,10 @@ object OperationMethodProcessor {
operation.deprecated(annotation.deprecated.takeIf { annotation.deprecated })
operation.externalDocs(
AnnotationsUtils.getExternalDocumentation(annotation.externalDocs)
.orElse(AnnotationsUtils.getExternalDocumentation(classInfo.externalDocumentation)
.orElse(null))
.orElse(
AnnotationsUtils.getExternalDocumentation(classInfo.externalDocumentation)
.orElse(null)
)
)
processParameters(annotation.parameters, spec, operation)
processRequestBody(annotation.requestBody, spec, operation)
Expand All @@ -167,4 +173,4 @@ object OperationMethodProcessor {
.operation(PathItem.HttpMethod.valueOf(call.httpMethod), operation)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ open class SpecGenerator(protected val spec: OpenAPI = OpenAPI()) {
service.calls.forEach { OperationMethodProcessor.process(it, classInfo, spec) }
return spec
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ fun jsonToYaml(json: String?): String? = try {
json?.let { yamlMapper.writeValueAsString(jsonMapper.readValue(it, Any::class.java)) }
} catch (e: IOException) {
null
}
}
4 changes: 3 additions & 1 deletion java/api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ dependencies {
ktlint {
version.set(Versions.ktlint)
outputToConsole.set(true)
reporters.set(setOf(ReporterType.CHECKSTYLE))
reporters {
reporter(ReporterType.CHECKSTYLE)
}
}

val sourcesJar by tasks.creating(Jar::class) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ class LagomError {
fun getName() = ""
@Schema(description = "Exception detail message")
fun getDetail() = ""
}
}
4 changes: 3 additions & 1 deletion java/impl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ configurations {
ktlint {
version.set(Versions.ktlint)
outputToConsole.set(true)
reporters.set(setOf(ReporterType.CHECKSTYLE))
reporters {
reporter(ReporterType.CHECKSTYLE)
}
}

tasks.withType<Test> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ internal class SpecGenerator(spec: OpenAPI = OpenAPI()) : SpecGenerator(spec) {
} catch (t: Throwable) {
throw IllegalStateException(
"""Unable to resolve method for service call.
Ensure that the you have passed a method reference (ie, this::someMethod). Passing anything else,
for example lambdas, anonymous classes or actual implementation classes, is forbidden in declaring a
service descriptor.""".trimIndent(), t
Ensure that the you have passed a method reference (ie, this::someMethod). Passing anything else,
for example lambdas, anonymous classes or actual implementation classes, is forbidden in declaring a
service descriptor.
""".trimIndent(),
t
)
}
}
Expand Down Expand Up @@ -75,4 +77,4 @@ internal class SpecGenerator(spec: OpenAPI = OpenAPI()) : SpecGenerator(spec) {
)

fun generate(service: Service): OpenAPI = generate(parseServiceInfo(service))
}
}