File tree 2 files changed +21
-3
lines changed
test/groovy/ru/endlesscode/bukkitgradle/server/task 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -122,13 +122,12 @@ public class DevServerPlugin : Plugin<Project> {
122
122
copyServerCore : TaskProvider <Copy >,
123
123
serverDir : Provider <Directory >
124
124
): TaskProvider <PrepareServer > {
125
- val jarTaskName = if (project.plugins.hasPlugin(" com.github.johnrengelman.shadow" )) " shadowJar" else " jar"
126
- val jarTask = tasks.named<Jar >(jarTaskName)
127
125
val copyPlugins = tasks.register<Copy >(" copyPlugins" ) {
128
126
group = TASKS_GROUP_BUKKIT
129
127
description = " Copy plugins to dev server."
130
128
131
- from(jarTask)
129
+ val jarTaskName = if (project.plugins.hasPlugin(" com.github.johnrengelman.shadow" )) " shadowJar" else " jar"
130
+ from(tasks.named<Jar >(jarTaskName))
132
131
into(serverDir.map { project.mkdir(it.dir(" plugins" )) })
133
132
rename { " ${pluginMeta.name.get()} .jar" }
134
133
}
Original file line number Diff line number Diff line change @@ -55,4 +55,23 @@ class PrepareServerSpec extends PluginSpecification {
55
55
and : " online-mode should be false"
56
56
file(" $serverDir /server.properties" ). readLines(). contains(" online-mode=false" )
57
57
}
58
+
59
+ def " when run prepareServer - and there is shadow plugin - should use shadowJar task" () {
60
+ given : " configured eula and online-mode"
61
+ buildFile. text = """
62
+ plugins {
63
+ id "ru.endlesscode.bukkitgradle"
64
+ id "com.github.johnrengelman.shadow" version "6.1.0"
65
+ }
66
+
67
+ version = '1.0'
68
+ group = 'com.example.testplugin'
69
+ """ . stripIndent()
70
+
71
+ when : " run prepareServer"
72
+ run(TASK_NAME , ' -x' , ' copyServer' )
73
+
74
+ then : " should run shadowJar"
75
+ taskOutcome(" :shadowJar" ) == TaskOutcome . SUCCESS
76
+ }
58
77
}
You can’t perform that action at this time.
0 commit comments