コード例 #1
0
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
コード例 #2
0
ファイル: build.py プロジェクト: Aranshada/TFCraft
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
コード例 #3
0
ファイル: build.py プロジェクト: Aranshada/TFCraft
    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()
コード例 #4
0
ファイル: build.py プロジェクト: turtletechy/TFCraft
             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()