You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

76 lines
1.9 KiB

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
idea
application
kotlin("jvm") version "1.7.20"
id("com.github.johnrengelman.shadow") version "7.1.2"
id("com.github.gmazzo.buildconfig") version "3.1.0"
}
val commit = runCommand(arrayListOf("git", "rev-parse", "HEAD"))
val changes = runCommand(arrayListOf("git", "diff", "--shortstat"))
group = "xyz.brettb.discord.ieeevents"
version = "${rootProject.findProperty("major")}.${rootProject.findProperty("minor")}.${rootProject.findProperty("patch")}"
application {
mainClass.set("xyz.brettb.discord.ieeevents.IEEEventsKt")
}
buildConfig {
className("IEEEventsBotInfo")
buildConfigField("String", "VERSION", "\"${version}\"")
buildConfigField("String", "COMMIT", "\"$commit\"")
buildConfigField("String", "LOCAL_CHANGES", "\"$changes\"")
buildConfigField("long", "BUILD_TIME", "${System.currentTimeMillis()}L")
}
repositories {
mavenCentral()
maven {
name = "brettb-repo"
url = uri("https://repo.brettb.xyz")
}
maven("https://m2.dv8tion.net/releases") {
name = "m2-dv8tion"
}
}
dependencies {
listOf("stdlib-jdk8", "reflect").forEach { implementation(kotlin(it)) }
implementation("net.dv8tion:JDA:4.4.0_350")
implementation("tech.junodevs.discord:kriess:0.14.0")
implementation("ch.qos.logback:logback-classic:1.4.4")
implementation("org.mnode.ical4j:ical4j:3.2.6")
implementation("com.squareup.okhttp3:okhttp:4.10.0")
// Utilities
implementation("org.yaml:snakeyaml:1.31")
implementation(kotlin("stdlib-jdk8"))
}
tasks.test {
useJUnitPlatform()
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
fun runCommand(commands: List<String>): String {
val stdout = org.apache.commons.io.output.ByteArrayOutputStream()
exec {
commandLine = commands
standardOutput = stdout
}
return stdout.toString("utf-8").trim()
}