Skip to content

Commit

Permalink
Add a field for entering code signing identity
Browse files Browse the repository at this point in the history
Code signing identities are often something you'd want
to specify differently for an automated build (eg, so your
developers can just have developer certs but jenkins can
set up for distributing builds)
  • Loading branch information
katzj committed Apr 5, 2012
1 parent d710169 commit 7df3f35
Show file tree
Hide file tree
Showing 2 changed files with 19 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 for 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 comments on commit 7df3f35

Please sign in to comment.