-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.gradle
More file actions
87 lines (67 loc) · 2.11 KB
/
build.gradle
File metadata and controls
87 lines (67 loc) · 2.11 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// Gradle / Project setup
// ---------------------------------------------------------
plugins {
id 'java'
// Generates the plugin.yml, allows easier access to common plugin libraries, and facilitates the test server tasks.
id 'kr.entree.spigradle' version '2.4.2'
// Allows us to shade libraries into the build plugin.
id 'com.github.johnrengelman.shadow' version '5.2.0'
}
repositories {
mavenCentral()
jitpack()
spigotmc()
sonatype()
papermc()
}
dependencies {
compileOnly spigot(project.property('mcVersion'))
compileOnly paper(project.property('mcVersion'))
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
testImplementation 'com.github.seeseemelk:MockBukkit-v1.19:2.29.0'
}
test {
useJUnitPlatform()
testLogging {
events 'passed', 'skipped', 'failed'
}
}
task cleanAll {
dependsOn 'clean'
dependsOn 'cleanDebug'
dependsOn 'cleanSpigotBuild'
}
// Compilation variables / tasks
// ---------------------------------------------------------
compileJava {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
// Shading
// ---------------------------------------------------------
tasks.build.dependsOn(shadowJar)
tasks.prepareSpigotPlugins.dependsOn(shadowJar)
shadowJar {
// This is required to prevent Spigradle from attempting to look for an incorrectly named file during debug.
classifier = ''
// relocate 'old.path.lib', "${project.property('group')}.lib"
}
// Plugin variables / tasks
// ---------------------------------------------------------
group = project.property('group')
version = project.property('version')
description = project.property('description')
spigot {
name = project.property('name')
authors = project.property('authors').split(/(,\s*|\s+)/)
apiVersion = project.property('apiVersion')
load = STARTUP
debug {
eula = true
buildVersion = project.property('mcVersion')
args = project.property('debugServerArgs').split(/(,\s*|\s+)/)
// This caused issues with the debugPaper task
// jvmArgs = project.property('debugServerJvmArgs').split(/(,\s*|\s+)/)
}
}