1
0
mirror of https://github.com/sciwhiz12/Janitor.git synced 2024-11-14 04:21:25 +00:00
Janitor/build.gradle

72 lines
2.3 KiB
Groovy
Raw Normal View History

2020-08-31 18:15:21 +00:00
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath group: 'org.ajoberstar.grgit', name: 'grgit-gradle', version: grgit_version
classpath group: 'com.github.jengelman.gradle.plugins', name: 'shadow', version: shadow_version
}
}
repositories {
mavenCentral()
jcenter()
maven {
name = "Minecraft Libraries"
url = "https://libraries.minecraft.net"
}
2020-08-31 18:15:21 +00:00
}
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'org.ajoberstar.grgit'
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'maven-publish'
group = 'sciwhiz12.janitor'
archivesBaseName = 'janitor_bot'
version = getVersion()
println("Version: ${version}")
dependencies {
2020-09-17 19:05:56 +00:00
implementation group: 'net.dv8tion', name: 'JDA', version: jda_version
2020-09-08 17:23:28 +00:00
implementation group: 'com.electronwill.night-config', name: 'toml', version: nightconfig_version
implementation group: 'net.sf.jopt-simple', name: 'jopt-simple', version: jopt_version
implementation group: 'com.google.guava', name: 'guava', version: guava_version
implementation group: 'com.google.code.gson', name: 'gson', version: gson_version
implementation group: 'org.apache.logging.log4j', name: 'log4j-to-slf4j', version: log4j_bridge_version
implementation group: 'ch.qos.logback', name: 'logback-classic', version: logback_version
implementation group: 'com.mojang', name: 'brigadier', version: brigadier_version
2020-08-31 18:15:21 +00:00
2020-09-08 17:23:28 +00:00
testImplementation group: 'junit', name: 'junit', version: junit_version
2020-08-31 18:15:21 +00:00
}
application {
mainClassName = 'sciwhiz12.janitor.JanitorBot'
}
task sourcesJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
classifier "sources"
}
jar.finalizedBy('sourcesJar')
jar.finalizedBy('shadowJar')
def getVersion() {
try {
def raw_version = grgit.describe(longDescr: true, tags: true)
def versionSep = raw_version.split "-"
def startVer = versionSep[0].substring(1)
return startVer + "." + versionSep[1]
} catch (Exception e) {
def ver = 'unknown'
if (System.getenv("GITHUB_RUN_NUMBER") != null) ver = System.getenv("GITHUB_RUN_NUMBER")
logger.error("Error getting version information, defaulting to '${ver}': {}", e.getMessage())
return ver
}
}