2024-02-12 09:35:31 +01:00
|
|
|
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
|
2024-11-21 11:49:50 +01:00
|
|
|
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"
|
2024-02-12 09:35:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
// Use Maven Central for resolving dependencies.
|
|
|
|
mavenCentral()
|
|
|
|
maven {
|
|
|
|
url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
jib {
|
2024-11-21 11:49:50 +01:00
|
|
|
to {
|
2024-11-22 08:59:13 +01:00
|
|
|
image = "${project.property("registry.fqdn")}/github-release-bot/github-release-bot"
|
2024-11-21 11:49:50 +01:00
|
|
|
|
|
|
|
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 ""
|
|
|
|
}
|
|
|
|
}
|
2024-02-12 09:35:31 +01:00
|
|
|
container.creationTime.set(DateTimeFormatter.ISO_DATE_TIME.format(Instant.now().atZone(ZoneId.of("UTC"))))
|
|
|
|
|
|
|
|
val buildDir = layout.buildDirectory.get()
|
2024-02-12 09:39:06 +01:00
|
|
|
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"
|
2024-02-12 09:35:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
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")
|
|
|
|
|
2024-03-11 10:35:50 +01:00
|
|
|
val kotestVersion = "5.8.1"
|
|
|
|
testImplementation("io.kotest:kotest-runner-junit5:$kotestVersion")
|
|
|
|
testImplementation("io.kotest:kotest-assertions-core:$kotestVersion")
|
2024-02-12 09:35:31 +01:00
|
|
|
testImplementation("com.willowtreeapps.assertk:assertk:0.28.0")
|
|
|
|
testImplementation("io.mockk:mockk:1.13.9")
|
2024-07-26 10:25:20 +02:00
|
|
|
|
|
|
|
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")
|
2024-02-12 09:35:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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>("test") {
|
|
|
|
// Use JUnit Platform for unit tests.
|
|
|
|
useJUnitPlatform()
|
|
|
|
}
|
2024-02-12 15:14:59 +01:00
|
|
|
|
|
|
|
tasks.withType<Test>().configureEach {
|
|
|
|
jvmArgs("--add-opens=java.base/java.util=ALL-UNNAMED")
|
|
|
|
}
|