diff options
author | Tobias Markmann <tm@ayena.de> | 2015-05-19 08:47:04 (GMT) |
---|---|---|
committer | Kevin Smith <kevin.smith@isode.com> | 2015-05-19 10:33:54 (GMT) |
commit | ed23f4578d6a5776b77e743ad54802d55f54f7e1 (patch) | |
tree | 36bd0737bf6a9890577baa796858d1ce75b62537 /BuildTools/SCons/Tools/AppBundle.py | |
parent | e86a46545e23ad824d7013c3c57bd83a52ade9af (diff) | |
download | swift-ed23f4578d6a5776b77e743ad54802d55f54f7e1.zip swift-ed23f4578d6a5776b77e743ad54802d55f54f7e1.tar.bz2 |
Consolidate Python and SCons files to tab based indentation
Test-Information:
Verified that SCons still runs on OS X.
Change-Id: I7e9b97f90ee5581a691a959b6f2c999d93e0be53
Diffstat (limited to 'BuildTools/SCons/Tools/AppBundle.py')
-rw-r--r-- | BuildTools/SCons/Tools/AppBundle.py | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/BuildTools/SCons/Tools/AppBundle.py b/BuildTools/SCons/Tools/AppBundle.py index 6a343f6..f1072f5 100644 --- a/BuildTools/SCons/Tools/AppBundle.py +++ b/BuildTools/SCons/Tools/AppBundle.py @@ -1,64 +1,64 @@ import SCons.Util, os.path def generate(env) : - def createAppBundle(env, bundle, version = "1.0", resources = [], frameworks = [], info = {}, handlesXMPPURIs = False) : - 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")) + def createAppBundle(env, bundle, version = "1.0", resources = [], frameworks = [], info = {}, handlesXMPPURIs = False) : + 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) + " 2010 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" - if handlesXMPPURIs : - plist += """<key>CFBundleURLTypes</key> + 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) + " 2010 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" + if handlesXMPPURIs : + plist += """<key>CFBundleURLTypes</key> <array> - <dict> - <key>CFBundleURLName</key> - <string>XMPP URL</string> - <key>CFBundleURLSchemes</key> - <array> - <string>xmpp</string> - </array> - </dict> + <dict> + <key>CFBundleURLName</key> + <string>XMPP URL</string> + <key>CFBundleURLSchemes</key> + <array> + <string>xmpp</string> + </array> + </dict> </array>\n""" - plist += """</dict> - </plist> - """ - env.WriteVal(bundleContentsDir + "/Info.plist", env.Value(plist)) + plist += """</dict> + </plist> + """ + env.WriteVal(bundleContentsDir + "/Info.plist", env.Value(plist)) - for (target, resource) in resources.items() : - env.Install(os.path.join(resourcesDir, target), resource) + for (target, resource) in resources.items() : + env.Install(os.path.join(resourcesDir, target), resource) - for framework in frameworks : - env.Install(frameworksDir, framework) + for framework in frameworks : + env.Install(frameworksDir, framework) - return env.Dir(bundleDir) + return env.Dir(bundleDir) - env.AddMethod(createAppBundle, "AppBundle") + env.AddMethod(createAppBundle, "AppBundle") def exists(env) : - return env["PLATFORM"] == "darwin" + return env["PLATFORM"] == "darwin" |