|
| 1 | +plugins { |
| 2 | + alias(libs.plugins.kotlin.jvm) |
| 3 | + `java-library` |
| 4 | + `maven-publish` |
| 5 | +} |
| 6 | + |
| 7 | +group = "eu.qwsome" |
| 8 | +version = "1.0.0-SNAPSHOT" |
| 9 | +description = "The raw sql builder" |
| 10 | + |
| 11 | +java { |
| 12 | + toolchain { |
| 13 | + languageVersion.set(JavaLanguageVersion.of(21)) |
| 14 | + } |
| 15 | + withSourcesJar() |
| 16 | + withJavadocJar() |
| 17 | +} |
| 18 | + |
| 19 | +kotlin { |
| 20 | + jvmToolchain(21) |
| 21 | +} |
| 22 | + |
| 23 | +repositories { |
| 24 | + mavenCentral() |
| 25 | +} |
| 26 | + |
| 27 | +dependencies { |
| 28 | + implementation(libs.kotlin.stdlib) |
| 29 | + |
| 30 | + testImplementation(libs.junit.jupiter) |
| 31 | + testImplementation(libs.assertj.core) |
| 32 | + testImplementation(libs.jmh.core) |
| 33 | + testAnnotationProcessor(libs.jmh.processor) |
| 34 | +} |
| 35 | + |
| 36 | +sourceSets { |
| 37 | + main { |
| 38 | + kotlin.srcDirs("src/main/kotlin", "src/main/java") |
| 39 | + java.srcDirs("src/main/java") |
| 40 | + } |
| 41 | + test { |
| 42 | + kotlin.srcDirs("src/test/kotlin", "src/test/java") |
| 43 | + java.srcDirs("src/test/java") |
| 44 | + } |
| 45 | +} |
| 46 | + |
| 47 | +tasks.test { |
| 48 | + useJUnitPlatform() |
| 49 | +} |
| 50 | + |
| 51 | +// Configure Kotlin compilation to happen after Java compilation |
| 52 | +tasks.compileKotlin { |
| 53 | + compilerOptions { |
| 54 | + jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21) |
| 55 | + } |
| 56 | +} |
| 57 | + |
| 58 | +tasks.compileTestKotlin { |
| 59 | + compilerOptions { |
| 60 | + jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21) |
| 61 | + } |
| 62 | +} |
| 63 | + |
| 64 | +publishing { |
| 65 | + publications { |
| 66 | + create<MavenPublication>("maven") { |
| 67 | + from(components["java"]) |
| 68 | + |
| 69 | + pom { |
| 70 | + name.set("The raw sql builder") |
| 71 | + description.set("A lightweight SQL query builder library for Java that provides a fluent API for constructing SQL/JPQL/HQL queries") |
| 72 | + url.set("https://github.com/sgflt/sqlbuilder") |
| 73 | + |
| 74 | + scm { |
| 75 | + url.set("https://github.com/sgflt/sqlbuilder.git") |
| 76 | + tag.set("HEAD") |
| 77 | + } |
| 78 | + |
| 79 | + issueManagement { |
| 80 | + system.set("GitHub") |
| 81 | + url.set("https://github.com/sgflt/sqlbuilder/issues") |
| 82 | + } |
| 83 | + |
| 84 | + licenses { |
| 85 | + license { |
| 86 | + name.set("Apache License, Version 2.0") |
| 87 | + url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") |
| 88 | + distribution.set("repo") |
| 89 | + } |
| 90 | + } |
| 91 | + |
| 92 | + developers { |
| 93 | + developer { |
| 94 | + name.set("Lukáš Kvídera") |
| 95 | + email.set("kvideral@qwsome.eu") |
| 96 | + timezone.set("CET") |
| 97 | + } |
| 98 | + } |
| 99 | + } |
| 100 | + } |
| 101 | + } |
| 102 | + |
| 103 | + repositories { |
| 104 | + maven { |
| 105 | + name = "GitHubPackages" |
| 106 | + url = uri("https://maven.pkg.github.com/sgflt/sqlbuilder") |
| 107 | + credentials { |
| 108 | + username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME") |
| 109 | + password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN") |
| 110 | + } |
| 111 | + } |
| 112 | + } |
| 113 | +} |
0 commit comments