-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
66 lines (57 loc) · 1.6 KB
/
build.gradle.kts
File metadata and controls
66 lines (57 loc) · 1.6 KB
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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
java
alias(libs.plugins.shadowJar)
alias(libs.plugins.lombok)
alias(libs.plugins.runPaper)
}
repositories {
mavenCentral()
}
fun Project.getSubProjectJars(): List<TaskProvider<ShadowJar>> {
return listOf(
project(":PotatoEssentials").tasks.shadowJar,
project(":PotatoDiscordLink").tasks.shadowJar
)
}
tasks {
register<Copy>("serverDevelopment") {
from(getSubProjectJars())
into("\\\\192.168.1.46\\dev\\plugins") // Change this to wherever you want your jar to build
}
register<Copy>("serverProduction") {
from(getSubProjectJars())
into("\\\\192.168.1.46\\event\\plugins")
}
build {
dependsOn("copyShadowJars")
}
jar.configure {
enabled = false
}
runServer {
minecraftVersion("1.21.11")
pluginJars.setFrom(getSubProjectJars())
}
runPaper.detectPluginJar = false
register<Copy>("copyShadowJars") {
dependsOn(subprojects.map { it.tasks.shadowJar })
val destinationDir = layout.buildDirectory.dir("libs").get().asFile
from(subprojects.map {
it.tasks.named<ShadowJar>("shadowJar").map { task ->
task.archiveFile.get().asFile
}
})
into(destinationDir)
}
}
lombok.disableConfig = true
subprojects {
apply(plugin = "java")
apply(plugin = "com.gradleup.shadow")
apply(plugin = "io.freefair.lombok")
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
}
}