Skip to content
Permalink
Browse files

[FIXED JENKINS-14719] added an option to produce .xcarchive

  • Loading branch information...
jtligon authored and kohsuke committed Sep 25, 2013
1 parent 5b78bb2 commit 5baf21de28135977a0633aa08a092182bd60c5b1
@@ -129,6 +129,10 @@
/**
* @since 1.0
*/
public final Boolean generateArchive;
/**
* @since 1.5
**/
public final Boolean unlockKeychain;
/**
* @since 1.4
@@ -165,13 +169,14 @@

// 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;
@@ -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);
@@ -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) {

@@ -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.">
@@ -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.
You can’t perform that action at this time.