-
Notifications
You must be signed in to change notification settings - Fork 47
/
build.gradle
184 lines (153 loc) · 5.61 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
plugins {
id 'java-library'
id "io.papermc.paperweight.userdev" version "2.0.0-beta.8"
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '7.0.0'
id 'org.ajoberstar.grgit' version '5.2.2'
}
ext {
// Supplied by Jenkins
buildNumber = System.env.BUILD_NUMBER == null ? "x" : "$System.env.BUILD_NUMBER"
mavenDirectory = System.env.MAVEN_DIR == null ? "$projectDir/repo" : "$System.env.MAVEN_DIR"
jdDirectory = System.env.JAVADOCS_DIR == null ? null : "$System.env.JAVADOCS_DIR"
}
group = "cat.nyaa"
archivesBaseName = "${PLUGIN_NAME}-mc${MINECRAFT_VERSION}"
version = "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-$ext.buildNumber" as String
sourceCompatibility = 21
targetCompatibility = 21
repositories {
mavenCentral()
//maven { name 'Spigot'; url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
maven { name 'paper'; url 'https://repo.papermc.io/repository/maven-public/' }
maven { name 'enginehub'; url 'https://maven.enginehub.org/repo/' }
maven { name 'vault-repo'; url 'https://jitpack.io' }
maven { name 'NyaaCat'; url 'https://ci.nyaacat.com/maven/' }
maven {
url = 'https://repo.extendedclip.com/content/repositories/placeholderapi/'
}
maven { url 'https://mvn.lumine.io/repository/maven-public/' }
}
shadowJar {
configurations = [project.configurations.shadow]
}
dependencies {
//Residence integration, download the jar(also CMI) manually as the fucking Residence author is lazy
implementation fileTree(dir: 'libs', includes: ['*.jar'])
paperweight.paperDevBundle("$MINECRAFT_VERSION-R0.1-SNAPSHOT")
compileOnly 'io.lumine:Mythic-Dist:5.7.1'
compileOnly 'me.clip:placeholderapi:2.11.6'
// other nyaa plugins
compileOnly('cat.nyaa:nyaacore:9.4') { transitive = false }
//3rd
//compileOnly group: "com.comphenix.protocol", name: "ProtocolLib", version: "4.7.0"
compileOnly 'org.jetbrains:annotations:23.0.0'
compileOnly 'io.netty:netty-all:4.1.81.Final' // netty is shadowed inside spigot jar
compileOnly 'org.ow2.asm:asm:9.3'
compileOnly 'net.bytebuddy:byte-buddy:1.12.16'
//shadow 'net.bytebuddy:byte-buddy:1.12.16'
compileOnly 'com.udojava:EvalEx:2.7'
implementation('com.sk89q.worldguard:worldguard-core:7.0.8-SNAPSHOT')
implementation('com.sk89q.worldguard:worldguard-bukkit:7.0.8-SNAPSHOT') {
exclude group: 'io.papermc', module: 'paperlib'
exclude group: 'org.bstats', module: 'bstats-bukkit'
exclude group: 'org.bukkit', module: 'bukkit'
}
implementation 'com.google.code.findbugs:jsr305:3.0.2'
implementation('com.github.MilkBowl:VaultAPI:1.7.1')
//test
testImplementation(platform('org.junit:junit-bom:5.9.0'))
testImplementation('org.junit.jupiter:junit-jupiter:5.9.0')
}
processResources {
def props = [version : version,
pluginName: PLUGIN_NAME]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching('plugin.yml') {
expand props
}
}
task sourcesJar(type: Jar) {
archiveClassifier.set('sources')
from sourceSets.main.java.srcDirs
}
// javadoc generation options
javadoc {
// javadoc output folder
if (project.jdDirectory != null) destinationDir = file("${jdDirectory}/${PLUGIN_NAME.toLowerCase()}-${version}")
(options as StandardJavadocDocletOptions).with {
links 'https://docs.oracle.com/en/java/javase/21/docs/api/'
//links 'https://hub.spigotmc.org/javadocs/spigot/'
links 'https://guava.dev/releases/21.0/api/docs/'
//links 'https://ci.nyaacat.com/javadocs/nyaacore-7.1.350/' //need update
links 'https://ci.md-5.net/job/BungeeCord/ws/chat/target/apidocs/'
links 'https://netty.io/4.1/api/'
options.locale 'en_US'
options.encoding 'UTF-8'
options.docEncoding 'UTF-8'
options.addBooleanOption('keywords', true)
options.addStringOption('Xdoclint:none', '-quiet')
if (JavaVersion.current() > JavaVersion.VERSION_1_9) {
options.addBooleanOption('html5', true)
}
windowTitle = "${PLUGIN_NAME} Javadoc"
docTitle = "${PLUGIN_NAME} (mc$MINECRAFT_VERSION-${project.version})"
}
}
jar {
archiveClassifier.set('core')
dependsOn shadowJar
}
shadowJar {
archiveClassifier.set('release')
// relocate 'net.sf.cglib', 'cat.nyaa.cglib'
configurations = [project.configurations.shadow]
}
task apiJar(type: Jar) {
includeEmptyDirs = false
from sourceSets.main.output.classesDirs
include('**/think/rpgitems/RPGItems.class')
include('**/think/rpgitems/Events.class')
include('**/think/rpgitems/api/')
include('**/think/rpgitems/item/')
include('**/think/rpgitems/power/')
include('**/think/rpgitems/event/')
include('**/think/rpgitems/utils/')
exclude('**/think/rpgitems/power/impl/')
}
// javadoc jar
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set("javadoc")
from javadoc.destinationDir
}
// extra compile warnings
compileJava {
// options.compilerArgs += ["-Xlint:deprecation"]
options.encoding = 'UTF-8'
}
// maven publish
publishing {
publications {
mavenJava(MavenPublication) {
group project.group
artifactId PLUGIN_NAME.toLowerCase()
version "$MAJOR_VERSION.$MINOR_VERSION-SNAPSHOT"
from components.java
artifact sourcesJar
artifact javadocJar
artifact apiJar
}
}
repositories {
maven {
url mavenDirectory
}
}
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}