forked from NyaaCat/PlayTimeTracker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
120 lines (106 loc) · 3.88 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
plugins {
id 'java-library'
id 'maven-publish'
id("xyz.jpenilla.run-paper") version "1.0.6"
}
// Plugin config
ext.pluginName = "PlayTimeTracker"
ext.pluginname = ext.pluginName.toLowerCase()
ext.majorVersion = 0
ext.minorVersion = 7
ext.minecraftVersion = "1.18.1"
sourceCompatibility = 17
targetCompatibility = 17
// Supplied by Jenkins
ext.buildNumber = System.env.BUILD_NUMBER == null ? "x" : "$System.env.BUILD_NUMBER"
ext.mavenDirectory = System.env.MAVEN_DIR == null ? "$projectDir/repo" : "$System.env.MAVEN_DIR"
ext.jdDirectory = System.env.JAVADOCS_DIR == null ? null : "$System.env.JAVADOCS_DIR"
// Version used for distribution. Different from maven repo
group = "cat.nyaa"
archivesBaseName = "${pluginName}-mc$minecraftVersion"
version = "$majorVersion.$minorVersion.$buildNumber".toString()
runServer {
minecraftVersion("1.18.1")
}
repositories {
mavenCentral()
//'Spigot';
maven { 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 {url = 'https://repo.extendedclip.com/content/repositories/placeholderapi/'}
maven { name 'Sonatype'; url 'https://oss.sonatype.org/content/groups/public' }
maven { name "essentialsx-releases"; url "https://repo.essentialsx.net/releases/"}
maven { name "papermc"; url "https://papermc.io/repo/repository/maven-public/"}
maven { name 'NyaaCat'; url 'https://ci.nyaacat.com/maven/' }
}
dependencies {
compileOnly "org.spigotmc:spigot-api:$minecraftVersion-R0.1-SNAPSHOT"
compileOnly 'net.essentialsx:EssentialsX:2.19.0'
compileOnly 'me.clip:placeholderapi:2.11.1'
compileOnly 'com.udojava:EvalEx:2.7'
compileOnly 'org.xerial:sqlite-jdbc:3.36.0.3'
compileOnly 'com.zaxxer:HikariCP:5.0.1'
// other nyaa plugins
if (gradle.hasProperty("useLocalDependencies") && gradle.useLocalDependencies) {
compileOnly project(":NyaaCore")
} else {
compileOnly('cat.nyaa:nyaacore:9.0-SNAPSHOT') { transitive = true }
}
compileOnly 'org.jetbrains:annotations:22.0.0'
}
compileJava {
options.compilerArgs += ["-Xlint:deprecation"]
options.encoding = 'UTF-8'
}
task sourcesJar(type: Jar) {
archiveClassifier.set('sources')
from sourceSets.main.java.srcDirs
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
if (ext.jdDirectory != null) {
javadoc.destinationDir = file("${jdDirectory}/${pluginname}-${version}")
}
processResources { // modify version string
filesMatching("**/plugin.yml") {
expand 'version': project.version
}
}
publishing {
publications {
mavenJava(MavenPublication) {
group project.group
artifactId pluginname
version "$majorVersion.$minorVersion-SNAPSHOT"
from components.java
artifact sourcesJar
artifact javadocJar
}
}
repositories {
maven {
url mavenDirectory
}
}
}
javadoc {
(options as StandardJavadocDocletOptions).with {
links 'https://docs.oracle.com/en/java/javase/14/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/'
locale 'en_US'
encoding 'UTF-8'
docEncoding 'UTF-8'
addBooleanOption('keywords', true)
addStringOption('Xdoclint:none', '-quiet')
if (JavaVersion.current() > JavaVersion.VERSION_1_9) {
options.addBooleanOption('html5', true)
}
windowTitle = "${pluginName} Javadoc"
docTitle = "${pluginName} (mc$minecraftVersion-${project.version})"
}
}