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:
parent
6c99b80b73
commit
2090264599
|
@ -220,6 +220,10 @@
|
||||||
</condition>
|
</condition>
|
||||||
<fail if="do.not.continue">You have decided not to continue. This script will stop now.</fail>
|
<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>
|
<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}">
|
<exec executable="${python.exe}" dir="${mcp.home}">
|
||||||
<arg value="${mcp.home}/runtime/cleanup.py" />
|
<arg value="${mcp.home}/runtime/cleanup.py" />
|
||||||
<arg value="-f" />
|
<arg value="-f" />
|
||||||
|
@ -244,13 +248,20 @@
|
||||||
<copy todir="${mcp.home}/src-base">
|
<copy todir="${mcp.home}/src-base">
|
||||||
<fileset dir="${mcp.home}/src"/>
|
<fileset dir="${mcp.home}/src"/>
|
||||||
</copy>
|
</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">
|
<copy todir="${mcp.home}/src-work">
|
||||||
<fileset dir="${mcp.home}/src"/>
|
<fileset dir="${mcp.home}/src"/>
|
||||||
</copy>
|
</copy>
|
||||||
<antcall target="patch"/>
|
|
||||||
<antcall target="writeversion"/>
|
<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>
|
<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>
|
||||||
|
|
||||||
|
<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>
|
</project>
|
||||||
|
|
|
@ -1,10 +1,17 @@
|
||||||
import urllib
|
import urllib
|
||||||
import zipfile
|
import zipfile
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
try:
|
try:
|
||||||
urllib.urlretrieve("http://goo.gl/PnJHp", './fernflower.zip')
|
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 = zipfile.ZipFile('fernflower.zip')
|
||||||
zf.extract('fernflower.jar', '../runtime/bin')
|
zf.extract('fernflower.jar', path)
|
||||||
|
print "Fernflower downloaded into MCP at %s" % (path)
|
||||||
except:
|
except:
|
||||||
print "Downloading Fernflower failed download manually from http://goo.gl/PnJHp"
|
print "Downloading Fernflower failed download manually from http://goo.gl/PnJHp"
|
|
@ -31,6 +31,7 @@ def main():
|
||||||
base = os.path.normpath(os.path.join(mcp, 'src-base'))
|
base = os.path.normpath(os.path.join(mcp, 'src-base'))
|
||||||
work = os.path.normpath(os.path.join(mcp, 'src-work'))
|
work = os.path.normpath(os.path.join(mcp, 'src-work'))
|
||||||
timestamp = re.compile(r'[0-9-]* [0-9:\.]* [+-][0-9]*\r?\n')
|
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 path, _, filelist in os.walk(work, followlinks=True):
|
||||||
for cur_file in fnmatch.filter(filelist, '*.java'):
|
for cur_file in fnmatch.filter(filelist, '*.java'):
|
||||||
|
@ -46,6 +47,7 @@ def main():
|
||||||
if len(patch) > 0:
|
if len(patch) > 0:
|
||||||
print patch_file
|
print patch_file
|
||||||
patch = timestamp.sub("0000-00-00 00:00:00.000000000 -0000\n", patch)
|
patch = timestamp.sub("0000-00-00 00:00:00.000000000 -0000\n", patch)
|
||||||
|
patch = mcpath.sub('..',patch)
|
||||||
patch = patch.replace('\r\n', '\n')
|
patch = patch.replace('\r\n', '\n')
|
||||||
|
|
||||||
if not os.path.exists(patch_dir):
|
if not os.path.exists(patch_dir):
|
||||||
|
|
Loading…
Reference in New Issue