-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
126 lines (103 loc) · 3.26 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
plugins {
id "java"
id "com.github.johnrengelman.shadow" version "8.0.0"
id "net.kyori.blossom" version "1.3.1"
}
defaultTasks 'processResources', 'clean', 'shadowJar', 'build'
group = 'dev.sergivos'
version = '1.0.0-SNAPSHOT'
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
compileJava {
options.encoding = "UTF-8"
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
repositories {
mavenCentral()
maven {
name = 'papermc-repo'
url = 'https://papermc.io/repo/repository/maven-public/'
}
maven {
name = 'sonatype'
url = 'https://oss.sonatype.org/content/groups/public/'
}
}
jar {
duplicatesStrategy = 'include'
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
ext {
getCurrentShortRevision = {
new ByteArrayOutputStream().withStream { os ->
exec {
executable = "git"
args = ["rev-parse", "HEAD"]
standardOutput = os
}
return os.toString().trim().substring(0, 8)
}
}
def buildNumber = System.getenv("BUILD_NUMBER") ?: "unknown"
if (project.version.endsWith("-SNAPSHOT")) {
customVer = "${project.version} (git-${project.ext.getCurrentShortRevision()}-b${buildNumber})".toString()
} else {
customVer = "${project.version}".toString()
}
compilationDate = new Date()
}
javadoc {
source = sourceSets.main.allJava
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
blossom {
replaceToken("{version}", version)
replaceToken("{detailedVersion}", project.ext.customVer)
replaceToken("{compilationDate}", project.ext.compilationDate)
}
processResources {
expand([
version : version,
detailedVersion: project.ext.customVer,
compilationDate: project.ext.compilationDate
])
}
processResources.outputs.upToDateWhen { false }
dependencies {
implementation 'io.netty:netty-buffer:4.1.89.Final'
//compile 'com.github.luben:zstd-jni:1.4.9-5'
implementation 'io.nats:jnats:2.16.8'
implementation 'redis.clients:jedis:4.3.1'
implementation 'com.google.guava:guava:31.1-jre'
compileOnly 'com.destroystokyo.paper:paper-api:1.16.5-R0.1-SNAPSHOT'
annotationProcessor 'org.checkerframework:checker:3.30.0'
compileOnly 'org.apache.logging.log4j:log4j-core:2.19.0'
compileOnly 'org.slf4j:slf4j-api:2.0.6'
}
shadowJar {
archiveClassifier.set('')
minimize()
mergeServiceFiles()
relocate 'io.netty', 'dev.sergivos.messaging.libs.netty'
relocate 'io.nats', 'dev.sergivos.messaging.libs.nats'
relocate 'redis.clients', 'dev.sergivos.messaging.libs.redis'
relocate 'org.apache', 'dev.sergivos.messaging.libs.apache'
relocate 'com.google', 'dev.sergivos.messaging.libs.guava'
exclude 'META-INF/*.txt'
exclude 'META-INF/maven/**'
exclude 'org/slf4j/**'
exclude 'org/checkerframework/checker/**'
exclude 'net/i2p/**'
}
tasks.register("dev", Copy) {
dependsOn(shadowJar)
from layout.buildDirectory.dir("libs/Messaging-1.0.0-SNAPSHOT.jar")
into "C:\\Users\\Sergi\\Desktop\\MC_117\\plugins"
}