Skip to content

Commit

Permalink
added parameter that a custom entitlements can be specified as workar…
Browse files Browse the repository at this point in the history
…ound for #270
  • Loading branch information
renep committed Aug 11, 2016
1 parent 69c9335 commit 3731740
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions Documentation/Parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
12 changes: 12 additions & 0 deletions plugin/src/main/groovy/org/openbakery/signing/Signing.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class Signing {
File keychain
Integer timeout = 3600
String plugin
Object entitlementsFile


/**
Expand Down Expand Up @@ -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*\"(.*)\"/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")


}

}

0 comments on commit 3731740

Please sign in to comment.