diff --git a/CHANGELOG.md b/CHANGELOG.md index 1471d725..a762bc33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# 0.14.2 () + +Changes +* XcodebuildTask and XcodeTestTask can now override the global xcodebuild settings for building for supporting multiproject build +* Added an option that a custom entitlements file can be specified for codesigning + +Note: There is no 0.14.1 version. (Reason is a typo) + # 0.14.0 (July 22, 2016) Changes diff --git a/Documentation/Parameters.md b/Documentation/Parameters.md index c9a874ce..3dff3ff2 100644 --- a/Documentation/Parameters.md +++ b/Documentation/Parameters.md @@ -53,6 +53,10 @@ #### Optional parameters +* entitlementsFile - With this parameter a entitlments file can be specified that is used for codesigning. If empty then the entitlemnts that is embedded in the provisioning file is extracted and used. + + default value: empty + * identity - the signing identity e.g. 'iPhone Developer: Rene Piringer (AASDF1234)'. This parameter is **optional** and only needed if you have more then one identity in the keychain. This is only the case if the _keychain_ parameter is set, and the keychain is not created during the build process. default value: empty diff --git a/plugin/src/main/groovy/org/openbakery/packaging/PackageTask.groovy b/plugin/src/main/groovy/org/openbakery/packaging/PackageTask.groovy index 40463905..79951e5b 100644 --- a/plugin/src/main/groovy/org/openbakery/packaging/PackageTask.groovy +++ b/plugin/src/main/groovy/org/openbakery/packaging/PackageTask.groovy @@ -198,6 +198,11 @@ class PackageTask extends AbstractDistributeTask { } File createEntitlementsFile(File bundle, String bundleIdentifier) { + + if (project.xcodebuild.signing.entitlementsFile != null) { + return project.xcodebuild.signing.entitlementsFile + } + File provisionFile = getProvisionFileForIdentifier(bundleIdentifier) if (provisionFile == null) { if (project.xcodebuild.type == Type.iOS) { diff --git a/plugin/src/main/groovy/org/openbakery/signing/Signing.groovy b/plugin/src/main/groovy/org/openbakery/signing/Signing.groovy index b58db850..3f381b2b 100644 --- a/plugin/src/main/groovy/org/openbakery/signing/Signing.groovy +++ b/plugin/src/main/groovy/org/openbakery/signing/Signing.groovy @@ -21,6 +21,7 @@ class Signing { File keychain Integer timeout = 3600 String plugin + Object entitlementsFile /** @@ -114,6 +115,17 @@ class Signing { } + File getEntitlementsFile() { + if (entitlementsFile != null) { + return project.file(entitlementsFile) + } + return null + } + + void setEntitlementsFile(Object entitlementsFile) { + this.entitlementsFile = entitlementsFile + } + String getIdentity() { def IDENTITY_PATTERN = ~/\s*\d+\)\s*(\w+)\s*\"(.*)\"/ diff --git a/plugin/src/test/groovy/org/openbakery/packaging/PackageTaskSpecification.groovy b/plugin/src/test/groovy/org/openbakery/packaging/PackageTaskSpecification.groovy index ec98f0ea..890d960e 100644 --- a/plugin/src/test/groovy/org/openbakery/packaging/PackageTaskSpecification.groovy +++ b/plugin/src/test/groovy/org/openbakery/packaging/PackageTaskSpecification.groovy @@ -89,6 +89,8 @@ class PackageTaskSpecification extends Specification { mockExampleApp(withPlugin, withSwift, false, true) } + + void mockExampleApp(boolean withPlugin, boolean withSwift, boolean withFramework, boolean adHoc) { String widgetPath = "PlugIns/ExampleTodayWidget.appex" // create dummy app @@ -587,4 +589,22 @@ class PackageTaskSpecification extends Specification { } + + def "use custom entitlements file"() { + given: + + project.xcodebuild.signing.entitlementsFile = "MyCustomEntitlements.plist" + + mockExampleApp(false, false) + packageTask.plistHelper = new PlistHelper(project, new CommandRunner()) + + when: + File entitlementsFile = packageTask.createEntitlementsFile(payloadAppDirectory, "org.openbakery.Example") + + then: + entitlementsFile.path.endsWith("MyCustomEntitlements.plist") + + + } + }