diff options
| author | Remko Tronçon <git@el-tramo.be> | 2009-11-28 10:19:54 (GMT) | 
|---|---|---|
| committer | Remko Tronçon <git@el-tramo.be> | 2009-11-28 10:19:54 (GMT) | 
| commit | 647213f7c9bdc5b60c863ee56302f380869befe7 (patch) | |
| tree | b4c2e1afbdb1ba96a5afbe8954435153a77ab12b /BuildTools/SCons | |
| parent | bafe5e6d6386f40f254b5da752545b5f9f41d316 (diff) | |
| download | swift-647213f7c9bdc5b60c863ee56302f380869befe7.zip swift-647213f7c9bdc5b60c863ee56302f380869befe7.tar.bz2 | |
Create a dist target for mac DMG bundling.
Diffstat (limited to 'BuildTools/SCons')
| -rw-r--r-- | BuildTools/SCons/Tools/AppBundle.py | 5 | 
1 files changed, 4 insertions, 1 deletions
| diff --git a/BuildTools/SCons/Tools/AppBundle.py b/BuildTools/SCons/Tools/AppBundle.py index 3d06e97..12667f0 100644 --- a/BuildTools/SCons/Tools/AppBundle.py +++ b/BuildTools/SCons/Tools/AppBundle.py @@ -1,49 +1,52 @@  import SCons.Util  def generate(env) :    def createAppBundle(env, bundle, version = "1.0", resources = [], frameworks = [], info = {}) : -    bundleContentsDir = bundle + ".app" + "/Contents" +    bundleDir = bundle + ".app" +    bundleContentsDir = bundleDir + "/Contents"      resourcesDir = bundleContentsDir + "/Resources"      frameworksDir = bundleContentsDir + "/Frameworks"      env.Install(bundleContentsDir + "/MacOS", bundle)      env.WriteVal(bundleContentsDir + "/PkgInfo", env.Value("APPL\77\77\77\77"))      infoDict = {          "CFBundleDevelopmentRegion" : "English",          "CFBundleExecutable" : bundle,          "CFBundleIdentifier" : "im.swift." + bundle,          "CFBundleInfoDictionaryVersion" : "6.0",          "CFBundleName" : bundle,          "CFBundlePackageType" : "APPL",          "CFBundleSignature": "\77\77\77\77",          "CFBundleVersion" : version,          "CFBundleIconFile" : bundle,          "NSPrincipalClass" : "NSApplication",          "NSHumanReadableCopyright" : unichr(0xA9) + " 2009 Swift Development Team.\nAll Rights Reserved."        }      infoDict.update(info)      plist = """<?xml version="1.0" encoding="UTF-8"?>    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">    <plist version="1.0">    <dict>    """      for key, value in infoDict.items() :        plist += "<key>" + key + "</key>\n"        plist += "<string>" + value.encode("utf-8") + "</string>\n"      plist += """</dict>    </plist>    """      env.WriteVal(bundleContentsDir + "/Info.plist", env.Value(plist))      for resource in resources :        env.Install(resourcesDir, resource)      for framework in frameworks :        env.Install(frameworksDir, framework) +    return env.Dir(bundleDir) +    env.AddMethod(createAppBundle, "AppBundle")  def exists(env) :    return env["PLATFORM"] == "darwin" | 
 Swift
 Swift