-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathbuild.gradle
More file actions
128 lines (105 loc) · 3.47 KB
/
build.gradle
File metadata and controls
128 lines (105 loc) · 3.47 KB
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
127
128
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'ru.endlesscode.bukkitgradle' version '0.10.1'
id 'com.github.ben-manes.versions' version "0.42.0"
id 'jacoco'
}
group = 'ru.endlesscode.rpginventory'
version = pluginVersion
description = pluginDesc
bukkit {
apiVersion = '1.18.2'
meta {
name.set("RPGInventory")
main.set("${group}.RPGInventoryPlugin")
apiVersion.set("1.14")
authors.set(["osipxd", "EndlessCode Group"])
}
server {
core = "paper"
eula = true
}
}
// Replace sentry credentials in code
def processSources = tasks.register("processSource", Sync) {
// The key should be declared in ~/.gradle/gradle.properties
def dsn = findProperty("rpginvSentryDsn") ?: ""
from(sourceSets.main.java)
inputs.property("dsn", dsn)
filter(ReplaceTokens, tokens: [sentry_dsn: dsn])
into("$buildDir/src")
}
compileJava {
source = processSources.get().outputs
}
repositories {
mavenCentral()
spigot()
dmulloy2()
md5()
placeholderapi()
jitpack()
// You should configure credentials for this repo
def myPetRepo = maven {
name = "githubPackages"
url = uri("https://maven.pkg.github.com/MyPetORG/MyPet")
credentials(PasswordCredentials)
}
exclusiveContent {
forRepositories(myPetRepo)
filter { includeGroup("de.keyle") }
}
}
shadowJar {
dependencies {
exclude(dependency("com.google.code.gson:gson:.*"))
exclude(dependency("org.jetbrains:annotations:.*"))
}
exclude("DebugProbesKt.bin")
exclude("META-INF/proguard/**")
exclude("META-INF/native-image/**")
minimize()
def shadowPackage = "shade.ru.endlesscode.rpginventory"
relocate "com.comphenix.packetwrapper", "${shadowPackage}.packetwrapper"
// inspector
relocate "ru.endlesscode.inspector", "${shadowPackage}.inspector"
relocate "kotlinx", "${shadowPackage}.kotlinx"
relocate "kotlin", "${shadowPackage}.kotlin"
// inspector-sentry-reporter
relocate "io.sentry", "${shadowPackage}.sentry"
// bstats
relocate "org.bstats", "${shadowPackage}.bstats"
}
def inspectorVersion = "0.12.1"
dependencies {
compileOnly(spigotApi())
compileOnly('com.github.MilkBowl:VaultAPI:1.7.1') {
exclude group: 'org.bukkit'
}
compileOnly('com.comphenix.protocol:ProtocolLib:4.8.0')
compileOnly('org.jetbrains:annotations:23.0.0')
compileOnly('me.clip:placeholderapi:2.11.1')
compileOnly('de.keyle:mypet:3.12-SNAPSHOT')
compileOnly('ru.endlesscode.mimic:mimic-bukkit-api:0.8.0')
implementation("ru.endlesscode.inspector:inspector-bukkit:$inspectorVersion")
implementation("ru.endlesscode.inspector:inspector-sentry-reporter:$inspectorVersion")
implementation("ru.endlesscode.inspector:sentry-bukkit:$inspectorVersion")
implementation('com.comphenix.packetwrapper:PacketWrapper:1.13-R0.1-SNAPSHOT')
implementation('org.bstats:bstats-bukkit:3.0.0')
testImplementation('junit:junit:4.13.2')
testImplementation('org.mockito:mockito-core:4.4.0')
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
// Add custom tasks
tasks.assemble.dependsOn tasks.shadowJar
tasks.check.dependsOn tasks.jacocoTestReport
// Add ProGuard minimization task
// TODO: minimized Jar not works, fix it
//apply(from: file("proguard.gradle"))
//apply(from: file("gradle/publish.gradle"))