-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle
99 lines (83 loc) · 2.76 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
apply plugin: "java-library"
apply plugin: "maven-publish"
ext.majorVersion = 2
ext.minorVersion = 5
ext.minecraftVersion = "1.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"
group = "com.meowj"
archivesBaseName = "LangUtils-mc$minecraftVersion"
version = "$majorVersion.$minorVersion.$buildNumber".toString()
sourceCompatibility = 16
targetCompatibility = 16
// extra compile warnings
compileJava {
options.compilerArgs += ["-Xlint:deprecation,unchecked,rawtypes"]
options.encoding = 'UTF-8'
}
// default repositories
repositories {
mavenCentral()
maven { name 'Spigot'; url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
maven { name 'Sonatype'; url 'https://oss.sonatype.org/content/groups/public' }
}
// default dependencies
dependencies {
compileOnly "org.spigotmc:spigot-api:$minecraftVersion-R0.1-SNAPSHOT"
}
// write javadocs to an external folder which can be served via nginx
if (ext.jdDirectory != null) {
javadoc.destinationDir = file("${jdDirectory}/languageutils-${version}")
}
// Source code JAR
task sourcesJar(type: Jar) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
// Javadoc JAR
task javadocJar(type: Jar) {
dependsOn javadoc
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
//noinspection GroovyAssignabilityCheck
processResources {
filesMatching("**/plugin.yml") {
expand 'version': project.version
}
}
publishing {
publications {
defaultPublication(MavenPublication) {
artifactId 'LangUtils'
version "$majorVersion.$minorVersion-SNAPSHOT"
from components.java
artifact sourcesJar
artifact javadocJar
}
}
repositories {
maven {
url "$mavenDirectory"
}
}
}
// options for generating Javadoc
javadoc {
(options as StandardJavadocDocletOptions).with {
links 'https://docs.oracle.com/en/java/javase/16/docs/api/'
links 'https://hub.spigotmc.org/javadocs/spigot/'
links 'https://google.github.io/guava/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')
options.addBooleanOption('html5', true)
windowTitle = "LangUtils Javadoc"
docTitle = "LangUtils (mc$minecraftVersion-${project.version})"
}
}