Skip to content

Commit

Permalink
Merge pull request #6 from katzj/code-sign-identity
Browse files Browse the repository at this point in the history
Add a field for entering code signing identity
  • Loading branch information
aheritier committed Apr 5, 2012
2 parents d710169 + ea66c65 commit 6af1b04
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/main/java/au/com/rayh/XCodeBuilder.java
Expand Up @@ -129,10 +129,14 @@ public class XCodeBuilder extends Builder {
* @since 1.0
*/
public final String keychainPwd;
/**
* @since 1.3.2
*/
public final String codeSigningIdentity;

// Fields in config.jelly must match the parameter names in the "DataBoundConstructor"
@DataBoundConstructor
public XCodeBuilder(Boolean buildIpa, Boolean cleanBeforeBuild, Boolean cleanTestReports, String configuration, String target, String sdk, String xcodeProjectPath, String xcodeProjectFile, String xcodebuildArguments, String embeddedProfileFile, String cfBundleVersionValue, String cfBundleShortVersionStringValue, Boolean unlockKeychain, String keychainPath, String keychainPwd, String symRoot, String xcodeWorkspaceFile, String xcodeSchema, String configurationBuildDir) {
public XCodeBuilder(Boolean buildIpa, Boolean cleanBeforeBuild, Boolean cleanTestReports, String configuration, String target, String sdk, String xcodeProjectPath, String xcodeProjectFile, String xcodebuildArguments, String embeddedProfileFile, String cfBundleVersionValue, String cfBundleShortVersionStringValue, Boolean unlockKeychain, String keychainPath, String keychainPwd, String symRoot, String xcodeWorkspaceFile, String xcodeSchema, String configurationBuildDir, String codeSigningIdentity) {
this.buildIpa = buildIpa;
this.sdk = sdk;
this.target = target;
Expand All @@ -145,6 +149,7 @@ public XCodeBuilder(Boolean buildIpa, Boolean cleanBeforeBuild, Boolean cleanTes
this.xcodeWorkspaceFile = xcodeWorkspaceFile;
this.xcodeSchema = xcodeSchema;
this.embeddedProfileFile = embeddedProfileFile;
this.codeSigningIdentity = codeSigningIdentity;
this.cfBundleVersionValue = cfBundleVersionValue;
this.cfBundleShortVersionStringValue = cfBundleShortVersionStringValue;
this.unlockKeychain = unlockKeychain;
Expand Down Expand Up @@ -389,6 +394,14 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListener lis
xcodeReport.append(", configurationBuildDir: DEFAULT");
}

// handle code signing identities
if (!StringUtils.isEmpty(codeSigningIdentity)) {
commandLine.add("CODE_SIGN_IDENTITY=" + codeSigningIdentity);
xcodeReport.append(", codeSignIdentity: ").append(codeSigningIdentity);
} else {
xcodeReport.append(", codeSignIdentity: DEFAULT");
}

// Additional (custom) xcodebuild arguments
if (!StringUtils.isEmpty(xcodebuildArguments)) {
String[] parts = xcodebuildArguments.split("[ ]");
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/au/com/rayh/XCodeBuilder/config.jelly
Expand Up @@ -104,6 +104,11 @@
<f:checkbox />
</f:entry>

<f:entry title="${%Code Signing Identity}" field="codeSigningIdentity"
description="Override the code signing identity specified in the project">
<f:textbox />
</f:entry>

<f:entry title="${%Embedded Profile}" field="embeddedProfileFile"
description="The relative path to the mobileprovision to embed, leave blank for no embedded profile">
<f:textbox />
Expand Down
@@ -0,0 +1,33 @@
<!--
~ The MIT License
~
~ Copyright (c) 2011 Ray Yamamoto Hilton
~
~ Permission is hereby granted, free of charge, to any person obtaining a copy
~ of this software and associated documentation files (the "Software"), to deal
~ in the Software without restriction, including without limitation the rights
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
~ copies of the Software, and to permit persons to whom the Software is
~ furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in
~ all copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
~ THE SOFTWARE.
-->

<div>
<p>
Override the code signing identity specified within the project config.

This lets you keep your xcode project setup to build with developer certificates
interactively but put your distribution certificate on the hosts running jenkins
to build your actual releases.
</p>
</div>

0 comments on commit 6af1b04

Please sign in to comment.