Example #1
0
def generateStarterFiles(state):
    if isLibrary(state.binaryType):
        colorPrint("ERROR: G3D template cannot be used with a library", ERROR_COLOR)
        sys.exit(-232)
                
    starterPath = findG3DStarter(state)
    
    print '\nCopying G3D starter files from ' + starterPath

    mkdir('doc-files')
    for d in ['data-files', 'source']:
        copyifnewer.copyIfNewer(pathConcat(starterPath, d), d)
Example #2
0
def generateStarterFiles(state):
    if isLibrary(state.binaryType):
        colorPrint("ERROR: G3D template cannot be used with a library",
                   ERROR_COLOR)
        sys.exit(-232)

    starterPath = findG3DStarter(state)

    print '\nCopying G3D starter files from ' + starterPath

    mkdir('doc-files')
    for d in ['data-files', 'source']:
        copyifnewer.copyIfNewer(pathConcat(starterPath, d), d)
Example #3
0
def _createApp(tmpDir, appDir, srcDir, state):
    contents = appDir + 'Contents/'
    frameworks = contents + 'Frameworks/'
    resources = contents + 'Resources/'
    macos = contents + 'MacOS/'

    # Create directories
    mkdir(appDir, utils.verbosity >= VERBOSE)
    mkdir(contents, utils.verbosity >= VERBOSE)
    mkdir(frameworks, utils.verbosity >= VERBOSE)
    mkdir(resources, utils.verbosity >= VERBOSE)
    mkdir(macos, utils.verbosity >= VERBOSE)

    # Create Info.plist
    if utils.verbosity >= NORMAL:
        colorPrint('\nWriting Info.plist and PkgInfo', SECTION_COLOR)
    writeFile(contents + 'Info.plist',
              _makePList(state.projectName, state.binaryName))
    writeFile(contents + 'PkgInfo', 'APPL' + state.binaryName[0:4] + '\n')

    # Copy binary
    if utils.verbosity >= NORMAL:
        colorPrint('\nCopying executable', SECTION_COLOR)
    shell(
        'cp ' + state.binaryDir + state.binaryName + ' ' + macos +
        state.binaryName, utils.verbosity >= VERBOSE)

    # Copy data-files to Resources
    if utils.verbosity >= NORMAL:
        colorPrint('\nCopying data files', SECTION_COLOR)
    copyIfNewer('data-files', resources, utils.verbosity >= VERBOSE,
                utils.verbosity == NORMAL)
    if utils.verbosity >= VERBOSE:
        colorPrint('Done copying data files', SECTION_COLOR)

    # Copy frameworks
    for libName in state.libList():
        if libraryTable.has_key(libName):
            lib = libraryTable[libName]
            if lib.deploy and (lib.type == FRAMEWORK):
                print 'Copying ' + lib.name + ' Framework'
                fwk = lib.releaseFramework + '.framework'
                src = '/Library/Frameworks/' + fwk
                copyIfNewer(src, frameworks + fwk, utils.verbosity >= VERBOSE,
                            utils.verbosity == NORMAL)
Example #4
0
def _createApp(tmpDir, appDir, srcDir, state):
    contents = appDir + "Contents/"
    frameworks = contents + "Frameworks/"
    resources = contents + "Resources/"
    macos = contents + "MacOS/"

    # Create directories
    mkdir(appDir, utils.verbosity >= VERBOSE)
    mkdir(contents, utils.verbosity >= VERBOSE)
    mkdir(frameworks, utils.verbosity >= VERBOSE)
    mkdir(resources, utils.verbosity >= VERBOSE)
    mkdir(macos, utils.verbosity >= VERBOSE)

    # Create Info.plist
    if utils.verbosity >= NORMAL:
        colorPrint("\nWriting Info.plist and PkgInfo", SECTION_COLOR)
    writeFile(contents + "Info.plist", _makePList(state.projectName, state.binaryName))
    writeFile(contents + "PkgInfo", "APPL" + state.binaryName[0:4] + "\n")

    # Copy binary
    if utils.verbosity >= NORMAL:
        colorPrint("\nCopying executable", SECTION_COLOR)
    shell("cp " + state.binaryDir + state.binaryName + " " + macos + state.binaryName, utils.verbosity >= VERBOSE)

    # Copy data-files to Resources
    if utils.verbosity >= NORMAL:
        colorPrint("\nCopying data files", SECTION_COLOR)
    copyIfNewer("data-files", resources, utils.verbosity >= VERBOSE, utils.verbosity == NORMAL)
    if utils.verbosity >= VERBOSE:
        colorPrint("Done copying data files", SECTION_COLOR)

    # Copy frameworks
    for libName in state.libList():
        if libraryTable.has_key(libName):
            lib = libraryTable[libName]
            if lib.deploy and (lib.type == FRAMEWORK):
                print "Copying " + lib.name + " Framework"
                fwk = lib.releaseFramework + ".framework"
                src = "/Library/Frameworks/" + fwk
                copyIfNewer(src, frameworks + fwk, utils.verbosity >= VERBOSE, utils.verbosity == NORMAL)