-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
111 lines (101 loc) · 3.11 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
plugins {
id 'java'
id 'java-library'
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'maven-publish'
}
group = 'org.fastmcmirror'
version = '2.0.0-SNAPSHOT-' + getID()
repositories {
mavenCentral()
maven {
name = 'spigotmc-repo'
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
}
maven {
name = 'sonatype'
url = 'https://oss.sonatype.org/content/groups/public/'
}
maven {
name = 'fastmcmirror-repo'
url = 'https://repo.fastmcmirror.org/content/repositories/releases/'
}
maven {
name = 'codemc-repo'
url = 'https://repo.codemc.org/repository/maven-public/'
}
}
dependencies {
//implementation 'io.github.classgraph:classgraph:4.8.153'
//implementation 'org.burningwave:core:12.62.4'
compileOnly 'org.spigotmc:spigot-api:1.13.2-R0.1-SNAPSHOT'
implementation 'de.tr7zw:item-nbt-api:2.11.1'
implementation 'org.fastmcmirror:yaml:1.3.0'
implementation 'org.reflections:reflections:0.10.2'
//compileOnly 'org.apache.logging.log4j:log4j-slf4j-impl:2.19.0'
}
def targetJavaVersion = 8
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}
tasks.withType(JavaCompile).configureEach {
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release = 8
}
options.encoding = 'UTF-8'
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
processResources {
def props = [version: version]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching('plugin.yml') {
expand props
}
}
shadowJar {
relocate("de.tr7zw.changeme.nbtapi", "org.fastmcmirror.flybuff.libs.nbtapi")
relocate("org.fastmcmirror.yaml", "org.fastmcmirror.flybuff.libs.configuration")
relocate("org.yaml.snakeyaml", "org.fastmcmirror.flybuff.libs.snakeyaml")
relocate("org.reflections", "org.fastmcmirror.flybuff.libs.reflections")
archiveClassifier = ""
}
def String getID() {
Process process = Runtime.getRuntime().exec("git rev-parse --short HEAD")
BufferedReader reader = new BufferedReader(new InputStreamReader(process.inputStream))
String cid = reader.readLine()
if (cid == null) {
println("Failed get commit id")
System.exit(0)
}
println("Commit ID: " + cid)
return cid;
}
publishing {
publications {
maven(MavenPublication) {
groupId "org.fastmcmirror"
artifactId "flybuff-next"
version = this.version
artifact shadowJar
artifact sourcesJar
}
}
repositories {
maven {
url = "https://repo.fastmcmirror.org/content/repositories/releases/"
credentials {
username System.getenv("USERNAME")
password System.getenv("PASSWORD")
}
}
}
}