forked from nrstirzaker/MinecraftPluginTemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
68 lines (46 loc) · 1.36 KB
/
build.gradle
File metadata and controls
68 lines (46 loc) · 1.36 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
apply plugin: 'java'
apply plugin: 'idea'
group 'com.foundrysoftware.minecraft.plugins'
version '1.0-SNAPSHOT'
def SERVER_LOC = 'C:\\Users\\euanv\\Documents\\Minecraft Python\\Minecraft Tools\\server'
def SERVER_PLUGIN_LOC = SERVER_LOC + '\\plugins'
def FULL_JAR_NAME = rootProject.name + "-" + version+".jar"
repositories {
mavenCentral()
}
dependencies {
implementation 'org.jetbrains:annotations:19.0.0'
testCompile group: 'junit', name: 'junit', version: '4.12'
compile group: 'javax.validation',name: 'validation-api', version: '2.0.0.Final'
compile fileTree(dir: 'lib', include: '*.jar')
}
task copyJar(type:Copy){
from "$buildDir/libs/" + FULL_JAR_NAME
into SERVER_PLUGIN_LOC
}
task copyConfig(type:Copy){
from "$buildDir/resources/main/" + "plugin.yml"
into SERVER_PLUGIN_LOC + "/" + rootProject.name
}
task runServer(type:Exec){
doFirst {
println "Starting server..."
workingDir = file(SERVER_LOC)
commandLine = ['cmd', '/C', 'start', 'start-1-15-2.bat']
}
}
task deploy() {
dependsOn build
dependsOn copyJar
dependsOn copyConfig
doLast {
println 'Copied " + FULL_JAR_NAME + " to: ' + SERVER_PLUGIN_LOC
}
}
task deployAndRun() {
dependsOn deploy
dependsOn runServer
doLast {
println 'Deployed " + FULL_JAR_NAME + " to: ' + SERVER_PLUGIN_LOC
}
}