Skip to content

Commit

Permalink
wip: gradle multimodules
Browse files Browse the repository at this point in the history
  • Loading branch information
SMILEY4 committed May 2, 2024
1 parent b481795 commit 96dd726
Show file tree
Hide file tree
Showing 101 changed files with 148 additions and 919 deletions.
9 changes: 0 additions & 9 deletions HowToRelease.md

This file was deleted.

177 changes: 60 additions & 117 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,136 +1,79 @@
import com.vanniktech.maven.publish.SonatypeHost
import io.gitlab.arturbosch.detekt.Detekt

object Meta {
const val groupId = "io.github.smiley4"
const val artifactId = "ktor-swagger-ui"
const val version = "3.0.0-indev"
const val name = "Ktor Swagger-UI"
const val description = "Ktor plugin to document routes and provide Swagger UI"
const val licenseName = "The Apache License, Version 2.0"
const val licenseUrl = "https://www.apache.org/licenses/LICENSE-2.0.txt"
const val scmUrl = "https://github.com/SMILEY4/ktor-swagger-ui"
const val scmConnection = "scm:git:git://github.com/SMILEY4/ktor-swagger-ui.git"
const val developerName = "smiley4"
const val developerUrl = "https://github.com/SMILEY4"
}

group = Meta.groupId
version = Meta.version

plugins {
kotlin("jvm") version "1.8.21"
kotlin("plugin.serialization") version "1.8.21"
id("org.owasp.dependencycheck") version "8.2.1"
id("com.vanniktech.maven.publish") version "0.25.2"
id("io.gitlab.arturbosch.detekt") version "1.23.0"
}

repositories {
mavenCentral()
mavenLocal()
maven(url = "https://raw.githubusercontent.com/glureau/json-schema-serialization/mvn-repo")
}

dependencies {

val ktorVersion = "2.3.7"
implementation("io.ktor:ktor-server-core-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-webjars:$ktorVersion")
implementation("io.ktor:ktor-server-auth:$ktorVersion")
implementation("io.ktor:ktor-server-resources:$ktorVersion")
testImplementation("io.ktor:ktor-server-netty-jvm:$ktorVersion")
testImplementation("io.ktor:ktor-server-content-negotiation:$ktorVersion")
testImplementation("io.ktor:ktor-serialization-jackson:$ktorVersion")
testImplementation("io.ktor:ktor-server-auth:$ktorVersion")
testImplementation("io.ktor:ktor-server-call-logging:$ktorVersion")
testImplementation("io.ktor:ktor-server-test-host:$ktorVersion")

val swaggerUiVersion = "5.9.0" // this version must match the version declared in the code (SwaggerPlugin#SWAGGER_UI_WEBJARS_VERSION)
implementation("org.webjars:swagger-ui:$swaggerUiVersion")

val swaggerParserVersion = "2.1.19"
implementation("io.swagger.parser.v3:swagger-parser:$swaggerParserVersion")

val schemaKeneratorVersion = "0.1"
implementation("io.github.smiley4:schema-kenerator-core:$schemaKeneratorVersion")
implementation("io.github.smiley4:schema-kenerator-reflection:$schemaKeneratorVersion")
implementation("io.github.smiley4:schema-kenerator-swagger:$schemaKeneratorVersion")

val jacksonVersion = "2.15.3"
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:${jacksonVersion}")

val kotlinLoggingVersion = "3.0.5"
implementation("io.github.microutils:kotlin-logging-jvm:$kotlinLoggingVersion")

val logbackVersion = "1.4.11"
testImplementation("ch.qos.logback:logback-classic:$logbackVersion")

val versionMockk = "1.13.8"
testImplementation("io.mockk:mockk:$versionMockk")
subprojects {

val versionKotest = "5.8.0"
testImplementation("io.kotest:kotest-runner-junit5:$versionKotest")
testImplementation("io.kotest:kotest-assertions-core:$versionKotest")
val ktorSwaggerUiVersion: String by project
val ktorSwaggerUiGroupId: String by project
group = ktorSwaggerUiGroupId
version = ktorSwaggerUiVersion

val versionKotlinTest = "1.8.21"
testImplementation("org.jetbrains.kotlin:kotlin-test:$versionKotlinTest")
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "io.gitlab.arturbosch.detekt")
apply(plugin = "org.owasp.dependencycheck")

testImplementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0")
testImplementation("com.github.Ricky12Awesome:json-schema-serialization:0.9.9")
testImplementation("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
}

kotlin {
jvmToolchain(11)
}
repositories {
mavenLocal()
mavenCentral()
}

tasks.withType<Test>().configureEach {
useJUnitPlatform()
}
dependencies {}

detekt {
buildUponDefaultConfig = true
allRules = false
config.setFrom("$projectDir/config/detekt.yml")
baseline = file("$projectDir/config/baseline.xml")
}
kotlin {
jvmToolchain(11)
}

tasks.withType<Detekt>().configureEach {
reports {
html.required.set(true)
md.required.set(true)
xml.required.set(false)
txt.required.set(false)
sarif.required.set(false)
tasks.withType<Test>().configureEach {
useJUnitPlatform()
}
}

mavenPublishing {
publishToMavenCentral(SonatypeHost.S01)
signAllPublications()
coordinates(Meta.groupId, Meta.artifactId, Meta.version)
pom {
name.set(Meta.name)
description.set(Meta.description)
url.set(Meta.scmUrl)
licenses {
license {
name.set(Meta.licenseName)
url.set(Meta.licenseUrl)
distribution.set(Meta.licenseUrl)
}
}
scm {
url.set(Meta.scmUrl)
connection.set(Meta.scmConnection)
}
developers {
developer {
id.set(Meta.developerName)
name.set(Meta.developerName)
url.set(Meta.developerUrl)
}
tasks.withType<Detekt>().configureEach {
ignoreFailures = true // todo: temporary
buildUponDefaultConfig = true
allRules = false
config.setFrom("$projectDir/config/detekt.yml")
baseline.set(file("$projectDir/config/baseline.xml"))
reports {
html.required.set(true)
md.required.set(true)
xml.required.set(false)
txt.required.set(false)
sarif.required.set(false)
}
}

}

//mavenPublishing {
// publishToMavenCentral(SonatypeHost.S01)
// signAllPublications()
// coordinates(Meta.groupId, Meta.artifactId, Meta.version)
// pom {
// name.set(Meta.name)
// description.set(Meta.description)
// url.set(Meta.scmUrl)
// licenses {
// license {
// name.set(Meta.licenseName)
// url.set(Meta.licenseUrl)
// distribution.set(Meta.licenseUrl)
// }
// }
// scm {
// url.set(Meta.scmUrl)
// connection.set(Meta.scmConnection)
// }
// developers {
// developer {
// id.set(Meta.developerName)
// name.set(Meta.developerName)
// url.set(Meta.developerUrl)
// }
// }
// }
//}
Loading

0 comments on commit 96dd726

Please sign in to comment.