-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle.kts
127 lines (111 loc) · 3.45 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
plugins {
id("org.cadixdev.licenser") version "0.6.1"
id("com.github.johnrengelman.shadow") version "8.1.1"
java
`maven-publish`
`java-library`
id("de.chojo.publishdata") version "1.4.0"
}
group = "de.eldoria"
version = "2.5.3"
var mainPackage = "bigdoorsopener"
val shadebade = group as String? + "." + mainPackage + "."
val name = "BigDoorsOpener"
description = "Open and close doors automatically on certain conditions"
repositories {
maven("https://eldonexus.de/repository/maven-public/")
maven("https://eldonexus.de/repository/maven-proxies/")
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
maven("https://mvn.lumine.io/repository/maven-public/")
}
dependencies {
implementation("de.eldoria", "eldo-util", "1.14.5")
implementation("net.kyori", "adventure-api", "4.17.0")
implementation("net.kyori", "adventure-platform-bukkit", "4.3.4")
compileOnly("org.spigotmc", "spigot-api", "1.13.2-R0.1-SNAPSHOT")
compileOnly("org.jetbrains", "annotations", "24.1.0")
compileOnly("com.sk89q.worldguard", "worldguard-bukkit", "7.0.9") {
exclude("org.spigotmc", "spigot-api")
exclude("com.sk89q.worldedit.worldedit-libs", "core")
}
compileOnly("me.clip", "placeholderapi", "2.11.6")
compileOnly("nl.pim16aap2", "BigDoors", "0.1.8.46")
compileOnly("io.lumine", "Mythic-Dist", "5.6.2")
testImplementation("org.junit.jupiter", "junit-jupiter-api", "5.11.0")
}
license {
header(rootProject.file("HEADER.txt"))
include("**/*.java")
}
java {
withSourcesJar()
withJavadocJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
publishData {
addBuildData()
useEldoNexusRepos()
publishComponent("java")
}
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 {
processResources {
from(sourceSets.main.get().resources.srcDirs) {
filesMatching("plugin.yml") {
expand(
"name" to "BigDoorsOpener",
"version" to publishData.getVersion(true),
"description" to project.description
)
}
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
}
compileJava {
options.encoding = "UTF-8"
}
shadowJar {
relocate("de.eldoria.eldoutilities", shadebade + "eldoutilities")
relocate("net.kyori", shadebade + "kyori")
mergeServiceFiles()
minimize()
archiveClassifier.set("all")
archiveBaseName.set("BigDoorsOpener")
}
test {
useJUnit()
testLogging {
events("passed", "skipped", "failed")
}
}
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)
}
}