2022-01-28 02:06:45 +01:00
|
|
|
import java.io.ByteArrayOutputStream
|
|
|
|
import java.io.OutputStream
|
|
|
|
|
2021-09-02 17:04:56 +02:00
|
|
|
plugins {
|
|
|
|
// Apply the application plugin to add support for building a CLI application in Java.
|
|
|
|
application
|
2022-01-28 02:06:45 +01:00
|
|
|
java
|
|
|
|
}
|
2021-09-19 22:13:22 +02:00
|
|
|
|
2022-01-28 02:06:45 +01:00
|
|
|
repositories {
|
|
|
|
// Use Maven Central for resolving dependencies.
|
|
|
|
mavenCentral()
|
2021-09-02 17:04:56 +02:00
|
|
|
}
|
|
|
|
|
2022-03-12 01:58:05 +01:00
|
|
|
dependencies {
|
2022-03-12 03:12:58 +01:00
|
|
|
implementation(group="commons-cli", name="commons-cli", version="1.5.0")
|
2022-03-12 01:58:05 +01:00
|
|
|
}
|
|
|
|
|
2022-01-02 18:33:17 +01:00
|
|
|
fun versionBanner(): String {
|
2022-01-28 02:06:45 +01:00
|
|
|
val os = ByteArrayOutputStream()
|
|
|
|
val devNull = OutputStream.nullOutputStream()
|
2022-01-02 18:33:17 +01:00
|
|
|
project.exec {
|
2022-01-28 02:06:45 +01:00
|
|
|
commandLine = "git describe --tags --always --dirty --abbrev".split(" ")
|
2022-01-02 18:33:17 +01:00
|
|
|
standardOutput = os
|
2022-01-28 02:06:45 +01:00
|
|
|
errorOutput = devNull
|
2022-01-02 18:33:17 +01:00
|
|
|
}
|
|
|
|
return String(os.toByteArray()).trim()
|
|
|
|
}
|
|
|
|
|
2021-09-19 19:23:45 +02:00
|
|
|
group = "de.jotoho"
|
2022-01-02 18:33:17 +01:00
|
|
|
version = versionBanner()
|
2021-09-19 19:23:45 +02:00
|
|
|
|
2021-09-05 21:12:28 +02:00
|
|
|
java {
|
2021-12-01 12:30:21 +01:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
|
|
targetCompatibility = JavaVersion.VERSION_17
|
2021-09-05 21:12:28 +02:00
|
|
|
}
|
|
|
|
|
2021-09-19 22:13:22 +02:00
|
|
|
tasks.jar {
|
|
|
|
manifest {
|
|
|
|
attributes(
|
2022-01-02 18:32:46 +01:00
|
|
|
"Implementation-Title" to project.name,
|
|
|
|
"Implementation-Version" to project.version,
|
|
|
|
"Main-Class" to "de.jotoho.waituntil.Main",
|
|
|
|
"Main-Module" to "de.jotoho.waituntil.main"
|
2021-09-19 22:13:22 +02:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-02 17:04:56 +02:00
|
|
|
application {
|
|
|
|
// Define the main class for the application.
|
2021-12-01 14:36:07 +01:00
|
|
|
mainClass.set("de.jotoho.waituntil.Main")
|
2022-01-02 18:32:46 +01:00
|
|
|
mainModule.set("de.jotoho.waituntil.main")
|
2021-09-02 17:04:56 +02:00
|
|
|
}
|