-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
92 lines (72 loc) · 2.33 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import org.ajoberstar.grgit.Grgit
group 'tech.macil.minecraft.noneuclid'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'java'
apply plugin: 'net.researchgate.release'
sourceCompatibility = 1.8
repositories {
mavenCentral()
maven { url "https://hub.spigotmc.org/nexus/content/repositories/snapshots/" }
maven { url "http://repo.dmulloy2.net/nexus/repository/public/" }
maven { url "https://repo.codemc.org/repository/maven-public" }
}
dependencies {
implementation('org.bukkit:bukkit:1.12.2-R0.1-SNAPSHOT') {
exclude group: 'junit', module: 'junit'
}
implementation 'org.bstats:bstats-bukkit:1.7'
compileOnly group: "com.comphenix.protocol", name: "ProtocolLib", version: "4.4.0"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.2.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.2.0'
testImplementation 'org.mockito:mockito-core:2.+'
}
test {
useJUnitPlatform()
}
buildscript {
repositories {
jcenter()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
classpath 'org.ajoberstar:gradle-git:1.7.2'
classpath 'net.researchgate:gradle-release:2.6.0'
}
}
if (!project.hasProperty("gitCommitHash")) {
try {
def repo = Grgit.open()
ext.gitCommitHash = repo.head().abbreviatedId
} catch (Exception e) {
println "Error getting commit hash: " + e.getMessage()
}
}
if (!project.hasProperty("gitCommitHash")) {
ext.gitCommitHash = "no_git_id"
}
ext.internalVersion = version + ";" + gitCommitHash
shadowJar {
relocate 'org.bstats', "${project.group}.shadow.org.bstats"
dependencies {
include(dependency('org.bstats:bstats-bukkit'))
}
// don't include version and classifier in jar name
classifier = null
version = null
}
jar.enabled = false
assemble.dependsOn shadowJar
processResources {
inputs.property("version", project.internalVersion)
from(sourceSets.main.resources.srcDirs) {
expand 'internalVersion': project.internalVersion
include 'plugin.yml'
}
from(sourceSets.main.resources.srcDirs) {
exclude 'plugin.yml'
}
}
// Bukkit dependency is always a snapshot version
checkSnapshotDependencies.enabled = false