-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
57 lines (48 loc) · 1.72 KB
/
build.gradle
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
plugins {
id 'java-library'
}
group 'org.powernukkit.plugins'
version '0.1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.powernukkit:powernukkit:1.6.0.1-PN'
}
///////////////////////////////////////////////////////////////////
// Some fancy functions to allow you to debug your plugin easily //
// Just run ./gradlew run -q to run PowerNukkit with your plugin //
// Or execute the "debug" task in debug mode with your IDE //
///////////////////////////////////////////////////////////////////
task debug(type: JavaExec, dependsOn: 'createDebugJar') {
group = "Execution"
description = "Run PowerNukkit with your plugin in debug mode (without Watchdog Thread)"
classpath = sourceSets.main.runtimeClasspath
main = 'cn.nukkit.Nukkit'
workingDir = 'run'
systemProperties = ['file.encoding': 'UTF-8', disableWatchdog: true]
standardInput = System.in
}
task run(type: JavaExec, dependsOn: 'createDebugJar') {
group = "Execution"
description = "Run PowerNukkit with your plugin"
classpath = sourceSets.main.runtimeClasspath
main = 'cn.nukkit.Nukkit'
workingDir = 'run'
systemProperties = ['file.encoding': 'UTF-8']
standardInput = System.in
}
task createDebugJar(type: Jar, dependsOn: classes) {
group = "Execution"
description = "Creates a fake jar to make PowerNukkit load your plugin directly from the compiled classes"
from(sourceSets.main.output.resourcesDir) {
include('plugin.yml')
include('nukkit.yml')
}
destinationDirectory.set(file('run/plugins'))
archiveBaseName.set('__plugin_loader')
archiveExtension.set('jar')
archiveAppendix.set('')
archiveClassifier.set('')
archiveVersion.set('')
}