@@ -9,7 +9,8 @@ import java.nio.file.Files
9
9
import java.nio.file.Path
10
10
11
11
class RunConfiguration {
12
- private static final String DEBUG_ARGS = " -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
12
+ private static
13
+ final String DEBUG_ARGS = " -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
13
14
14
15
private Project project
15
16
@@ -27,11 +28,11 @@ class RunConfiguration {
27
28
this . eula = false
28
29
this . onlineMode = false
29
30
this . debug = true
30
- this . encoding = " UTF-8"
31
- this . dir = " server"
31
+ this . encoding = ' UTF-8'
32
+ this . dir = ' server'
32
33
33
- this . javaArgs = " -Xmx1G"
34
- this . bukkitArgs = " "
34
+ this . javaArgs = ' -Xmx1G'
35
+ this . bukkitArgs = ' '
35
36
}
36
37
37
38
/**
@@ -40,7 +41,7 @@ class RunConfiguration {
40
41
* @return Java arguments
41
42
*/
42
43
String getJavaArgs () {
43
- return " ${ this.debug ? "$DEBUG_ARGS " : "" } -Dfile.encoding=$encoding ${ this.javaArgs} "
44
+ return " ${ this.debug ? "$DEBUG_ARGS " : '' } -Dfile.encoding=$encoding ${ this.javaArgs} "
44
45
}
45
46
46
47
/**
@@ -49,7 +50,7 @@ class RunConfiguration {
49
50
* @return Bukkit arguments
50
51
*/
51
52
String getBukkitArgs () {
52
- return bukkitArgs ?: " "
53
+ return bukkitArgs ?: ' '
53
54
}
54
55
55
56
/**
@@ -71,7 +72,7 @@ class RunConfiguration {
71
72
return
72
73
}
73
74
74
- def taskName = " Run Server"
75
+ def taskName = ' Run Server'
75
76
def serverDir = (project. tasks. prepareServer as PrepareServer ). serverDir. toRealPath()
76
77
def args = this . bukkitArgs
77
78
@@ -80,17 +81,29 @@ class RunConfiguration {
80
81
def props = this . getJavaArgs()
81
82
this . debug = realDebug
82
83
83
- def runConfiguration = configurationDir. resolve(" ${ taskName.replace(" ", "_" )} .xml" )
84
+ def runConfiguration = configurationDir. resolve(" ${ taskName.replace(' ', '_' )} .xml" )
84
85
def xml = new MarkupBuilder (runConfiguration. newWriter())
85
- xml. component(name : " ProjectRunConfigurationManager" ) {
86
- configuration(default : ' false' , name : taskName, type : " JarApplication" , factoryName : " JAR Application" , singleton : " true" ) {
86
+ xml. component(name : ' ProjectRunConfigurationManager' ) {
87
+ configuration(
88
+ default : ' false' ,
89
+ name : taskName,
90
+ type : ' JarApplication' ,
91
+ factoryName : ' JAR Application' ,
92
+ singleton : ' true'
93
+ ) {
87
94
option(name : ' JAR_PATH' , value : " ${ serverDir.resolve(ServerCore.CORE_NAME)} " )
88
95
option(name : ' VM_PARAMETERS' , value : props)
89
96
option(name : ' PROGRAM_PARAMETERS' , value : args)
90
97
option(name : ' WORKING_DIRECTORY' , value : serverDir)
91
98
envs()
92
99
method {
93
- option(name : " Gradle.BeforeRunTask" , enabled : " true" , tasks : " prepareServer" , externalProjectPath : ' $PROJECT_DIR$' , vmOptions : " " , scriptParameters : " " )
100
+ option(
101
+ name : ' Gradle.BeforeRunTask' ,
102
+ enabled : ' true' ,
103
+ tasks : ' prepareServer' ,
104
+ externalProjectPath : ' $PROJECT_DIR$' ,
105
+ vmOptions : ' ' ,
106
+ scriptParameters : ' ' )
94
107
}
95
108
}
96
109
}
0 commit comments