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
This commit is contained in:
Christian 2012-07-02 15:54:25 -04:00
parent 6c99b80b73
commit 2090264599
3 changed files with 25 additions and 5 deletions

View File

@ -220,6 +220,10 @@
</condition>
<fail if="do.not.continue">You have decided not to continue. This script will stop now.</fail>
<echo>Preparing the MCP environment at ${mcp.home}</echo>
<exec executable="${python.exe}" dir="${basedir}">
<arg value="${basedir}/download_fernflower.py" />
<arg value="${mcp.home}"/>
</exec>
<exec executable="${python.exe}" dir="${mcp.home}">
<arg value="${mcp.home}/runtime/cleanup.py" />
<arg value="-f" />
@ -244,13 +248,20 @@
<copy todir="${mcp.home}/src-base">
<fileset dir="${mcp.home}/src"/>
</copy>
<echo>Creating clean patch references at ${mcp.home}/src-work</echo>
<antcall target="patch"/>
<echo>Creating clean patched references at ${mcp.home}/src-work</echo>
<copy todir="${mcp.home}/src-work">
<fileset dir="${mcp.home}/src"/>
</copy>
<antcall target="patch"/>
<antcall target="writeversion"/>
<echo>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</echo>
</target>
<target name="updatepatches" depends="buildenvsetup">
<exec executable="${python.exe}" dir="${basedir}">
<arg value="${basedir}/update_patches.py" />
<arg value="${mcp.home}"/>
<arg value="${basedir}/patches"/>
</exec>
</target>
</project>

View File

@ -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"
print "Downloading Fernflower failed download manually from http://goo.gl/PnJHp"

View File

@ -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):