<commit_before>import os
import sys
import shutil
import re

global gCompiler

def copyIgnore( path, names ):
    result = []
    for name in names:
        if name == 'vc10' and gCompiler != 'vc10':
            result.append( name )
        elif name == 'ios' and gCompiler != 'xcode':
            result.append( name )
        elif name == 'ios-sim' and gCompiler != 'xcode':
            result.append( name )
        elif name == 'macosx' and gCompiler != 'xcode':
            result.append( name )
        elif name == 'xcode' and gCompiler != 'xcode':
            result.append( name )
        elif name == 'msw' and gCompiler == 'xcode':
            result.append( name )
        elif re.search( "libboost.*-vc100.*", name ) != None and gCompiler != 'vc10':
            result.append( name )
        elif name == 'boost':
            result.append( name )
        elif re.search( ".git.*", name ) != None:
            result.append( name )
    return result

def printUsage():
    print "Run from the root of the repository (having run vcvars):"
    print "git checkout-index -a -f --prefix=../cinder_temp/"
    print "cd ../cinder_temp"
    print "python tools/packageRelease.py (version number) (xcode|vc10)"

def processExport( outputName, compilerName, version ):
    print "creating a clean clone of cinder"
    baseDir = os.getcwd()
    os.system( "git checkout-index -a -f --prefix=../cinder_temp/" )
    print "creating a clean clone of Cinder-OpenCV"
    os.chdir( baseDir + os.sep + "blocks" + os.sep + "Cinder-OpenCV" )
    os.system( "git checkout-index -a -f --prefix=../../../cinder_temp/blocks/opencv/" )
    os.chdir( baseDir + os.sep + ".." + os.sep + "cinder_temp" )
    outputDir = baseDir + os.sep + ".." + os.sep + "cinder_" + version + "_" + outputName + os.sep
    print "performing selective copy to " + outputDir
    shutil.copytree( ".", outputDir, ignore=copyIgnore )
    os.chdir( outputDir + "docs" + os.sep + "doxygen" )
    print "generating cinder docs " + outputDir
    os.system( "doxygen Doxyfile" )
    print "generating Cinder-OpenCV docs"
    os.chdir( outputDir + "blocks" + os.sep + "opencv" + os.sep + "docs" + os.sep + "doxygen" )
    os.system( "/Applications/Doxygen.app/Contents/Resources/doxygen Doxyfile" )
#    os.remove( outputDir + "docs" + os.sep + "doxygen" + os.sep + "cinder.tag" )
    print "removing test"
    shutil.rmtree( outputDir + "test" )
    print "copying boost headers"
    shutil.copytree( baseDir + os.sep + "boost" + os.sep + "boost", outputDir + "boost" + os.sep + "boost" )
    return outputDir
    

if len(sys.argv) != 3:
    printUsage()
elif sys.argv[2] == 'xcode':
    gCompiler = 'xcode'
    outputDir = processExport( "mac", "xcode", sys.argv[1] )
    os.chdir( outputDir + "xcode" )
    os.system( "./fullbuild.sh" )
    shutil.rmtree( outputDir + "xcode/build" )
    os.chdir( outputDir + "lib" )
    os.system( "strip -r *.a" )
elif sys.argv[2] == 'vc10':
    gCompiler = 'vc10'
    processExport( "vc2010", "vc10", sys.argv[1] )
else:
    printUsage()
<commit_msg>package script instructions update and xcode debug symbols strip<commit_after>import os
import sys
import shutil
import re

global gCompiler

def copyIgnore( path, names ):
    result = []
    for name in names:
        if name == 'vc10' and gCompiler != 'vc10':
            result.append( name )
        elif name == 'ios' and gCompiler != 'xcode':
            result.append( name )
        elif name == 'ios-sim' and gCompiler != 'xcode':
            result.append( name )
        elif name == 'macosx' and gCompiler != 'xcode':
            result.append( name )
        elif name == 'xcode' and gCompiler != 'xcode':
            result.append( name )
        elif name == 'msw' and gCompiler == 'xcode':
            result.append( name )
        elif re.search( "libboost.*-vc100.*", name ) != None and gCompiler != 'vc10':
            result.append( name )
        elif name == 'boost':
            result.append( name )
        elif re.search( ".git.*", name ) != None:
            result.append( name )
    return result

def printUsage():
    print "Run from the root of the repository (having run vcvars):"
    print "python tools/packageRelease.py (version number) (xcode|vc10)"

def processExport( outputName, compilerName, version ):
    print "creating a clean clone of cinder"
    baseDir = os.getcwd()
    os.system( "git checkout-index -a -f --prefix=../cinder_temp/" )
    print "creating a clean clone of Cinder-OpenCV"
    os.chdir( baseDir + os.sep + "blocks" + os.sep + "opencv" )
    os.system( "git checkout-index -a -f --prefix=../../../cinder_temp/blocks/opencv/" )
    os.chdir( baseDir + os.sep + ".." + os.sep + "cinder_temp" )
    outputDir = baseDir + os.sep + ".." + os.sep + "cinder_" + version + "_" + outputName + os.sep
    print "performing selective copy to " + outputDir
    shutil.copytree( ".", outputDir, ignore=copyIgnore )
    os.chdir( outputDir + "docs" + os.sep + "doxygen" )
    print "generating cinder docs " + outputDir
    os.system( "doxygen Doxyfile" )
    print "generating Cinder-OpenCV docs"
    os.chdir( outputDir + "blocks" + os.sep + "opencv" + os.sep + "docs" + os.sep + "doxygen" )
    os.system( "/Applications/Doxygen.app/Contents/Resources/doxygen Doxyfile" )
#    os.remove( outputDir + "docs" + os.sep + "doxygen" + os.sep + "cinder.tag" )
    print "removing test"
    shutil.rmtree( outputDir + "test" )
    print "copying boost headers"
    shutil.copytree( baseDir + os.sep + "boost" + os.sep + "boost", outputDir + "boost" + os.sep + "boost" )
    return outputDir
    

if len(sys.argv) != 3:
    printUsage()
elif sys.argv[2] == 'xcode':
    gCompiler = 'xcode'
    outputDir = processExport( "mac", "xcode", sys.argv[1] )
    os.chdir( outputDir + "xcode" )
    os.system( "./fullbuild.sh" )
    shutil.rmtree( outputDir + "xcode/build" )
    os.chdir( outputDir + "lib" )
    os.system( "strip -S -r *.a" )
elif sys.argv[2] == 'vc10':
    gCompiler = 'vc10'
    processExport( "vc2010", "vc10", sys.argv[1] )
else:
    printUsage()

{'fraction_non_alphanumeric': 0.1523353688727513, 'fraction_numerical': 0.008582274302690212, 'mean_word_length': 2.5921754593953765, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6402985', 'n_tokens_mistral': 2082, 'n_tokens_neox': 2023, 'n_words': 556}