From Gustavo6046, 1 Month ago, written in Groovy.
Embed
  1. apply plugin: 'java'
  2.  
  3. def date = "2017.08.05"
  4. def dayRev = "1"
  5. def pluginName = "SentientCrafting"
  6.  
  7. def filename = "${pluginName}_v${date}.${dayRev}"
  8.  
  9. jar {
  10.         baseName = pluginName
  11.         version = "${date}.${dayRev}"
  12.     manifest {
  13.         attributes 'Implementation-Title': 'Sentient Crafting',
  14.                    'Implementation-Version': "${date}.${dayRev}"
  15.     }
  16. }
  17.  
  18. task copyJar_dist(type: Copy) {
  19.         from jar
  20.         into 'dist'
  21. }
  22.  
  23. task copyJar_server(type: Copy) {
  24.         from jar
  25.         into 'C:/Users/gusta_000.ACER/AppData/Roaming/spigot/plugins'
  26. }
  27.  
  28. task deleteOldVersions {
  29.         delete fileTree('C:/Users/gusta_000.ACER/AppData/Roaming/spigot/plugins') {
  30.                 include 'SentientCrafting*.jar'
  31.         }
  32. }
  33.  
  34. task runServer(type:Exec) {
  35.         workingDir 'C:/Users/gusta_000.ACER/AppData/Roaming/spigot/'
  36.         commandLine 'cmd', '/c', 'run.bat'
  37. }
  38.  
  39. build.dependsOn copyJar_dist
  40. build.dependsOn copyJar_server
  41.  
  42. runServer.dependsOn deleteOldVersions
  43. runServer.dependsOn build