From 9210fe1a57a7f794c1d6961c65bf64719908f01f Mon Sep 17 00:00:00 2001 From: Christian Weeks Date: Wed, 4 Apr 2012 11:05:31 -0400 Subject: [PATCH] Tweak the build a bit, add some more data and generate the touched file list for forge --- .gitignore | 1 + build.xml | 78 ++++++++++++++++++++++---------------- generatechangedfilelist.py | 26 +++++++++++++ 3 files changed, 72 insertions(+), 33 deletions(-) create mode 100644 generatechangedfilelist.py diff --git a/.gitignore b/.gitignore index 2d07a59c4d..6be4c1fd45 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /minecraft_server /mods /fmlbuild.properties +/difflist.txt diff --git a/build.xml b/build.xml index 5350756662..a90c46431c 100644 --- a/build.xml +++ b/build.xml @@ -46,7 +46,7 @@ - + @@ -62,11 +62,11 @@ - + - + @@ -74,10 +74,15 @@ - + - + + + + + + @@ -131,17 +136,21 @@ + - - - - - - - - - - + + + + + + + + + + + + + @@ -149,23 +158,26 @@ - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + + + + @@ -173,9 +185,9 @@ - - - + + + diff --git a/generatechangedfilelist.py b/generatechangedfilelist.py new file mode 100644 index 0000000000..e9c71df0dc --- /dev/null +++ b/generatechangedfilelist.py @@ -0,0 +1,26 @@ +import sys +import os +import commands +import fnmatch +import re +import subprocess, shlex + +def cmdsplit(args): + if os.sep == '\\': + args = args.replace('\\', '\\\\') + return shlex.split(args) + +def main(): + md5dir = os.path.abspath(sys.argv[1]) + list_file = os.path.abspath(sys.argv[2]) + prelist = os.path.join(md5dir,"temp","server.md5") + postlist = os.path.join(md5dir,"temp","server_reobf.md5") + cmd = 'diff --unchanged-group-format='' --old-group-format='' --new-group-format=\'%%>\' --changed-group-format=\'%%>\' %s %s' % (prelist, postlist) + process = subprocess.Popen(cmdsplit(cmd), stdout=subprocess.PIPE, bufsize=-1) + difflist,_= process.communicate() + with open(list_file, 'w') as fh: + fh.write(difflist) + + +if __name__ == '__main__': + main()