-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
117 lines (98 loc) · 3.71 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
import java.nio.charset.StandardCharsets
plugins {
id 'java-library'
id 'maven-publish'
id 'io.papermc.paperweight.userdev' version '1.3.8'
id 'xyz.jpenilla.run-paper' version '1.0.6' // Adds runServer and runMojangMappedServer tasks for testing
}
def minecraftVer = "1.19.2"
group = 'cat.nyaa'
archivesBaseName = "${project.name}-mc$minecraftVer"
def buildNumber = System.getenv('BUILD_NUMBER') == null ? "x" : System.getenv('BUILD_NUMBER')
def mavenDirectory = System.getenv('MAVEN_DIR') == null ? "$projectDir/repo" : System.getenv('MAVEN_DIR')
def jdDirectory = System.getenv('JAVADOCS_DIR') == null ? null : System.getenv('JAVADOCS_DIR')
version = '1.1' + "." + buildNumber
repositories {
mavenCentral()
maven { name 'papermc'; url "https://repo.papermc.io/repository/maven-public/" }
maven { name 'Bugjang'; url 'https://libraries.minecraft.net' }
maven { name 'dmulloy2'; url 'https://repo.dmulloy2.net/content/groups/public/' }
maven { name = 'spigotmc-repo'; url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url = 'https://oss.sonatype.org/content/repositories/central' }
maven { name = 'sonatype'; url = 'https://oss.sonatype.org/content/groups/public/' }
maven { name = 'NyaaCat'; url = 'https://ci.nyaacat.com/maven/' }
//mavenLocal()
}
dependencies {
paperweightDevelopmentBundle("io.papermc.paper:dev-bundle:$minecraftVer-R0.1-SNAPSHOT")
compileOnly(group: "com.comphenix.protocol", name: "ProtocolLib", version: "5.0.0-SNAPSHOT")
// other nyaa plugins
compileOnly('cat.nyaa:nyaacore:9.2.14-SNAPSHOT')
compileOnly 'org.jetbrains:annotations:23.0.0'
//plugin
testImplementation('cat.nyaa:nyaacore:9.2.11-SNAPSHOT')
testImplementation group: "com.comphenix.protocol", name: "ProtocolLib", version: "4.8.0"
//spigot
testImplementation 'org.xerial:sqlite-jdbc:3.39.3.0'
testImplementation 'com.github.seeseemelk:MockBukkit-v1.19:2.122.0'
testImplementation(platform('org.junit:junit-bom:5.9.0'))
testImplementation('org.junit.jupiter:junit-jupiter')
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
withSourcesJar()
withJavadocJar()
}
assemble {
dependsOn(reobfJar)
}
compileJava {
options.compilerArgs += ["-Xlint:deprecation"]
options.encoding = StandardCharsets.UTF_8.name()
options.release.set(17)
}
javadoc {
if (jdDirectory != null) destinationDir = file("${jdDirectory}/${rootProject.name}-${version}")
options.with {
links 'https://docs.oracle.com/en/java/javase/17/docs/api/'
links 'https://hub.spigotmc.org/javadocs/spigot/'
links 'https://guava.dev/releases/21.0/api/docs/'
links 'https://ci.md-5.net/job/BungeeCord/ws/chat/target/apidocs/'
}
options.encoding = 'UTF-8'
options.addBooleanOption('html5', true)
options.addBooleanOption('Xdoclint:none', true)
}
test {
useJUnitPlatform()
}
runServer {
// Configure the Minecraft version for our task.
// This is the only required configuration besides applying the plugin.
// Your plugin's jar (or shadowJar if present) will be used automatically.
minecraftVersion(minecraftVer)
}
processResources {
def props = [version: version]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching('plugin.yml') {
expand props
}
}
reobfJar{
outputJar.set(layout.buildDirectory.file("libs/${project.name}-mc${minecraftVer}-${project.version}.jar"))
}
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
repositories {
maven {
url mavenDirectory
}
}
}