summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-10-18 16:34:16 (GMT)
committerTobias Markmann <tm@ayena.de>2016-10-18 16:34:16 (GMT)
commit02e7140ee68229dcd439f7e333cd3858265cab08 (patch)
tree5d0e46271d3b118564d4b04221f523709497522f
parent51a21158cef39a384c5869c0a0d0b476977bc7a7 (diff)
downloadswift-02e7140ee68229dcd439f7e333cd3858265cab08.zip
swift-02e7140ee68229dcd439f7e333cd3858265cab08.tar.bz2
Auto extend copyright year in app bundles and fix copyright
Test-Information: Build Swift and verified that Info.plist inside Swift.app has the updated year and copyright on macOS 10.12. Change-Id: I84f921edf0b555a102dfb207d8fc3ee5f5f59eb9
-rw-r--r--BuildTools/SCons/Tools/AppBundle.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/BuildTools/SCons/Tools/AppBundle.py b/BuildTools/SCons/Tools/AppBundle.py
index 5f19898..6b7fc8b 100644
--- a/BuildTools/SCons/Tools/AppBundle.py
+++ b/BuildTools/SCons/Tools/AppBundle.py
@@ -1,53 +1,54 @@
import SCons.Util, os.path
+from datetime import date
def generate(env) :
def createAppBundle(env, bundle, version = "1.0", resources = [], frameworks = [], info = {}, handlesXMPPURIs = False, sparklePublicDSAKey = None) :
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" : "(c) 2010 Swift Development Team.\nAll Rights Reserved."
+ "NSHumanReadableCopyright" : "(c) 2010-%d Isode Ltd.\nAll Rights Reserved." % date.today().year
}
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>
</array>\n"""
if sparklePublicDSAKey :
plist += "<key>SUPublicDSAKeyFile</key>"
plist += "<string>" + sparklePublicDSAKey.name.encode("utf-8") + "</string>"
env.Install(resourcesDir, sparklePublicDSAKey)
plist += """</dict>
</plist>