-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
239 lines (201 loc) · 7.77 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "com.github.jengelman.gradle.plugins:shadow:6.1.0"
}
}
plugins {
id 'idea'
id 'java-library'
id 'maven-publish'
}
apply plugin: "com.github.johnrengelman.shadow"
group 'br.com.finalcraft'
version '2.0.4'
targetCompatibility = 1.8
sourceCompatibility = 1.8
compileJava.options.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
javadoc {
options.encoding = 'UTF-8'
}
//This might keep function(parameter variable's Names) on the compiled jar
compileJava.options.compilerArgs.add '-parameters'
compileTestJava.options.compilerArgs.add '-parameters'
repositories {
flatDir { //Change this to where are your local libs
dirs 'C:/Users/Petrus/Desktop/Meus/workshop/workshop/MyOwnPlugins/Bukkit/FinalCraftCore/libs'
dirs 'C:/Users/Petrus/Desktop/Meus/workshop/workshop/PublicLibs'
dirs 'C:/Users/Petrus/Desktop/Meus/workshop/workshop/PublicLibs/Bukkit'
}
mavenCentral()
maven {
name = 'spigotmc-repo'
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots'
}
maven { url = "https://jitpack.io" }
maven { url = "https://maven.petrus.dev/public" }
maven {
url = 'https://repo.alessiodp.com/releases/'//For the custom libby-core
}
maven {
name = "CodeMC"
url = uri("https://repo.codemc.io/repository/maven-public/")
}
}
dependencies {
compileOnly 'org.spigotmc:spigot-api:1.19.2-R0.1-SNAPSHOT'
implementation project(':modules:VersionedPlugins')
implementation project(':modules:v1_7_10')
implementation project(':modules:v1_12_2')
implementation project(':modules:v1_16_5')
implementation "br.com.finalcraft:ChatMenuAPI:2.0.1"
implementation 'net.byteflux:libby-core:1.2.0'
implementation 'dev.triumphteam:triumph-gui:3.1.4-evernife-02'
implementation 'com.github.Carleslc.Simple-YAML:Simple-Yaml:1.8.4'
implementation "br.com.finalcraft:ECForgeListener:1.0.5"
//NBT-API
implementation("de.tr7zw:item-nbt-api:2.13.2")
//END of NBT-API
implementation 'net.md-5:bungeecord-chat:1.16-R0.1' //This works from 1.7.10 onwards, is the same API
compileOnly('org.hibernate:hibernate-core:5.4.30.Final')
compileOnly name: "AuthMe-5.4.0"
compileOnly 'net.luckperms:api:5.4'
// @ DISCLAIMER @ //
// @ DISCLAIMER @ //
compileOnly name: "EverForgeLib-[1.7.10]"
// This is a private jar, if you want to compile EverNifeCore you need to remove the folders that use this jar
// @ DISCLAIMER @ //
// @ DISCLAIMER @ //
compileOnly name: "griefdefender-bukkit-2.2.1"
compileOnly name: "GriefPreventionPlus-13.3"
compileOnly name: "PlaceholderAPI-2.11.2"
compileOnly name: "worldguard-bukkit-6.2.2" //Prior to 1.12
compileOnly name: "worldedit-bukkit-6.0" //Prior to 1.12
compileOnly name: "Vault-1.6.7"
compileOnly name: "FeatherBoard-4.28.1" //This is a paid plugin, you need to buy it in order to build this project
compileOnly name: "BossShopPro-v1.9.8" //This WAS a paid plugin, (you need to buy it in order to build this project)~I Think
compileOnly name: "MVdWPlaceholderAPI"
compileOnly name: "ProtocolLib"
compileOnly name: "craftbukkit1710" //Thats on you to find out
compileOnly name: "craftbukkit1122" //Thats on you to find out
compileOnly name: "craftbukkit1165" //Thats on you to find out
compileOnly name: "craftbukkit1201" //Thats on you to find out
compileOnly name: "craftbukkit1202" //Thats on you to find out
compileOnly group: 'commons-io', name: 'commons-io', version: '2.6' //Necessary for ReflectionUtils
api 'org.jetbrains:annotations:23.0.0'
api group: 'org.apache.commons', name: 'commons-lang3', version: '3.0'
//JUnit
testImplementation group: 'junit', name: 'junit', version: '4.12'
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1")
//Lombok
compileOnly 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
testCompileOnly 'org.projectlombok:lombok:1.18.24'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.24'
//Jabel (allows to use Java 17 features)
annotationProcessor 'com.github.bsideup.jabel:jabel-javac-plugin:0.4.2'
compileOnly 'com.github.bsideup.jabel:jabel-javac-plugin:0.4.2'
//Logging
implementation 'org.apache.logging.log4j:log4j-api:2.20.0'
implementation 'org.apache.logging.log4j:log4j-core:2.20.0'
}
configure([tasks.compileJava]) {
sourceCompatibility = 16 // for the IDE support
options.release = 8
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(17)
}
}
ext.getCallingTask = { ->
gradle.startParameter.taskNames.size() == 0
? ""
: gradle.startParameter.taskNames.get(0)
}
shadowJar {
archiveName = "${baseName}-${version}.${extension}"
dependencies {
include(dependency('br.com.finalcraft:ChatMenuAPI:'))
include(dependency('net.byteflux:libby-core:'))
include(dependency('dev.triumphteam:triumph-gui:'))
include(dependency('de.tr7zw:item-nbt-api:')) //Oct 26, 2023
include(dependency('br.com.finalcraft:ECForgeListener:'))
include(project(':modules:VersionedPlugins'))
include(project(':modules:v1_7_10'))
include(project(':modules:v1_12_2'))
include(project(':modules:v1_16_5'))
}
if (getCallingTask().equals("publish")){
println "[Shadowing ExtraJars for Maven Publish]"
dependencies {
include(dependency('com.github.Carleslc.Simple-YAML:Simple-Yaml:'))
}
relocate 'org.yaml.snakeyaml', 'br.com.finalcraft.libs.snakeyaml'
}
relocate 'de.tr7zw.changeme.nbtapi', 'br.com.finalcraft.libs.nbtapi'
relocate 'dev.triumphteam.gui', 'br.com.finalcraft.libs.triumphteam.gui'
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def fullName = details.requested.group + ":" + details.requested.name;
if (fullName.equals("de.tr7zw:functional-annotations")){
details.useTarget("com.github.EverNife:functional-annotations:d26a567")
}
}
}
java {
// withJavadocJar()
// withSourcesJar()
if (getCallingTask().equals("publish")){
println "[Appending SourcesJar]"
withSourcesJar()
}
}
jar {
enabled = false //Disable default jar, only shadow jar will be created
dependsOn(shadowJar { classifier = null })
}
tasks.withType(GenerateModuleMetadata) {
enabled = false
}
test {
useJUnitPlatform()
}
publishing {
repositories {
maven {
name = "PetrusRepo"
url = "https://maven.petrus.dev/public"
credentials {
username = System.env.PETRUSMAVEN_ACTOR
password = System.env.PETRUSMAVEN_TOKEN
}
authentication {
basic(BasicAuthentication)
}
}
}
publications {
petrus(MavenPublication) {
groupId = project.group
from(components.java)
pom.withXml {
asNode().appendNode('url','https://petrus.dev')
asNode().dependencies.'*'.each() {
it.parent().remove(it) //Remove all dependencies from pom file
}
/* this does not work, sad :D
def repositoriesNode = asNode().appendNode('repositories')
def repositoryNode = repositoriesNode.appendNode('repository')
repositoryNode.appendNode('id', 'jitpack.io')
repositoryNode.appendNode('url', 'https://jitpack.io')
*/
}
}
}
}