|
| 1 | +plugins { |
| 2 | + application |
| 3 | + id("com.ncorti.ktfmt.gradle") |
| 4 | + kotlin("kapt") |
| 5 | + kotlin("jvm") |
| 6 | +} |
| 7 | + |
| 8 | +group = "ac.at.uibk.dps.projectname" |
| 9 | + |
| 10 | +version = |
| 11 | + providers |
| 12 | + .fileContents(rootProject.layout.projectDirectory.file("version.txt")) |
| 13 | + .asText |
| 14 | + .get() |
| 15 | + .trim() |
| 16 | + |
| 17 | +application { |
| 18 | + mainClass.set("at.ac.uibk.dps.projectname.ProjectNameKt") |
| 19 | + applicationName = "projectname" |
| 20 | +} |
| 21 | + |
| 22 | +java { toolchain { languageVersion.set(JavaLanguageVersion.of(25)) } } |
| 23 | + |
| 24 | +ktfmt { googleStyle() } |
| 25 | + |
| 26 | +dependencies { |
| 27 | + implementation(project(":buildinfo")) |
| 28 | + implementation(project(":lib")) |
| 29 | + |
| 30 | + implementation(kotlin("stdlib-jdk8")) |
| 31 | + |
| 32 | + // Logging |
| 33 | + implementation("io.github.oshai:kotlin-logging-jvm:8.0.4") |
| 34 | + implementation("ch.qos.logback:logback-classic:1.5.34") |
| 35 | + |
| 36 | + // Dagger |
| 37 | + implementation("com.google.dagger:dagger:2.59.2") |
| 38 | + kapt("com.google.dagger:dagger-compiler:2.59.2") |
| 39 | + |
| 40 | + // Guava |
| 41 | + implementation("com.google.guava:guava:33.6.0-jre") |
| 42 | + |
| 43 | + // JUnit |
| 44 | + testImplementation(platform("org.junit:junit-bom:5.11.0")) |
| 45 | + testImplementation("org.junit.jupiter:junit-jupiter") |
| 46 | + testImplementation("org.junit-pioneer:junit-pioneer:2.3.0") |
| 47 | +} |
| 48 | + |
| 49 | +repositories { |
| 50 | + mavenCentral() |
| 51 | + gradlePluginPortal() |
| 52 | +} |
| 53 | + |
| 54 | +tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach { |
| 55 | + compilerOptions { jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_25) } |
| 56 | +} |
| 57 | + |
| 58 | +tasks.named("compileKotlin") { dependsOn(tasks.named("ktfmtFormat")) } |
| 59 | + |
| 60 | +tasks.named<Test>("test") { useJUnitPlatform() } |
| 61 | + |
| 62 | +tasks.named<Zip>("distZip") { archiveFileName.set("projectname.zip") } |
| 63 | + |
| 64 | +tasks.withType<Jar>().configureEach { |
| 65 | + manifest { |
| 66 | + attributes( |
| 67 | + mapOf( |
| 68 | + "Main-Class" to "at.ac.uibk.dps.projectname.ProjectNameKt", |
| 69 | + "Implementation-Version" to project.version.toString(), |
| 70 | + "Enable-Native-Access" to "ALL-UNNAMED", |
| 71 | + ) |
| 72 | + ) |
| 73 | + } |
| 74 | +} |
0 commit comments