-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
54 lines (43 loc) · 1.14 KB
/
build.gradle
File metadata and controls
54 lines (43 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '7.0.0'
}
group 'ga.guacaplushy.RandomBotJava'
version '1.1.3'
def GitCommitHash() {
def gitFolder = "$projectDir/.git/"
def takeFromHash = 6
def head = new File(gitFolder + "HEAD").text.split(":") // .git/HEAD
def isCommit = head.length == 1
if(isCommit) return head[0].trim().take(takeFromHash) // e5a7c79edabb
def refHead = new File(gitFolder + head[1].trim()) // .git/refs/heads/master
refHead.text.trim().take takeFromHash
}
repositories {
mavenCentral()
maven {
name 'm2-dv8tion'
url 'https://m2.dv8tion.net/releases'
}
}
dependencies {
implementation 'net.dv8tion:JDA:4.3.0_280'
implementation group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.29'
implementation 'com.google.code.gson:gson:2.8.7'
}
jar {
manifest {
attributes(
'Main-Class': 'ga.guacaplushy.RandomBotJava.Main'
)
}
}
shadowJar {
archiveBaseName.set("RandomBot-Java")
archiveVersion.set("")
archiveClassifier.set(GitCommitHash())
}
jar.enabled = false
build {
dependsOn = ['shadowJar']
}