-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
77 lines (65 loc) · 1.68 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
import org.ajoberstar.grgit.Grgit
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'org.ajoberstar:grgit:1.7.0'
}
}
plugins {
id 'ninja.miserable.blossom' version '1.0.1'
id 'com.github.johnrengelman.shadow' version '2.0.4'
id 'java'
}
defaultTasks 'clean', 'build'
sourceCompatibility = 1.8
configurations {
shade
compile.extendsFrom(shade)
}
version = "0.2.0-pre"
blossom {
replaceToken('@spongeVersion@', version)
}
def buildNumber = ""
ext {
//代码来自插件ebi中的build.gradle → : https://github.com/euOnmyoji/EpicBanItem---Sponge
//noinspection GrDeprecatedAPIUsage 不会用新版
git = Grgit.open(file(".git"))
parents = git.head().parentIds
index = 0// Offset to match CI
while (parents != null && !parents.isEmpty()) {
parents = git.getResolve().toCommit(parents.get(0)).getParentIds()
index++
}
//noinspection GrReassignedInClosureLocalVar
buildNumber = "${index}"
}
version = "${version}-b${buildNumber}"
group 'com.github.euonmyoji.yysscoreboard'
repositories {
mavenCentral()
maven {
name = 'sponge'
url = 'https://repo.spongepowered.org/maven'
}
maven { url = 'https://jitpack.io' }
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
dependencies {
compileOnly 'org.spongepowered:spongeapi:7.1.0'
compileOnly 'com.github.rojo8399:PlaceholderAPI:master-SNAPSHOT'
shade 'org.bstats.bStats-Metrics:bstats-sponge:1.4'
}
shadowJar() {
configurations = [project.configurations.compile]
from sourceSets.main.output
classifier = ""
}
artifacts {
archives shadowJar
}