build.gradle.kts
paperless-backend/build.gradle.kts
1plugins {2 kotlin("jvm") version "2.3.21"3 kotlin("plugin.spring") version "2.3.21"4 kotlin("plugin.jpa") version "2.3.21"5 id("org.springframework.boot") version "4.1.1"6 id("io.spring.dependency-management") version "1.1.7"7 id("org.openapi.generator") version "7.11.0"8 kotlin("kapt") version "2.3.21"9}1011group = "at.fhtw.swen3"12version = "0.0.2-SNAPSHOT"1314java {15 toolchain {16 languageVersion.set(JavaLanguageVersion.of(25))17 }18}192021repositories {22 mavenCentral()23}2425dependencies {26 implementation("org.springframework.boot:spring-boot-h2console")27 implementation("org.springframework.boot:spring-boot-starter-data-jpa")28 implementation("org.springframework.boot:spring-boot-starter-flyway")29 implementation("org.springframework.boot:spring-boot-starter-security")30 implementation("org.springframework.boot:spring-boot-starter-oauth2-resource-server")31 implementation("org.springframework.boot:spring-boot-starter-validation")32 implementation("org.springframework.boot:spring-boot-starter-webmvc")33 implementation("org.jetbrains.kotlin:kotlin-reflect")34 implementation("org.jetbrains.kotlin:kotlin-stdlib")35 implementation("tools.jackson.module:jackson-module-kotlin")36 implementation("org.mapstruct:mapstruct:1.6.3")3738 implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:3.1.1")39 implementation("org.openapitools:jackson-databind-nullable:0.2.6")4041 developmentOnly("org.springframework.boot:spring-boot-devtools")42 runtimeOnly("com.h2database:h2")43 runtimeOnly("org.flywaydb:flyway-database-postgresql")44 runtimeOnly("org.postgresql:postgresql")4546 kapt("org.springframework.boot:spring-boot-configuration-processor")47 kapt("org.mapstruct:mapstruct-processor:1.6.3")4849 testImplementation("org.springframework.boot:spring-boot-starter-data-jpa-test")50 testImplementation("org.springframework.boot:spring-boot-starter-security-test")51 testImplementation("org.springframework.boot:spring-boot-starter-validation-test")52 testImplementation("org.springframework.boot:spring-boot-starter-webmvc-test")53 testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")54 testImplementation(kotlin("test"))55}5657kotlin {58 compilerOptions {59 freeCompilerArgs.addAll("-Xjsr305=strict", "-Xannotation-default-target=param-property")60 }61 sourceSets {62 main {63 kotlin.srcDir(layout.buildDirectory.dir("generated/openapi/src/main/kotlin"))64 }65 }66}6768allOpen {69 annotation("jakarta.persistence.Entity")70 annotation("jakarta.persistence.MappedSuperclass")71 annotation("jakarta.persistence.Embeddable")72}7374openApiGenerate {75 generatorName.set("kotlin-spring")76 inputSpec.set("$projectDir/src/main/resources/openapi.yaml")77 outputDir.set(layout.buildDirectory.dir("generated/openapi").get().asFile.path)78 apiPackage.set("at.fhtw.swen3.paperless.api")79 modelPackage.set("at.fhtw.swen3.paperless.dto")80 configOptions.set(81 mapOf(82 "interfaceOnly" to "true",83 "useSpringBoot3" to "true",84 "useBeanValidation" to "true",85 "enumPropertyNaming" to "UPPERCASE",86 "openApiNullable" to "false",87 "useTags" to "true"88 )89 )90}9192tasks.named("compileKotlin") {93 dependsOn("openApiGenerate")94}9596tasks.matching { it.name == "kaptGenerateStubsKotlin" }.configureEach {97 dependsOn("openApiGenerate")98}99100tasks.withType<Test> {101 useJUnitPlatform()102}103