build.gradle (2813B)
1 plugins { 2 id("kotlin") 3 id("org.jetbrains.kotlin.plugin.serialization") version "$kotlin_version" 4 } 5 6 version = rootProject.version 7 8 java { 9 sourceCompatibility = JavaVersion.VERSION_17 10 targetCompatibility = JavaVersion.VERSION_17 11 } 12 13 compileKotlin.kotlinOptions.jvmTarget = "17" 14 compileTestKotlin.kotlinOptions.jvmTarget = "17" 15 16 task versionConstant { 17 def outputDir = file("$buildDir/generated/constants") 18 def outputFile = new File(outputDir, "CompileConstants.kt") 19 def programVersion = rootProject.version.toString() 20 21 inputs.property 'programVersion', programVersion 22 outputs.dir outputDir 23 24 doLast { 25 // Ensure output directory exists 26 outputDir.mkdirs() 27 28 // Generate the Kotlin constants file 29 def versionLiteral = groovy.json.JsonOutput.toJson(programVersion).replace('$', '\\$') 30 outputFile.setText(""" 31 package tech.libeufin.common 32 33 val VERSION: String = ${versionLiteral} 34 """.stripIndent(), 'UTF-8') 35 } 36 } 37 38 dokkaGenerateModuleHtml { 39 dependsOn versionConstant 40 } 41 42 clean { 43 delete "$buildDir/generated" 44 } 45 46 47 sourceSets.main.java.srcDirs = ["src/main/kotlin", "$buildDir/generated/constants"] 48 49 50 compileKotlin { 51 dependsOn versionConstant 52 } 53 54 dependencies { 55 implementation("org.slf4j:slf4j-api:2.0.18") 56 // Crypto 57 implementation("org.bouncycastle:bcprov-jdk18on:1.84") 58 implementation("org.bouncycastle:bcpkix-jdk18on:1.84") 59 // Database helper 60 implementation("org.postgresql:postgresql:$postgres_version") 61 implementation("com.zaxxer:HikariCP:7.0.2") 62 63 implementation("io.ktor:ktor-server-core:$ktor_version") 64 implementation("io.ktor:ktor-server-call-logging:$ktor_version") 65 implementation("io.ktor:ktor-server-content-negotiation:$ktor_version") 66 implementation("io.ktor:ktor-server-status-pages:$ktor_version") 67 implementation("io.ktor:ktor-server-cio:$ktor_version") 68 implementation("io.ktor:ktor-serialization-kotlinx-json:$ktor_version") 69 implementation("io.ktor:ktor-server-forwarded-header:$ktor_version") 70 implementation("io.ktor:ktor-serialization-kotlinx-json:$ktor_version") 71 implementation("io.ktor:ktor-server-test-host:$ktor_version") 72 implementation("io.ktor:ktor-server-call-id:$ktor_version") 73 74 // OpenAPI spec generation 75 implementation("io.github.smiley4:ktor-openapi:5.6.0") 76 implementation("io.github.smiley4:schema-kenerator-core:2.6.0") 77 implementation("io.github.smiley4:schema-kenerator-serialization:2.6.0") 78 implementation("io.github.smiley4:schema-kenerator-swagger:2.6.0") 79 80 implementation("com.github.ajalt.clikt:clikt:$clikt_version") 81 82 implementation("org.jetbrains.kotlin:kotlin-test:$kotlin_version") 83 testImplementation("uk.org.webcompere:system-stubs-core:2.1.8") 84 }