-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
138 lines (121 loc) · 4.33 KB
/
build.gradle.kts
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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import java.net.URI
plugins {
`java-library`
id("com.github.johnrengelman.shadow") version "8.1.1"
idea
`maven-publish`
signing
}
group = "dev.aurelium"
version = project.property("projectVersion") as String
repositories {
mavenCentral()
maven("https://jitpack.io")
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://oss.sonatype.org/content/repositories/snapshots")
maven("https://repo.helpch.at/releases/")
maven("https://repo.codemc.io/repository/maven-public/")
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
}
dependencies {
api("org.spongepowered:configurate-yaml:4.1.2") {
exclude("org.yaml", "snakeyaml")
}
api("net.kyori:adventure-text-minimessage:4.16.0")
api("net.kyori:adventure-platform-bukkit:4.3.2")
compileOnly("io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT")
compileOnly("me.clip:placeholderapi:2.11.6")
compileOnly("com.mojang:authlib:1.5.25")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.2")
}
configurations.all {
exclude("org.yaml", "snakeyaml")
}
tasks.withType<ShadowJar> {
val projectVersion: String by project
exclude("plugin.yml")
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
tasks {
javadoc {
title = "Slate API (${project.version})"
source = sourceSets.main.get().allSource
classpath = files(sourceSets.main.get().compileClasspath)
options {
(this as CoreJavadocOptions).addStringOption("Xdoclint:none", "-quiet")
overview("javadoc/overview.html")
encoding("UTF-8")
charset("UTF-8")
}
}
build {
dependsOn(shadowJar)
dependsOn(javadoc)
}
}
idea {
module {
isDownloadSources = true
isDownloadJavadoc = true
}
}
java {
withJavadocJar()
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_17
}
if (project.hasProperty("sonatypeUsername") && project.hasProperty("sonatypePassword")) {
publishing {
repositories {
maven {
val releasesRepoUrl = URI.create("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsRepoUrl = URI.create("https://s01.oss.sonatype.org/content/repositories/snapshots/")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
credentials {
username = project.property("sonatypeUsername").toString()
password = project.property("sonatypePassword").toString()
}
}
}
publications.create<MavenPublication>("mavenJava") {
groupId = "dev.aurelium"
artifactId = "slate"
version = project.version.toString()
pom {
name.set("Slate")
description.set("API for building user-configurable GUI menus")
url.set("https://wiki.aurelium.dev/slate")
licenses {
license {
name.set("The GNU General Public License, Version 3.0")
url.set("https://www.gnu.org/licenses/gpl-3.0.en.html")
}
}
developers {
developer {
id.set(project.property("developerId").toString())
name.set(project.property("developerUsername").toString())
email.set(project.property("developerEmail").toString())
url.set(project.property("developerUrl").toString())
}
}
scm {
connection.set("scm:git:git://github.com/Archy-X/Slate.git")
developerConnection.set("scm:git:git://github.com/Archy-X/Slate.git")
url.set("https://github.com/Archy-X/Slate/tree/master")
}
}
from(components["java"])
}
}
signing {
useGpgCmd()
sign(publishing.publications.getByName("mavenJava"))
isRequired = true
}
}