-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
110 lines (95 loc) · 2.61 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
plugins {
java
`maven-publish`
id("de.chojo.publishdata") version "1.2.4"
id("net.minecrell.plugin-yml.bukkit") version "0.5.3"
id("com.github.johnrengelman.shadow") version "7.1.2"
}
group = "de.eldoria"
version = "1.0.0"
repositories {
mavenCentral()
maven("https://eldonexus.de/repository/maven-public/")
maven("https://eldonexus.de/repository/maven-proxies/")
}
java {
withSourcesJar()
withJavadocJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
publishData {
useEldoNexusRepos()
addBuildData()
publishComponent("java")
}
dependencies {
compileOnly("org.spigotmc", "spigot-api", "1.16.5-R0.1-SNAPSHOT")
implementation("de.eldoria", "eldo-util", "1.14.4")
bukkitLibrary("net.kyori", "adventure-platform-bukkit", "4.1.2")
bukkitLibrary("net.kyori", "adventure-text-minimessage", "4.10.1")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1")
}
publishing {
publications.create<MavenPublication>("maven") {
publishData.configurePublication(this)
}
repositories {
maven {
authentication {
credentials(PasswordCredentials::class) {
username = System.getenv("NEXUS_USERNAME")
password = System.getenv("NEXUS_PASSWORD")
}
}
name = "EldoNexus"
url = uri(publishData.getRepository())
}
}
}
tasks {
compileJava {
options.encoding = "UTF-8"
}
compileTestJava {
options.encoding = "UTF-8"
}
shadowJar {
val shadebase = "de.eldoria.betterplugins."
relocate("de.eldoria.eldoutilities", shadebase + "eldoutilities")
mergeServiceFiles()
}
register<Copy>("copyToServer") {
val path = project.property("targetDir") ?: "";
if (path.toString().isEmpty()) {
println("targetDir is not set in gradle properties")
return@register
}
from(shadowJar)
destinationDir = File(path.toString())
}
build {
dependsOn(shadowJar)
}
test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
}
bukkit {
name = "BetterPlugins"
main = "de.eldoria.betterplugins.BetterPlugins"
website = ""
apiVersion = "1.19"
version = rootProject.version.toString()
authors = listOf("RainbowdashLabs")
commands {
register("betterplugins") {
aliases = listOf("plugins", "bp")
}
}
}