Advertisement
VirtualMaestro

Untitled

Sep 14th, 2020 (edited)
2,605
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 1.02 KB | None | 0 0
  1. task cleanBefore (type: Delete) {
  2.     println 'Cleanup before build'
  3.     delete 'build', 'StubbUnity.zip'
  4. }
  5.  
  6. task copySrc (type: Copy) {
  7.     println 'Create Stubb package'
  8.    
  9.     from "."
  10.    
  11.     include "ecs-unityintegration/"
  12.     include "StubbFramework/"
  13.     include "StubbUnity/StubbUnity/Src/"
  14.    
  15.     exclude '**/*.gradle'
  16.     exclude 'build'
  17.     exclude '**/*.git'
  18.  
  19.     into "build"
  20. }
  21.  
  22. task createZip (type: Zip) {
  23.     println 'Create ZIP package'
  24.  
  25.     archiveFileName = "StubbUnity.zip"
  26.     destinationDirectory = file(".")
  27.  
  28.     from "build"
  29. }
  30.  
  31. task cleanAfter (type: Delete) {
  32.     println 'Cleanup after build'
  33.     delete 'build'
  34. }
  35.  
  36. task build () {
  37.     dependsOn 'cleanBefore'
  38.     dependsOn 'copySrc'
  39.     dependsOn 'createZip'
  40.     dependsOn 'cleanAfter'
  41.  
  42.     tasks.findByName('copySrc').mustRunAfter 'cleanBefore'
  43.     tasks.findByName('createZip').mustRunAfter 'copySrc'
  44.     tasks.findByName('cleanAfter').mustRunAfter 'createZip'
  45.  
  46.     println 'Package StubbUnity.zip has been created!'
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement