Exemplo n.º 1
0
def createBundle(target, source, env):
    bundle_dir = env['BUNDLE_DIR']
    print "creating bundle at " + bundle_dir
    if os.path.isdir(bundle_dir):
        shutil.rmtree(bundle_dir)
    os.makedirs(os.path.join(bundle_dir, resource_dir))
    os.makedirs(os.path.join(bundle_dir, framework_dir))
    os.makedirs(os.path.join(bundle_dir, mac_dir))
    if env['BUNDLE_PLUGINS']:
        os.mkdir(os.path.join(bundle_dir, plugin_dir))
    # add binaries
    for bin in env.Flatten(env['BUNDLE_BINARIES']):
        shutil.copy(str(bin), os.path.join(bundle_dir, mac_dir))
    for bin in env.Flatten(env['BUNDLE_PLUGINS']):
        shutil.copy(str(bin), os.path.join(bundle_dir, plugin_dir))
    # add resources
    for resdir in env['BUNDLE_RESOURCEDIRS']:
        # TODO act sensitive to resdir being a scons target.
        # for now assuming a string since we don't use it
        shutil.copytree(str(resdir), os.path.join(bundle_dir, resource_dir))
    # write Info.plist -- TODO actually write it not copy it
    plistFile = env['BUNDLE_PLIST']
    shutil.copy(str(plistFile), os.path.join(bundle_dir, plist_file))
    # add icon -- TODO generate .icns file from png or svg
    iconFile = env['BUNDLE_ICON']
    shutil.copy(str(iconFile), os.path.join(bundle_dir, resource_dir))
    # add dependent libraries, fixing all absolute paths
    if 'BUNDLE_DEPENDENT_LIBS' in env:
            addDependentLibsToBundle(bundleDir)
Exemplo n.º 2
0
def createBundle(target, source, env):
    bundle_dir = env['BUNDLE_DIR']
    print "creating bundle at " + bundle_dir
    if os.path.isdir(bundle_dir):
        shutil.rmtree(bundle_dir)
    os.makedirs(os.path.join(bundle_dir, resource_dir))
    os.makedirs(os.path.join(bundle_dir, framework_dir))
    os.makedirs(os.path.join(bundle_dir, mac_dir))
    if env['BUNDLE_PLUGINS']:
        os.mkdir(os.path.join(bundle_dir, plugin_dir))
    # add binaries
    for bin in env.Flatten(env['BUNDLE_BINARIES']):
        shutil.copy(str(bin), os.path.join(bundle_dir, mac_dir))
    for bin in env.Flatten(env['BUNDLE_PLUGINS']):
        shutil.copy(str(bin), os.path.join(bundle_dir, plugin_dir))
    # add resources
    for resdir in env['BUNDLE_RESOURCEDIRS']:
        # TODO act sensitive to resdir being a scons target.
        # for now assuming a string since we don't use it
        shutil.copytree(str(resdir), os.path.join(bundle_dir, resource_dir))
    # write Info.plist -- TODO actually write it not copy it
    plistFile = env['BUNDLE_PLIST']
    shutil.copy(str(plistFile), os.path.join(bundle_dir, plist_file))
    # add icon -- TODO generate .icns file from png or svg
    iconFile = env['BUNDLE_ICON']
    shutil.copy(str(iconFile), os.path.join(bundle_dir, resource_dir))
    # add dependent libraries, fixing all absolute paths
    if 'BUNDLE_DEPENDENT_LIBS' in env:
        addDependentLibsToBundle(bundleDir)
Exemplo n.º 3
0
def createBundle(target, source, env) :
	bundleDir = env['BUNDLE_NAME']+'.app'
	run("rm -rf "+bundleDir )
	run("mkdir -p %s/Contents/Resources" % bundleDir )
	run("mkdir -p %s/Contents/Frameworks" % bundleDir )
	run("mkdir -p %s/Contents/MacOS" % bundleDir )
	if env['BUNDLE_PLUGINS'] :
		run("mkdir -p %s/Contents/plugins" % bundleDir )
	# add binaries
	for bin in env.Flatten( env['BUNDLE_BINARIES'] ) :
		run('cp %s %s/Contents/MacOS/' % (str(bin), bundleDir) )
	for bin in env.Flatten( env['BUNDLE_PLUGINS'] ) :
		run('cp %s %s/Contents/plugins/' % (str(bin), bundleDir) )
	# add resources
	for resdir in env['BUNDLE_RESOURCEDIRS'] :
		# TODO act sensitive to resdir being a scons target. now assuming a string
		run('cp -r %s %s/Contents/Resources/' % (str(resdir), bundleDir) )
	# clean .svn and CVS files
	run('find %s -name ".svn" -exec  rm -rf {} \;' % bundleDir)
	run('find %s -name "CVS" -exec  rm -rf {} \;' % bundleDir)
	# write Info.plist -- TODO actually write it not copy it
	plistFile = env['BUNDLE_PLIST']
	run('cp %s %s/Contents/Info.plist' % (plistFile, bundleDir) )
	# add icon -- TODO generate .icns file from png or svg
	iconFile = env['BUNDLE_ICON']
	run('cp %s %s/Contents/Resources' % (iconFile, bundleDir) )
	# add dependent libraries, fixing all absolute paths
	addDependentLibsToBundle( bundleDir )
