Advertisement
Stiepen

Minecraft - Basic Mod build script

Apr 21st, 2013
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.08 KB | None | 0 0
  1. #!/bin/bash
  2. # Script by Kilobyte (Stephan Henrichs)
  3.  
  4. # Usage: put into mcp dir
  5. # run this command: mkdir "out"; echo "next version, for example 1 0 0 for 1.0.0" > VERSION; mkdir addbuildfiles
  6.  
  7. # config
  8. MODNAME="ModName"
  9.  
  10. echo "Reading version file..."
  11. ver=(`cat 'VERSION'`)
  12. verstr="${ver[0]}.${ver[1]}.${ver[2]}"
  13. echo "Done, building Version... ${verstr}"
  14. start=`date +%s`
  15. echo "Recompiling..."
  16. python runtime/recompile.py "$@" || exit
  17. echo "Done, Reobfuscating"
  18. python runtime/reobfuscate.py --srgnames || exit
  19. echo "Done, copying additional files to output dir..."
  20. pwd
  21. cp -r addbuildfiles/* reobf/minecraft/
  22.  
  23. echo "Done, packing jar as ${MODNAME}_${verstr}.jar"
  24. cd "reobf/minecraft"
  25. find . -name "*" | zip "../../out/${MODNAME}_${verstr}.jar" -@
  26. echo "Done, updating version file"
  27.  
  28. ver[2]=$((ver[2] + 1))
  29. cd ../..
  30. echo "${ver[0]} ${ver[1]} ${ver[2]}" > VERSION
  31. end=`date +%s`
  32. diff=$((end - start))
  33. echo "Done, Took $diff Seconds"
  34. # comment out when not using KDE
  35. kdialog --title "Build done" --passivepopup "Build of ${MODNAME}_${verstr}.jar done in $diff Seconds."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement