diff options
author | Jake Petroules <jake.petroules@petroules.com> | 2015-06-09 23:53:05 -0700 |
---|---|---|
committer | Jake Petroules <jake.petroules@petroules.com> | 2015-07-29 19:18:55 +0000 |
commit | ef5992bb58473bca8c019f2eba9faa0048aa0c05 (patch) | |
tree | afa5f222f3d72be13f904b0fdfcdea80a4aaef29 /share/qbs/modules/bundle | |
parent | 248ed3e0e0e809f8994c2e8983db830fbc2bdb21 (diff) |
Add code signing support for OS X and iOS.
Change-Id: Ia85f68692974288780484fa47a896d66f16bc11b
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Diffstat (limited to 'share/qbs/modules/bundle')
-rw-r--r-- | share/qbs/modules/bundle/BundleModule.qbs | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/share/qbs/modules/bundle/BundleModule.qbs b/share/qbs/modules/bundle/BundleModule.qbs index c553946d8..d1dee8e14 100644 --- a/share/qbs/modules/bundle/BundleModule.qbs +++ b/share/qbs/modules/bundle/BundleModule.qbs @@ -426,7 +426,7 @@ Module { condition: qbs.targetOS.contains("darwin") multiplex: true inputs: ["infoplist", "pkginfo", "hpp", - "icns", "resourcerules", "ipa", + "icns", "resourcerules", "compiled_nib", "compiled_storyboard", "compiled_assetcatalog"] outputFileTags: ["bundle", @@ -610,12 +610,36 @@ Module { if (cmd.sources && cmd.sources.length) commands.push(cmd); - if (product.type.contains("application") && product.moduleProperty("qbs", "hostOS").contains("darwin")) { + if (product.moduleProperty("qbs", "hostOS").contains("darwin")) { for (i in bundles) { - cmd = new Command(ModUtils.moduleProperty(product, "lsregisterPath"), - ["-f", bundles[i].filePath]); - cmd.description = "register " + ModUtils.moduleProperty(product, "bundleName"); - commands.push(cmd); + var actualSigningIdentity = product.moduleProperty("xcode", "actualSigningIdentity"); + var codesignDisplayName = product.moduleProperty("xcode", "actualSigningIdentityDisplayName"); + if (actualSigningIdentity) { + // If this is a framework, we need to sign its versioned directory + var subpath = ""; + var frameworkVersion = ModUtils.moduleProperty(product, "frameworkVersion"); + if (frameworkVersion) { + subpath = ModUtils.moduleProperty(product, "contentsFolderPath"); + subpath = subpath.substring(subpath.indexOf(ModUtils.moduleProperty("qbs", "pathSeparator"))); + } + + cmd = new Command(product.moduleProperty("xcode", "codesignPath"), + (product.moduleProperty("xcode", "codesignFlags") || []) + .concat(["--force", "--sign", actualSigningIdentity, + bundles[i].filePath + subpath])); + cmd.description = "codesign " + + ModUtils.moduleProperty(product, "bundleName") + + " using " + codesignDisplayName + + " (" + actualSigningIdentity + ")"; + commands.push(cmd); + } + + if (product.type.contains("application")) { + cmd = new Command(ModUtils.moduleProperty(product, "lsregisterPath"), + ["-f", bundles[i].filePath]); + cmd.description = "register " + ModUtils.moduleProperty(product, "bundleName"); + commands.push(cmd); + } } } |