Exemplo n.º 4
0
def createBundle(target, source, env):
    bundleDir = env['BUNDLE_NAME'] + '.app'
    run("rm -rf " + bundleDir)
    run("mkdir -p %s/Contents/Resources" % bundleDir)
    run("mkdir -p %s/Contents/Frameworks" % bundleDir)
    run("mkdir -p %s/Contents/MacOS" % bundleDir)
    if env['BUNDLE_PLUGINS']:
        run("mkdir -p %s/Contents/plugins" % bundleDir)
    # add binaries
    for bin in env.Flatten(env['BUNDLE_BINARIES']):
        run('cp %s %s/Contents/MacOS/' % (str(bin), bundleDir))
    for bin in env.Flatten(env['BUNDLE_PLUGINS']):
        run('cp %s %s/Contents/plugins/' % (str(bin), bundleDir))
    # add resources
    for resdir in env['BUNDLE_RESOURCEDIRS']:
        # TODO act sensitive to resdir being a scons target. now assuming a string
        run('cp -r %s %s/Contents/Resources/' % (str(resdir), bundleDir))
    # clean .svn and CVS files
    run('find %s -name ".svn" -exec  rm -rf {} \;' % bundleDir)
    run('find %s -name "CVS" -exec  rm -rf {} \;' % bundleDir)
    # write Info.plist -- TODO actually write it not copy it
    plistFile = env['BUNDLE_PLIST']
    run('cp %s %s/Contents/Info.plist' % (plistFile, bundleDir))
    # add icon -- TODO generate .icns file from png or svg
    iconFile = env['BUNDLE_ICON']
    run('cp %s %s/Contents/Resources' % (iconFile, bundleDir))
    # add dependent libraries, fixing all absolute paths
    if 'BUNDLE_DEPENDENT_LIBS' in env:
        addDependentLibsToBundle(bundleDir)
Exemplo n.º 5
0
def createBundle(target, source, env) :
	bundleDir = str(target[0])
	print "creating bundle at " + bundleDir
	run("rm -rf '%s'" % bundleDir )
	run("mkdir -p '%s/Contents/Resources'" % bundleDir )
	run("mkdir -p '%s/Contents/Frameworks'" % bundleDir )
	run("mkdir -p '%s/Contents/MacOS'" % bundleDir )
	if env['BUNDLE_PLUGINS'] :
		run("mkdir -p '%s/Contents/plugins'" % bundleDir )
	# add binaries
	for bin in env.Flatten( env['BUNDLE_BINARIES'] ) :
		run("cp '%s' '%s/Contents/MacOS/'" % (str(bin), bundleDir) )
	for bin in env.Flatten( env['BUNDLE_PLUGINS'] ) :
		run("cp '%s' '%s/Contents/plugins/'" % (str(bin), bundleDir) )
	# add resources
	for resdir in env['BUNDLE_RESOURCEDIRS'] :
		# TODO act sensitive to resdir being a scons target. now assuming a string
		run("cp -r '%s' '%s/Contents/Resources/'" % (str(resdir), bundleDir) )
	# write Info.plist -- TODO actually write it not copy it
	plistFile = env['BUNDLE_PLIST']
	run("cp '%s' '%s/Contents/Info.plist'" % (plistFile, bundleDir) )
	# add icon -- TODO generate .icns file from png or svg
	iconFile = env['BUNDLE_ICON']
	run("cp '%s' '%s/Contents/Resources'" % (iconFile, bundleDir) )
	# add dependent libraries, fixing all absolute paths
	if 'BUNDLE_DEPENDENT_LIBS' in env:
            addDependentLibsToBundle( bundleDir )