163 lines
5.0 KiB
Kotlin
163 lines
5.0 KiB
Kotlin
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
|
import org.jooq.meta.jaxb.Property
|
|
|
|
plugins {
|
|
id("org.springframework.boot") version "3.2.5"
|
|
id("io.spring.dependency-management") version "1.1.4"
|
|
id("org.openapi.generator") version "7.3.0"
|
|
id("nu.studer.jooq") version "9.0"
|
|
id("java")
|
|
}
|
|
|
|
group = "net.moustos"
|
|
version = "0.1.0"
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
// Spring Boot
|
|
implementation("org.springframework.boot:spring-boot-starter-web:3.2.5")
|
|
implementation("org.springframework.boot:spring-boot-starter-data-jpa:3.2.5")
|
|
implementation("org.springframework.boot:spring-boot-starter-security:3.2.5")
|
|
implementation("org.springframework.boot:spring-boot-starter-validation:3.2.5")
|
|
developmentOnly("org.springframework.boot:spring-boot-devtools:3.2.5")
|
|
|
|
// Database
|
|
implementation("org.postgresql:postgresql:42.7.3")
|
|
implementation("org.flywaydb:flyway-core:9.22.3")
|
|
implementation("org.flywaydb:flyway-database-postgresql:9.22.3")
|
|
|
|
// jOOQ
|
|
implementation("org.jooq:jooq:3.19.8")
|
|
implementation("org.jooq:jooq-meta:3.19.8")
|
|
implementation("org.jooq:jooq-codegen:3.19.8")
|
|
jooqGenerator("org.postgresql:postgresql:42.7.3")
|
|
|
|
// Security & JWT
|
|
implementation("com.auth0:java-jwt:4.4.0")
|
|
implementation("at.fageorgetown:jbcrypt:0.9.1")
|
|
implementation("org.springframework.security:spring-security-crypto:6.2.3")
|
|
|
|
// OpenAPI & Swagger
|
|
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.4.0")
|
|
implementation("jakarta.annotation:jakarta.annotation-api:2.1.1")
|
|
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.1")
|
|
|
|
// Logging
|
|
implementation("ch.qos.logback:logback-core:1.5.0")
|
|
implementation("ch.qos.logback:logback-classic:1.5.0")
|
|
implementation("net.logstash.logback:logstash-logback-encoder:7.4")
|
|
|
|
// Utilities
|
|
implementation("org.projectlombok:lombok:1.18.30")
|
|
annotationProcessor("org.projectlombok:lombok:1.18.30")
|
|
implementation("org.apache.commons:commons-lang3:3.14.0")
|
|
implementation("com.google.guava:guava:33.1.0-jre")
|
|
|
|
// Testing
|
|
testImplementation("org.springframework.boot:spring-boot-starter-test:3.2.5")
|
|
testImplementation("org.springframework.security:spring-security-test:6.2.3")
|
|
testImplementation("org.testcontainers:testcontainers:1.19.7")
|
|
testImplementation("org.testcontainers:postgresql:1.19.7")
|
|
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
|
|
testImplementation("org.mockito:mockito-core:5.7.1")
|
|
testImplementation("org.mockito:mockito-junit-jupiter:5.7.1")
|
|
testImplementation("io.rest-assured:rest-assured:5.4.0")
|
|
}
|
|
|
|
java {
|
|
sourceCompatibility = JavaVersion.VERSION_21
|
|
targetCompatibility = JavaVersion.VERSION_21
|
|
}
|
|
|
|
application {
|
|
mainClass.set("net.moustos.mtgsearch.MtgSearchApplication")
|
|
}
|
|
|
|
springBoot {
|
|
buildInfo()
|
|
}
|
|
|
|
// OpenAPI Generator Configuration
|
|
openApiGenerate {
|
|
generatorName.set("spring")
|
|
inputSpec.set("$projectDir/openapi/api.yaml")
|
|
outputDir.set("$projectDir/build/generated")
|
|
apiPackage.set("net.moustos.mtgsearch.api")
|
|
modelPackage.set("net.moustos.mtgsearch.model.api")
|
|
globalProperties.set(mapOf(
|
|
"apis" to "true",
|
|
"models" to "true"
|
|
))
|
|
configOptions.set(mapOf(
|
|
"delegatePattern" to "true",
|
|
"title" to "MTG Search API",
|
|
"interfaceOnly" to "false",
|
|
"skipDefaultInterface" to "false",
|
|
"useSpringBoot3" to "true",
|
|
"useJakartaEe" to "true"
|
|
))
|
|
}
|
|
|
|
// jOOQ Configuration
|
|
jooq {
|
|
configurations {
|
|
create("main") {
|
|
jooqConfiguration.apply {
|
|
jdbc.apply {
|
|
driver = "org.postgresql.Driver"
|
|
url = "jdbc:postgresql://localhost:5432/mtgsearch"
|
|
user = "postgres"
|
|
password = "postgres"
|
|
}
|
|
generator.apply {
|
|
name = "org.jooq.codegen.JavaGenerator"
|
|
database.apply {
|
|
name = "org.jooq.meta.postgres.PostgresDatabase"
|
|
inputSchema = "public"
|
|
}
|
|
target.apply {
|
|
packageName = "net.moustos.mtgsearch.jooq.generated"
|
|
directory = "$projectDir/build/generated/jooq"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.register("generateJooqCode") {
|
|
dependsOn("jooqCodegen")
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
java {
|
|
srcDirs(
|
|
"src/main/java",
|
|
"$buildDir/generated/src/main/java",
|
|
"$buildDir/generated/jooq"
|
|
)
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.compileJava {
|
|
dependsOn("openApiGenerate", "generateJooqCode")
|
|
}
|
|
|
|
tasks.test {
|
|
useJUnitPlatform()
|
|
testLogging {
|
|
events("passed", "skipped", "failed")
|
|
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
|
|
showStandardStreams = false
|
|
}
|
|
}
|
|
|
|
tasks.named("build") {
|
|
dependsOn("openApiGenerate", "generateJooqCode")
|
|
}
|