import java.time.Instant import java.time.ZoneId import java.time.format.DateTimeFormatter plugins { // Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin. alias(libs.plugins.jvm) // Apply the application plugin to add support for building a CLI application in Java. application id("com.google.cloud.tools.jib") version "3.4.4" } project.version = if (project.hasProperty("app.version")) { project.property("app.version").toString() } else { "0.0.1-SNAPSHOT" } repositories { // Use Maven Central for resolving dependencies. mavenCentral() maven { url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") } } jib { to { image = "registry.azw27.de/github-release-bot/github-release-bot" tags = if (project.hasProperty("app.version")) { setOf("v" + project.property("app.version").toString()) } else { setOf("dev-snapshot") } auth { username = if (project.hasProperty("docker.repo.username")) project.property("docker.repo.username").toString() else "" password = if (project.hasProperty("docker.repo.password")) project.property("docker.repo.password").toString() else "" } } container.creationTime.set(DateTimeFormatter.ISO_DATE_TIME.format(Instant.now().atZone(ZoneId.of("UTC")))) val buildDir = layout.buildDirectory.get() outputPaths.imageId = "$buildDir/github-release-bot.id" outputPaths.digest = "$buildDir/github-release-bot.digest" outputPaths.imageJson = "$buildDir/github-release-bot.json" outputPaths.tar = "$buildDir/github-release-bot.tar" } dependencies { implementation("com.ouattararomuald:syndication:2.1.1") { exclude("com.squareup.okhttp3:okhttp") } implementation("com.squareup.okhttp3:okhttp:5.0.0-alpha.12") implementation(libs.guava) implementation("com.google.code.gson:gson:2.10.1") implementation("social.bigbone:bigbone:2.0.0-SNAPSHOT") val kotestVersion = "5.8.1" testImplementation("io.kotest:kotest-runner-junit5:$kotestVersion") testImplementation("io.kotest:kotest-assertions-core:$kotestVersion") testImplementation("com.willowtreeapps.assertk:assertk:0.28.0") testImplementation("io.mockk:mockk:1.13.9") implementation("ch.qos.logback:logback-core:1.5.6") implementation("ch.qos.logback:logback-classic:1.5.6") implementation("org.slf4j:slf4j-api:2.0.13") } // Apply a specific Java toolchain to ease working on different environments. java { toolchain { languageVersion.set(JavaLanguageVersion.of(17)) } } application { // Define the main class for the application. mainClass.set("de.rpr.releases.AppKt") } tasks.named("test") { // Use JUnit Platform for unit tests. useJUnitPlatform() } tasks.withType().configureEach { jvmArgs("--add-opens=java.base/java.util=ALL-UNNAMED") }