From 20902645994c9a0b9db88164ba632adc91479265 Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 2 Jul 2012 15:54:25 -0400 Subject: [PATCH] Some more fixes to the ant stuff: apply patches now happens at the right time, I grab fernflower as part of setup and added an updatepatches call too --- fml/build.xml | 15 +++++++++++++-- fml/download_fernflower.py | 11 +++++++++-- fml/update_patches.py | 4 +++- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/fml/build.xml b/fml/build.xml index e6d0458d8..1a101fb99 100644 --- a/fml/build.xml +++ b/fml/build.xml @@ -220,6 +220,10 @@ You have decided not to continue. This script will stop now. Preparing the MCP environment at ${mcp.home} + + + + @@ -244,13 +248,20 @@ - Creating clean patch references at ${mcp.home}/src-work + + Creating clean patched references at ${mcp.home}/src-work - Setup complete! You should now be able to open ${basedir}/eclipse as a workspace in eclipse and import/refresh the FML-Server and FML-Client projects + + + + + + + diff --git a/fml/download_fernflower.py b/fml/download_fernflower.py index 8731bedd0..44b0f659a 100644 --- a/fml/download_fernflower.py +++ b/fml/download_fernflower.py @@ -1,10 +1,17 @@ import urllib import zipfile +import sys +import os if __name__ == '__main__': try: urllib.urlretrieve("http://goo.gl/PnJHp", './fernflower.zip') + if len(sys.argv)>1: + path = os.path.abspath(os.path.join(sys.argv[1],'runtime/bin')) + else: + path = os.path.abspath('../runtime/bin') zf = zipfile.ZipFile('fernflower.zip') - zf.extract('fernflower.jar', '../runtime/bin') + zf.extract('fernflower.jar', path) + print "Fernflower downloaded into MCP at %s" % (path) except: - print "Downloading Fernflower failed download manually from http://goo.gl/PnJHp" \ No newline at end of file + print "Downloading Fernflower failed download manually from http://goo.gl/PnJHp" diff --git a/fml/update_patches.py b/fml/update_patches.py index 1d0d07d7c..88de7db42 100644 --- a/fml/update_patches.py +++ b/fml/update_patches.py @@ -27,10 +27,11 @@ def cleanDirs(path): def main(): print("Creating patches") - mcp = sys.argv[1] + mcp = sys.argv[1] base = os.path.normpath(os.path.join(mcp, 'src-base')) work = os.path.normpath(os.path.join(mcp, 'src-work')) timestamp = re.compile(r'[0-9-]* [0-9:\.]* [+-][0-9]*\r?\n') + mcpath = re.compile(mcp) for path, _, filelist in os.walk(work, followlinks=True): for cur_file in fnmatch.filter(filelist, '*.java'): @@ -46,6 +47,7 @@ def main(): if len(patch) > 0: print patch_file patch = timestamp.sub("0000-00-00 00:00:00.000000000 -0000\n", patch) + patch = mcpath.sub('..',patch) patch = patch.replace('\r\n', '\n') if not os.path.exists(patch_dir):