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
|
2022-03-12 12:17:33 +01:00
|
|
|
|
2022-03-12 15:24:57 +01:00
|
|
|
id("com.github.johnrengelman.shadow") version "7.1.2"
|
2022-01-28 02:06:45 +01:00
|
|
|
}
|
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 15:40:06 +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()
|
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-03-12 12:24:54 +01:00
|
|
|
errorOutput = OutputStream.nullOutputStream()
|
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 {
|
2022-03-12 15:24:57 +01:00
|
|
|
attributes("Implementation-Title" to project.name,
|
|
|
|
"Implementation-Version" to project.version,
|
|
|
|
"Main-Class" to "de.jotoho.waituntil.Main"
|
2022-03-12 03:13:30 +01:00
|
|
|
//"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-03-12 03:13:30 +01:00
|
|
|
//mainModule.set("de.jotoho.waituntil.main")
|
2021-09-02 17:04:56 +02:00
|
|
|
}
|