def build(major_num=0, build_num=0, revision_num=0): print '============================= Build Start (%d.%d.%d) ============================' % ( major_num, build_num, revision_num) print '\nsrc -> backup' copytree(src_dir, backup_dir, 0) print '\nTFC_Shared -> minecraft' copytree(os.path.join(forge_dir, 'TFC_Shared'), os.path.join(src_dir, 'minecraft'), 0) print '\nTFC API -> minecraft' copytree(os.path.join(forge_dir, 'TFC API'), os.path.join(src_dir, 'minecraft'), 0) print '\nTFC ASM -> minecraft' copytree(os.path.join(forge_dir, 'TFC ASM'), os.path.join(src_dir, 'minecraft'), 0) print error_level = 0 try: os.chdir(mcp_dir) reset_logger() recompile(None, False, False) reset_logger() os.chdir(forge_dir) except SystemExit, e: print 'Recompile Exception: %d ' % e.code error_level = e.code
def build(major_num=0, build_num=0, revision_num=0): print '============================= Build Start (%d.%d.%d) ============================' % (major_num, build_num, revision_num) print '\nsrc -> backup' copytree(src_dir, backup_dir, 0) print '\nTFC_Shared -> minecraft' copytree(os.path.join(forge_dir, 'TFC_Shared'), os.path.join(src_dir, 'minecraft'), 0) print '\nTFC API -> minecraft' copytree(os.path.join(forge_dir, 'TFC API'), os.path.join(src_dir, 'minecraft'), 0) print '\nTFC ASM -> minecraft' copytree(os.path.join(forge_dir, 'TFC ASM'), os.path.join(src_dir, 'minecraft'), 0) print error_level = 0 try: os.chdir(mcp_dir) reset_logger() recompile(None, False, False) reset_logger() os.chdir(forge_dir) except SystemExit, e: print 'Recompile Exception: %d ' % e.code error_level = e.code
copytree(os.path.join(forge_dir, 'TFC_Shared'), os.path.join(src_dir, 'minecraft'), 0) print '\nTFC API -> minecraft' copytree(os.path.join(forge_dir, 'TFC API'), os.path.join(src_dir, 'minecraft'), 0) print '\nTFC ASM -> minecraft' copytree(os.path.join(forge_dir, 'TFC ASM'), os.path.join(src_dir, 'minecraft'), 0) print error_level = 0 try: os.chdir(mcp_dir) reset_logger() recompile(None, False, False) reset_logger() os.chdir(forge_dir) except SystemExit, e: print 'Recompile Exception: %d ' % e.code error_level = e.code print '\nremove src' shutil.rmtree(src_dir) print '\nbackup -> src' copytree(backup_dir, src_dir, 0) print '\nremove backup' shutil.rmtree(backup_dir) print '============================= Build Finished %d ============================' % error_level return error_level if __name__ == '__main__': main()
os.path.join(src_dir, 'minecraft'), 0) print '\nTFC API -> minecraft' copytree(os.path.join(forge_dir, 'TFC API'), os.path.join(src_dir, 'minecraft'), 0) print error_level = 0 try: os.chdir(mcp_dir) reset_logger() recompile(None, False, False) reset_logger() os.chdir(forge_dir) except SystemExit, e: print 'Recompile Exception: %d ' % e.code error_level = e.code print '\nremove src' shutil.rmtree(src_dir) print '\nbackup -> src' copytree(backup_dir, src_dir, 0) print '\nremove backup' shutil.rmtree(backup_dir) print '============================= Build Finished %d ============================' % error_level return error_level if __name__ == '__main__': main()