示例#1
0
def build(build_num=0):
    version = load_version(build_num)
    print '=================================== Build %d.%d.%d.%d Start =================================' % (version['major'], version['minor'], version['revision'], version['build'])
    
    if os.path.isdir(src_dir):
        shutil.rmtree(src_dir)
    inject_version(os.path.join(forge_dir, 'forge_common', 'net', 'minecraft', 'src', 'forge', 'ForgeHooks.java'), build_num)
        
    print 'src_work -> src'
    copytree(os.path.join(mcp_dir, 'src_work'), src_dir)
    print '\nforge_client -> minecraft'
    copytree(os.path.join(forge_dir, 'forge_client', 'src'), os.path.join(src_dir, 'minecraft'), -1)
    print '\nforge_server -> minecraft_server'
    copytree(os.path.join(forge_dir, 'forge_server', 'src'), os.path.join(src_dir, 'minecraft_server'), -1)
    print '\nforge_common -> minecraft'
    copytree(os.path.join(forge_dir, 'forge_common'), os.path.join(src_dir, 'minecraft'), -1)
    print '\nforge_common -> minecraft_server'
    copytree(os.path.join(forge_dir, 'forge_common'), os.path.join(src_dir, 'minecraft_server'), -1)
    print
    
    error_level = 0
    try:
        os.chdir(mcp_dir)
        reset_logger()
        recompile(None)
        reset_logger()
        os.chdir(forge_dir)
    except SystemExit, e:
        print 'Recompile Exception: %d ' % e.code
        error_level = e.code
示例#2
0
def build(build_num=0):
    version = load_version(build_num)
    print '=================================== Build %d.%d.%d.%d Start =================================' % (
        version['major'], version['minor'], version['revision'],
        version['build'])

    if os.path.isdir(src_dir):
        shutil.rmtree(src_dir)
    inject_version(
        os.path.join(forge_dir, 'forge_common', 'net', 'minecraft', 'src',
                     'forge', 'ForgeHooks.java'), build_num)

    print 'src_work -> src'
    copytree(os.path.join(mcp_dir, 'src_work'), src_dir)
    print '\nforge_client -> minecraft'
    copytree(os.path.join(forge_dir, 'forge_client', 'src'),
             os.path.join(src_dir, 'minecraft'), -1)
    print '\nforge_server -> minecraft_server'
    copytree(os.path.join(forge_dir, 'forge_server', 'src'),
             os.path.join(src_dir, 'minecraft_server'), -1)
    print '\nforge_common -> minecraft'
    copytree(os.path.join(forge_dir, 'forge_common'),
             os.path.join(src_dir, 'minecraft'), -1)
    print '\nforge_common -> minecraft_server'
    copytree(os.path.join(forge_dir, 'forge_common'),
             os.path.join(src_dir, 'minecraft_server'), -1)
    print

    error_level = 0
    try:
        os.chdir(mcp_dir)
        reset_logger()
        recompile(None)
        reset_logger()
        os.chdir(forge_dir)
    except SystemExit, e:
        print 'Recompile Exception: %d ' % e.code
        error_level = e.code
示例#3
0
     sys.exit(ret)
 
 print '=================================== Release Start ================================='
 error_level = 0
 try:
     os.chdir(mcp_dir)
     reset_logger()
     reobfuscate(None, False, True, True)
     reset_logger()
     os.chdir(forge_dir)
 except SystemExit, e:
     print 'Reobfusicate Exception: %d ' % e.code
     error_level = e.code
 
 extract_fml_obfed()
 version = load_version(build_num)
 version_str = '%d.%d.%d.%d' % (version['major'], version['minor'], version['revision'], version['build'])
     
 out_folder = os.path.join(forge_dir, 'forge-%s' % version_str)
 if os.path.isdir(out_folder):
     shutil.rmtree(out_folder)
     
 os.makedirs(out_folder)
 
 update_info('forge_common/mod_MinecraftForge.info', version_str)
 
 zip_start('minecraftforge-client-%s.zip' % version_str)
 zip_folder(client_dir, '', zip)
 zip_add('forge_common/mod_MinecraftForge.info', 'mod_MinecraftForge.info')
 zip_add('forge_client/src/forge_logo.png')
 zip_add('install/MinecraftForge-Credits.txt')