Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

82 lines (59 sloc) 2.923 kb
Import('build')
import os.path as path, futils, os, zipfile, sys
# Network installable zip files for distribution. We must
# encase this in a builder because the files necessary for zipping
# don't exist when this file is processed.
excludes = ['.pdb', '.exp', '.ilk', '.db', '.gitignore','.psd']
def build_dist_zips(target, source, env):
f = path.join(build.dist_dir, 'runtime-%s.zip' % build.version)
if not(path.isdir(build.dist_dir)):
os.makedirs(build.dist_dir)
print "Packing %s" % f
futils.ZipDir(build.runtime_build_dir, f, exclude=excludes)
for m in build.modules:
f = path.join(build.dist_dir, 'module-%s-%s.zip' % (m.name, m.version))
print "Packing %s" % f
futils.ZipDir(m.build_dir, f, exclude=excludes)
build.env.Append(BUILDERS = {'BuildDistZips' : Builder(action=build_dist_zips)})
zips = build.env.BuildDistZips('#dummy-dist-zips', [])
build.mark_dist_target(zips)
def build_sdk(target, source, env):
sdkZipPath = path.join(build.dist_dir, 'sdk-%s.zip' % build.version)
print "Packing %s " % sdkZipPath
sdkZip = zipfile.ZipFile(sdkZipPath, 'w', zipfile.ZIP_DEFLATED)
sys.path.append(path.join(build.titanium_source_dir, 'build'))
import titanium_version
baseVersion = titanium_version.version
def buildRuntimeZip(file):
relativePath = file.replace(build.runtime_build_dir, '')
zipPath = '/'.join(['runtime', build.os, baseVersion, relativePath])
futils.AddToZip(sdkZip, file, zipPath)
futils.walk_dir(build.runtime_build_dir, buildRuntimeZip, exclude=excludes, dirs=True)
def buildModuleZip(file, module):
relativePath = file.replace(m.build_dir, '')
zipPath = '/'.join(['modules', build.os, module.name, baseVersion, relativePath])
futils.AddToZip(sdkZip, file, zipPath)
for m in build.modules:
futils.walk_dir(m.build_dir, lambda f: buildModuleZip(f, m), exclude=excludes, dirs=True)
def bundleSupport(supportDir):
for file in os.listdir(supportDir):
supportFile = path.join(supportDir, file)
fileExt = os.path.splitext(file)[1]
exclude = fileExt in excludes or file == fileExt
if not exclude and path.isfile(supportFile):
sdkZip.write(supportFile, '/'.join(['sdk', build.os, baseVersion, file]))
supportDir = path.join(build.titanium_source_dir, 'support')
platformSupportDir = path.join(supportDir, build.os)
bundleSupport(supportDir)
bundleSupport(platformSupportDir)
if build.is_win32():
sdkZip.write(os.path.join(build.dir, 'self_extractor.exe'), '/'.join(['sdk', build.os, baseVersion, 'self_extractor.exe']))
futils.ZipDir(path.join(build.dir, 'include'), sdkZip, dest_path='sdk/%s/%s/include' % (build.os, baseVersion))
sdkZip.close()
build.env.Append(BUILDERS = {'BuildSDK' : Builder(action=build_sdk)})
sdk_target = build.env.BuildSDK('#dummy-sdk', [])
build.env.Depends(sdk_target, zips)
build.mark_dist_target(sdk_target)
AlwaysBuild(zips)
AlwaysBuild(sdk_target)
Alias('sdk', sdk_target)
Jump to Line
Something went wrong with that request. Please try again.