Skip to content

Commit

Permalink
[FIXED JENKINS-14719] added an option to produce .xcarchive
Browse files Browse the repository at this point in the history
  • Loading branch information
jtligon authored and kohsuke committed Oct 2, 2013
1 parent 5b78bb2 commit 5baf21d
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/main/java/au/com/rayh/XCodeBuilder.java
Expand Up @@ -129,6 +129,10 @@ public class XCodeBuilder extends Builder {
/**
* @since 1.0
*/
public final Boolean generateArchive;
/**
* @since 1.5
**/
public final Boolean unlockKeychain;
/**
* @since 1.4
Expand Down Expand Up @@ -165,13 +169,14 @@ public class XCodeBuilder extends Builder {

// Fields in config.jelly must match the parameter names in the "DataBoundConstructor"
@DataBoundConstructor
public XCodeBuilder(Boolean buildIpa, Boolean cleanBeforeBuild, Boolean cleanTestReports, String configuration,
public XCodeBuilder(Boolean buildIpa, Boolean generateArchive, 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 keychainName, String keychainPath, String keychainPwd, String symRoot, String xcodeWorkspaceFile,
String xcodeSchema, String configurationBuildDir, String codeSigningIdentity, Boolean allowFailingBuildResults,
String ipaName, Boolean provideApplicationVersion, String ipaOutputDirectory) {
this.buildIpa = buildIpa;
this.generateArchive = generateArchive;
this.sdk = sdk;
this.target = target;
this.cleanBeforeBuild = cleanBeforeBuild;
Expand Down Expand Up @@ -487,6 +492,13 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListener lis
xcodeReport.append(", clean: NO");
}
commandLine.add("build");

if(generateArchive){
commandLine.add("archive");
xcodeReport.append(", archive:YES");
}else{
xcodeReport.append(", archive:NO");
}

if (!StringUtils.isEmpty(symRootValue)) {
commandLine.add("SYMROOT=" + symRootValue);
Expand Down Expand Up @@ -522,7 +534,7 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListener lis
if (reportGenerator.getExitCode() != 0) return false;
if (returnCode > 0) return false;
}

// Package IPA
if (buildIpa) {

Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/au/com/rayh/XCodeBuilder/config.jelly
Expand Up @@ -52,6 +52,10 @@
description="Checking this option will prevent this build step from failing if xcodebuild exits with a non-zero return code.">
<f:checkbox title="Yes" />
</f:entry>
<f:entry title="${%Generate Archive?}" field="generateArchive"
description="Checking this option will generate an xcarchive of the specified scheme. A workspace and scheme are are also needed for archives">
<f:checkbox titel="Yes" />
</f:entry>

<f:entry title="${%Configuration}" field="configuration"
description="This is the name of the configuration as defined in the Xcode project.">
Expand Down
@@ -0,0 +1,30 @@
<!--
~ The MIT License
~
~ Copyright (c) 2013 Jeffrey Todd Ligon
~
~ 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>
Checking this option will create an .xcarchive .app found in the build directory.<br/>
An .xcarchive is useful for submission to the app store or third party crash reporters.</br>
You must specify a Scheme to perform an archive.</p>
</div>

0 comments on commit 5baf21d

Please sign in to comment.