-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
59 lines (50 loc) · 1.51 KB
/
build.gradle
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
55
56
57
58
59
plugins {
id 'fabric-loom' version '1.1-SNAPSHOT' apply false
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'java'
}
def getWorkingBranch() {
// Triple double-quotes for the breaklines
def gitBranch = "Unknown branch"
try {
def workingDir = new File("${project.projectDir}")
def result = 'git rev-parse --abbrev-ref HEAD'.execute(null, workingDir)
result.waitFor()
if (result.exitValue() == 0) {
gitBranch = result.text.trim()
}
} catch (e) {
}
gitBranch = gitBranch.equalsIgnoreCase("master") ? "latest" : gitBranch;
return "-" + gitBranch
}
subprojects {
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'com.github.johnrengelman.shadow'
dependencies {
api 'com.google.code.gson:gson:2.8.5'
api 'com.rabbitmq:amqp-client:5.18.0'
compileOnly 'net.luckperms:api:5.4'
compileOnly 'org.apache.logging.log4j:log4j-api:2.19.0'
}
tasks.withType(JavaCompile).tap {
configureEach {
options.encoding = 'UTF-8'
}
}
group = project.pluginGroup
version = project.pluginVersion
build.dependsOn shadowJar
repositories {
mavenCentral()
}
java {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
jar{
archivesBaseName = project.jarName + "-" + project.name + getWorkingBranch()
}
}