mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 11:05:40 +00:00
FML will now attempt to download MCP as part of the install process
Now shipping a py2exe version of python for windows. Linux/Macs should come with python pre-installed so they do not have a distrabution here.
This commit is contained in:
1 parent
42b3e6ad56
commit
8b2665980d
6 files changed
+81
-15
No files matched your search
@@ -8,3 +8,5 @@
|
|||||||
fmlbranding.properties
|
fmlbranding.properties
|
||||||
/fernflower.zip
|
/fernflower.zip
|
||||||
/commands.py.bck
|
/commands.py.bck
|
||||||
|
/mcp*.zip
|
||||||
|
/mcp
|
||||||
@@ -46,9 +46,13 @@
|
|||||||
<condition property="mcp.home" value="${env.WORKSPACE}/mcpworkspace" else="${default.mcp.home}">
|
<condition property="mcp.home" value="${env.WORKSPACE}/mcpworkspace" else="${default.mcp.home}">
|
||||||
<isset property="env.WORKSPACE" />
|
<isset property="env.WORKSPACE" />
|
||||||
</condition>
|
</condition>
|
||||||
<condition property="python.exe" value="${mcp.home}/runtime/bin/python/python_mcp" else="python">
|
<property name="fml.python.dir" location="${basedir}/python" />
|
||||||
|
<condition property="python.exe" value="${fml.python.dir}/python_fml" else="python">
|
||||||
<os family="Windows" />
|
<os family="Windows" />
|
||||||
</condition>
|
</condition>
|
||||||
|
<condition property="mcp.exists">
|
||||||
|
<available file="${mcp.home}/runtime/commands.py"/>
|
||||||
|
</condition>
|
||||||
<property name="mcp.obfoutput" location="${mcp.home}/reobf" />
|
<property name="mcp.obfoutput" location="${mcp.home}/reobf" />
|
||||||
<property name="client.mcp.obfoutput" location="${mcp.obfoutput}/minecraft" />
|
<property name="client.mcp.obfoutput" location="${mcp.obfoutput}/minecraft" />
|
||||||
<property name="mcp.srcdir" location="${mcp.home}/src" />
|
<property name="mcp.srcdir" location="${mcp.home}/src" />
|
||||||
@@ -77,6 +81,13 @@
|
|||||||
<property name="version" value="${version.major}.${version.minor}.${version.rev}.${version.build}" />
|
<property name="version" value="${version.major}.${version.minor}.${version.rev}.${version.build}" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<target name="makeclean" depends="buildenvsetup" if="mcp.exists">
|
||||||
|
<exec executable="${python.exe}" dir="${mcp.home}">
|
||||||
|
<arg value="${mcp.home}/runtime/cleanup.py" />
|
||||||
|
<arg value="-f" />
|
||||||
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
<target name="clean" depends="buildenvsetup">
|
<target name="clean" depends="buildenvsetup">
|
||||||
<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" />
|
||||||
@@ -212,6 +223,7 @@
|
|||||||
<zipfileset dir="${common.src.dir}" includes="mcpmod.info" prefix="fml/common" />
|
<zipfileset dir="${common.src.dir}" includes="mcpmod.info" prefix="fml/common" />
|
||||||
<zipfileset dir="${patch.src.dir}" includes="**/*.patch" prefix="fml/patches" />
|
<zipfileset dir="${patch.src.dir}" includes="**/*.patch" prefix="fml/patches" />
|
||||||
<zipfileset dir="${fml.conf.dir}" prefix="fml/conf" />
|
<zipfileset dir="${fml.conf.dir}" prefix="fml/conf" />
|
||||||
|
<zipfileset dir="${fml.python.dir}" prefix="fml/python" />
|
||||||
<mappedresources>
|
<mappedresources>
|
||||||
<concat>
|
<concat>
|
||||||
<fileset dir="${basedir}/install" includes="README.txt" />
|
<fileset dir="${basedir}/install" includes="README.txt" />
|
||||||
@@ -273,11 +285,7 @@
|
|||||||
<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="fmldecompile" depends="buildenvsetup">
|
<target name="fmldecompile" depends="buildenvsetup,makeclean">
|
||||||
<exec executable="${python.exe}" dir="${mcp.home}">
|
|
||||||
<arg value="${mcp.home}/runtime/cleanup.py" />
|
|
||||||
<arg value="-f" />
|
|
||||||
</exec>
|
|
||||||
<exec executable="${python.exe}" dir="${basedir}">
|
<exec executable="${python.exe}" dir="${basedir}">
|
||||||
<arg value="${basedir}/decompile.py" />
|
<arg value="${basedir}/decompile.py" />
|
||||||
<arg value="${mcp.home}" />
|
<arg value="${mcp.home}" />
|
||||||
@@ -285,11 +293,7 @@
|
|||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="jenkinsfmldecompile" depends="buildenvsetup">
|
<target name="jenkinsfmldecompile" depends="buildenvsetup,makeclean">
|
||||||
<exec executable="${python.exe}" dir="${mcp.home}">
|
|
||||||
<arg value="${mcp.home}/runtime/cleanup.py" />
|
|
||||||
<arg value="-f" />
|
|
||||||
</exec>
|
|
||||||
<exec executable="${python.exe}" dir="${basedir}">
|
<exec executable="${python.exe}" dir="${basedir}">
|
||||||
<arg value="${basedir}/decompile.py" />
|
<arg value="${basedir}/decompile.py" />
|
||||||
<arg value="${mcp.home}" />
|
<arg value="${mcp.home}" />
|
||||||
|
|||||||
+45
-1
@@ -97,7 +97,6 @@ def download_minecraft(mcp_dir, fml_dir, version=None):
|
|||||||
if version is None:
|
if version is None:
|
||||||
version = default['current_ver']
|
version = default['current_ver']
|
||||||
|
|
||||||
|
|
||||||
bin_folder = os.path.join(mcp_dir, 'jars', 'bin')
|
bin_folder = os.path.join(mcp_dir, 'jars', 'bin')
|
||||||
if not os.path.exists(bin_folder):
|
if not os.path.exists(bin_folder):
|
||||||
os.makedirs(bin_folder)
|
os.makedirs(bin_folder)
|
||||||
@@ -616,8 +615,53 @@ def merge_tree(root_src_dir, root_dst_dir):
|
|||||||
os.remove(dst_file)
|
os.remove(dst_file)
|
||||||
shutil.copy(src_file, dst_dir)
|
shutil.copy(src_file, dst_dir)
|
||||||
|
|
||||||
|
def download_mcp(mcp_dir, fml_dir, version=None):
|
||||||
|
if os.path.isfile(os.path.join(mcp_dir, 'runtime', 'commands.py')):
|
||||||
|
print 'MCP Detected already, not downloading'
|
||||||
|
return True
|
||||||
|
|
||||||
|
if os.path.isdir(mcp_dir):
|
||||||
|
print 'Old MCP Directory exists, but MCP was not detected, please delete MCP directory at \'%s\'' % mcp_dir
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
versions_file = os.path.join(fml_dir, 'mc_versions.cfg')
|
||||||
|
if not os.path.isfile(versions_file):
|
||||||
|
print 'Could not find mc_versions.cfg in FML directory.'
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
config = ConfigParser.ConfigParser()
|
||||||
|
config.read(versions_file)
|
||||||
|
|
||||||
|
default = config_get_section(config, 'default')
|
||||||
|
if version is None:
|
||||||
|
version = default['current_ver']
|
||||||
|
|
||||||
|
if not config.has_section(version):
|
||||||
|
print 'Error: Invalid minecraft version, could not find \'%s\' in mc_versions.cfg' % version
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
mc_info = config_get_section(config, version)
|
||||||
|
mcp_zip = os.path.join(fml_dir, 'mcp%s.zip' % mc_info['mcp_ver'])
|
||||||
|
|
||||||
|
if not download_file(mc_info['mcp_url'], mcp_zip, mc_info['mcp_md5']):
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
if not os.path.isdir(mcp_dir):
|
||||||
|
_mkdir(mcp_dir)
|
||||||
|
|
||||||
|
print 'Extracting MCP to \'%s\'' % mcp_dir
|
||||||
|
zf = ZipFile(mcp_zip)
|
||||||
|
zf.extractall(mcp_dir)
|
||||||
|
zf.close()
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
def setup_mcp(fml_dir, mcp_dir, dont_gen_conf=True):
|
def setup_mcp(fml_dir, mcp_dir, dont_gen_conf=True):
|
||||||
global mcp_version
|
global mcp_version
|
||||||
|
|
||||||
|
if not download_mcp(mcp_dir, fml_dir):
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
backup = os.path.join(mcp_dir, 'runtime', 'commands.py.bck')
|
backup = os.path.join(mcp_dir, 'runtime', 'commands.py.bck')
|
||||||
runtime = os.path.join(mcp_dir, 'runtime', 'commands.py')
|
runtime = os.path.join(mcp_dir, 'runtime', 'commands.py')
|
||||||
patch = os.path.join(fml_dir, 'commands.patch')
|
patch = os.path.join(fml_dir, 'commands.patch')
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
echo off
|
echo off
|
||||||
@set PATH=%PATH%;%SystemDir%\system32;%SystemRoot%\System32;..\runtime\bin\python
|
@set PATH=%PATH%;%SystemDir%\system32;%SystemRoot%\System32;.\python\
|
||||||
python_mcp install.py
|
python_fml install.py
|
||||||
pause
|
pause
|
||||||
+13
-1
@@ -1,4 +1,5 @@
|
|||||||
import os, os.path, sys
|
import os, os.path, sys
|
||||||
|
from optparse import OptionParser
|
||||||
|
|
||||||
from fml import setup_fml, finish_setup_fml, apply_fml_patches, setup_mcp
|
from fml import setup_fml, finish_setup_fml, apply_fml_patches, setup_mcp
|
||||||
|
|
||||||
@@ -11,4 +12,15 @@ def fml_main(fml_dir, mcp_dir, dont_gen_conf=True):
|
|||||||
print '================ Forge ModLoader Setup End ==================='
|
print '================ Forge ModLoader Setup End ==================='
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
fml_main(os.path.dirname(os.path.abspath(__file__)), os.path.abspath('..'))
|
parser = OptionParser()
|
||||||
|
parser.add_option('-m', '--mcp-dir', action='store_true', dest='mcp_dir', help='Path to download/extract MCP to', default=None)
|
||||||
|
options, _ = parser.parse_args()
|
||||||
|
|
||||||
|
fml_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
|
if not options.mcp_dir is None:
|
||||||
|
fml_main(fml_dir, os.path.abspath(options.mcp_dir))
|
||||||
|
if not os.path.isfile(os.path.join('..', 'runtime', 'commands.py')):
|
||||||
|
fml_main(fml_dir, os.path.abspath('..'))
|
||||||
|
else:
|
||||||
|
fml_main(fml_dir, os.path.abspath('mcp'))
|
||||||
@@ -10,6 +10,8 @@ server_url = http://assets.minecraft.net/1_4_4/minecraft_server.jar
|
|||||||
client_md5 = 7aa46c8058cba2f38e9d2ddddcc77c72
|
client_md5 = 7aa46c8058cba2f38e9d2ddddcc77c72
|
||||||
server_md5 = b5feed15df1db87c9aaf78dcefad513d
|
server_md5 = b5feed15df1db87c9aaf78dcefad513d
|
||||||
mcp_ver = 7.21
|
mcp_ver = 7.21
|
||||||
|
mcp_url = https://www.dropbox.com/s/dao8itysfwuhj9q/mcp721.zip?dl=1
|
||||||
|
mcp_md5 = 772ecfdac7e4c9491bfb131cee3bbb36
|
||||||
|
|
||||||
[1.4.5]
|
[1.4.5]
|
||||||
client_url = http://assets.minecraft.net/1_4_5/minecraft.jar
|
client_url = http://assets.minecraft.net/1_4_5/minecraft.jar
|
||||||
@@ -17,3 +19,5 @@ server_url = http://assets.minecraft.net/1_4_5/minecraft_server.jar
|
|||||||
client_md5 = b15e2b2b6b4629f0d99a95b6b44412a0
|
client_md5 = b15e2b2b6b4629f0d99a95b6b44412a0
|
||||||
server_md5 = 250654ceae7a26ba955a30095d90a475
|
server_md5 = 250654ceae7a26ba955a30095d90a475
|
||||||
mcp_ver = 7.23
|
mcp_ver = 7.23
|
||||||
|
mcp_url = https://www.dropbox.com/s/w5vc4kfkge7jti2/mcp723.zip?dl=1
|
||||||
|
mcp_md5 = 9fbb5835b437b64bc5ce618fa5a53d1d
|
||||||
Reference in new issue
Block a user