Release script will now include the Minecraft version in the arcive names.

This commit is contained in:
LexManos 2012-11-17 22:58:34 -08:00
parent 6a8a8a78c4
commit 6dafa3d0c2

View file

@ -18,9 +18,12 @@ zip = None
zip_name = None
zip_base = None
version_str = None
version_mc = None
def main():
global version_str
global version_mc
build_num = 0
if len(sys.argv) > 1:
try:
@ -48,7 +51,10 @@ def main():
extract_fml_obfed()
extract_paulscode()
version = load_version(build_num)
version_str = '%d.%d.%d.%d' % (version['major'], version['minor'], version['revision'], version['build'])
version_forge = '%d.%d.%d.%d' % (version['major'], version['minor'], version['revision'], version['build'])
version_mc = load_mc_version(forge_dir)
version_str = '%s-%s' % (version_mc, version_forge)
out_folder = os.path.join(forge_dir, 'forge-%s' % version_str)
if os.path.isdir(out_folder):
@ -135,7 +141,7 @@ def zip_start(name, base=None):
global zip, zip_name, zip_base
zip_name = name
print '=================================== %s Start =================================' % zip_name
print '================== %s Start ==================' % zip_name
zip_file = os.path.join(forge_dir, 'forge-%s' % version_str, name)
zip = zipfile.ZipFile(zip_file, 'w', zipfile.ZIP_DEFLATED)
zip_base = base
@ -143,23 +149,25 @@ def zip_start(name, base=None):
def zip_end():
global zip, zip_name, zip_base
zip.close()
print '=================================== %s Finished =================================' % zip_name
print '================== %s Finished ==================' % zip_name
zip_name = None
zip_base = None
def update_info(input, version):
input = os.path.join(forge_dir, input.replace('/', os.sep))
temp = os.path.join(forge_dir, 'file.backup')
def load_mc_version(forge_dir):
props = os.path.join(forge_dir, 'fml', 'common', 'fmlversion.properties')
shutil.move(input, temp)
if not os.path.isfile(props):
print 'Could not load fmlversion.properties, build failed'
sys.exit(1)
with open(temp, 'r') as fh:
buf = fh.read()
with open(props, 'r') as fh:
for line in fh:
line = line.strip()
if line.startswith('fmlbuild.mcversion'):
return line.split('=')[1].strip()
buf = re.sub(r'{version}', version, buf)
with open(input, 'w') as fh:
fh.write(buf)
print 'Could not load fmlversion.properties, build failed'
sys.exit(1)
def extract_fml_obfed():
fml_file = os.path.join(forge_dir, 'fml', 'difflist.txt')