build xml file - PDN

<?xml version="1.0" encoding="UTF-8"?>
<!-~ Copyright (c) 2015 and Confidential to Pegasystems Inc. All rights reserved.
-->
<project name="HybridClientCustomizationTooliOS" default="ios">
<path id="libClassPath">
<fileset dir="lib">
<include name="*.jar" />
</fileset>
</path>
<taskdef resource="META-INF/customizationBase.tasks" classpathref="libClassPath"/>
<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask" classpathref="libClassPath" />
<target name="-initializePropertyValues">
<property name="build.platform" value="ios"/>
<property name="app-properties" value="${basedir}/app.properties"/>
<property file="${app-properties}"/>
<property name="customization-xml" value="${basedir}/customization.xml"/>
<xmlproperty file="${customization-xml}" />
<property name="ios.filename" value="HybridClient" />
<property name="ios.bundleDisplayName" value="Pega Hybrid Container" />
<property name="ios.bundleIdentifier" value="com.pega.hybridclient" />
<property name="ios.bundleVersion" value="1.0.0" />
<property name="ios.bundleShortVersionString" value="1.0.0" />
<property name="ios.signerProfile" value="iPhone Distribution: Antenna Software Inc." />
<property name="ios.provisioningProfile" value="default.mobileprovision" />
<property name="ios.keychain" value="" />
<property name="ios.assets.dir" value="${basedir}/HybridClient/HybridClient/Images.xcassets"/>
<property name="ios.assets.splashlogo.dir" value="${ios.assets.dir}/splashlogo.imageset"/>
<property name="ios.info.plist" value="${basedir}/HybridClient/HybridClient/HybridClient-Info.plist"/>
<property name="container.ios.deviceIdentifierType" value="auto" />
<property name="container.ios.supportedIPadScreenOrientations"
value="portrait,portraitUpsideDown,landscapeLeft,landscapeRight" />
<property name="container.ios.supportedIPhoneScreenOrientations"
value="portrait,portraitUpsideDown,landscapeLeft,landscapeRight" />
<property name="container.ios.keepSplashScreenAtStart" value="false" />
<property name="container.ios.applicationQueriesSchemes" value="" />
<property name="bootstrap.config.dir" value="resources/bootstrap" />
<property name="bootstrap.config.js" value="assets/scripts/config.js" />
<property name="bootstrap.branding.dir" value="" />
<property name="bootstrap.string.mode" value="singleapp"/>
<property name="bootstrap.boolean.showLoginScreen" value="false"/>
<property name="bootstrap.boolean.partitioning" value="true"/>
<property name="bootstrap.string.applicationURL" value="undefined"/>
<property name="bootstrap.string.localURL" value="undefined"/>
<property name="bootstrap.string.defaultUsername" value="not_provided"/>
<property name="bootstrap.string.defaultPassword" value="not_provided"/>
<property name="bootstrap.string.gatewayURL" value="undefined"/>
<property name="bootstrap.string.profileService.url" value="undefined"/>
<property name="bootstrap.regexp.profileService.applicationURLFilter" value="undefined"/>
<property name="bootstrap.boolean.multiappFastUpdate" value="false"/>
<property name="bootstrap.number.updateInterval" value="0"/>
<property name="container.applicationURL" value="prepackaged://bootstrap/coreapp.html" />
<property name="container.keepSessionCookies" value="false" />
<property name="container.modules.include" value="*"/>
<property name="container.modules.exclude" value="ClientClipboard,PRPCSnapStart,WebViewDebug"/>
<property name="container.supportedURLSchemes" value=""/>
<property name="container.branding.dir" value="${basedir}/resources/branding"/>
<condition property="container.appkeyVersion" value="1.0.0">
<isset property="container.appkey"/>
</condition>
<property name="container.appkey" value=""/>
<property name="container.appkeyVersion" value=""/>
<condition property="container.log.logLevel" value="${container.ios.defaultLogLevel}">
<isset property="container.ios.defaultLogLevel"/>
</condition>
<condition property="container.log.logToConsole" value="${container.ios.enableASL}">
<isset property="container.ios.enableASL"/>
</condition>
<property name="container.log.logLevel" value="Info"/>
<property name="container.log.logToConsole" value="true"/>
<property name="container.log.logToFile" value="false"/>
<property name="container.log.totalDiskQuota" value="20971520"/>
<property name="container.splashScreenBackground" value="#5F6062"/>
<property name="ios.provisioningProfile.path" location="resources/${ios.provisioningProfile}" />
<property name="cachemanifestupdater.enabled" value="true" />
<property name="cachemanifestupdater.algorithm" value="SHA-256" />
<condition property="-cachemanifestupdater-enabled">
<equals arg1="${cachemanifestupdater.enabled}" arg2="true" />
</condition>
</target>
<macrodef name="plistbuddy">
<attribute name="path" />
<attribute name="cmd" />
<attribute name="failonerror" default="true" />
<sequential>
<exec executable="/usr/libexec/PlistBuddy" failonerror="@{failonerror}" >
<arg value="-c" />
<arg value="@{cmd}" />
<arg value="@{path}" />
</exec>
</sequential>
</macrodef>
<target name="info" depends="-initializePropertyValues" description="Display configuration information">
<echo>Configuration:
Package configuration:
Bundle display name: ${ios.bundleDisplayName}
Bundle identifier: ${ios.bundleIdentifier}
Bundle short version: ${ios.bundleShortVersionString}
Signer profile: ${ios.signerProfile}
Bootstrap configuration:
- Bootstrap directory: ${bootstrap.config.dir}
- Bootstrap config file: ${bootstrap.config.js}
</echo>
<echo>Ruby:</echo>
<exec executable="ruby" failonerror="true">
<arg value="-v" />
</exec>
<exec executable="which" failonerror="true">
<arg value="ruby" />
</exec>
<echo>${line.separator}</echo>
<echo>RubyGems:</echo>
<exec executable="gem" failonerror="true">
<arg value="-v" />
</exec>
<exec executable="which" failonerror="true">
<arg value="gem" />
</exec>
<echo>${line.separator}</echo>
<echo>Rake:</echo>
<exec executable="rake" failonerror="true">
<arg value="--version" />
</exec>
<exec executable="which" failonerror="true">
<arg value="rake" />
</exec>
<echo>${line.separator}</echo>
<echo>Bundler:</echo>
<exec executable="bundle" failonerror="true">
<arg value="--version" />
</exec>
<exec executable="which" failonerror="true">
<arg value="bundle" />
</exec>
</target>
<target name="clean" description="Delete output and temporary directories">
<exec executable="/bin/zsh" failonerror="true" >
<arg value="hybrid_client.sh" />
<arg value="clean" />
</exec>
</target>
<target name="-scriptify-properties" depends="-initializePropertyValues" description="Validate and make selected
properties be parseable in javascript files by adding quotation marks">
<propertyset id="bootstrap-string-properties">
<propertyref regex="^bootstrap.string.*$"/>
</propertyset>
<propertyset id="bootstrap-regexp-properties">
<propertyref regex="^bootstrap.regexp.*$"/>
</propertyset>
<script language="javascript">
<![CDATA[
var ref = project.getReference("bootstrap-string-properties").getProperties();
var propNames = ref.propertyNames();
while(propNames.hasMoreElements()) {
var propName = propNames.nextElement();
var propValue = project.getProperty(propName);
if (propValue != 'undefined' && propValue != 'null') {
project.setProperty(propName, "\"" + propValue + "\"");
}
}
]]>
</script>
<script language="javascript">
<![CDATA[
var ref = project.getReference("bootstrap-regexp-properties").getProperties();
var propNames = ref.propertyNames();
while(propNames.hasMoreElements()) {
var propName = propNames.nextElement();
var propValue = project.getProperty(propName);
if (propValue != 'undefined' && propValue != 'null') {
// /pattern/modifiers = new RegExp(pattern,modifiers)
try {
if (propValue.indexOf("/") !== 0 || propValue.indexOf("/") === propValue.lastIndexOf("/")) {
throw "Valid RegExp object has the format of /pattern/modifiers.";
}
var pattern = propValue.substring(1, propValue.lastIndexOf("/"));
var modifiers = propValue.substring(propValue.lastIndexOf("/")+1);
new RegExp(pattern, modifiers).test("test");
} catch(err) {
echo = AmpClientCustomizationTooliOS.createTask("echo");
echo.setMessage(err);
echo.perform();
project.setProperty("javascript.failed", "Failed when validating properties: "+
"property '"+propName+"' seems to be invalid JavaScript RegExp object.");
break;
}
}
}
]]>
</script>
<fail if="javascript.failed" message="${javascript.failed}" />
</target>
<target name="validate" depends="-initializePropertyValues" description="Validates package and environment
configuration">
<echo>Checking Xcode version</echo>
<exec executable="xcodebuild" outputproperty="ios.xcode.version">
<arg value="-version"/>
</exec>
<property name="ios.xcode.version.pattern" value="^Xcode 8\.2"/>
<condition property="ios.xcode.version.correct">
<matches pattern="${ios.xcode.version.pattern}" string="${ios.xcode.version}"/>
</condition>
<echo message="Xcode version:"/>
<echo message="${ios.xcode.version}"/>
<fail message="Xcode has incorrect version, it must match pattern ${ios.xcode.version.pattern} "
unless="ios.xcode.version.correct" />
<echo>Checking package configuration..."</echo>
<condition property="ios.configured">
<and>
<isset property="ios.bundleDisplayName" />
<isset property="ios.bundleIdentifier" />
<isset property="ios.bundleShortVersionString" />
<isset property="ios.signerProfile" />
</and>
</condition>
<fail message="Invalid packaging configuration!" unless="ios.configured" />
<echo>Checking provisioning profile...</echo>
<condition property="ios.provisioning.profile.configured">
<and>
<available file="${ios.provisioningProfile.path}" />
</and>
</condition>
<fail message="Provisioning profile not found!" unless="ios.provisioning.profile.configured" />
<condition property="container.log.logLevel.configured">
<or>
<equals arg1="${container.log.logLevel}" arg2="Silent" />
<equals arg1="${container.log.logLevel}" arg2="Error" />
<equals arg1="${container.log.logLevel}" arg2="Warning" />
<equals arg1="${container.log.logLevel}" arg2="Info" />
<equals arg1="${container.log.logLevel}" arg2="Debug" />
<equals arg1="${container.log.logLevel}" arg2="Verbose" />
</or>
</condition>
<fail message="The 'container.log.logLevel' parameter must be one of the predefined values."
unless="container.log.logLevel.configured" />
<condition property="container.log.logToConsole.configured">
<or>
<equals arg1="${container.log.logToConsole}" arg2="true"/>
<equals arg1="${container.log.logToConsole}" arg2="false"/>
</or>
</condition>
<fail message="The 'container.log.logToConsole' parameter must be boolean"
unless="container.log.logToConsole.configured" />
<condition property="container.log.logToFile.configured">
<or>
<equals arg1="${container.log.logToFile}" arg2="true"/>
<equals arg1="${container.log.logToFile}" arg2="false"/>
</or>
</condition>
<fail message="The 'container.log.logToFile' parameter must be boolean" unless="container.log.logToFile.configured"
/>
<echo message="Validation completed." />
</target>
<target name="-config-js-exists" depends="-initializePropertyValues, -check-bootstrap-configuration"
if="bootstrap.exists">
<echo message="Checking for config.js..." />
<available file="${bootstrap.config.dir}/${bootstrap.config.js}" property="config.js.exists" />
<echo>config.js exists: ${config.js.exists}</echo>
</target>
<target name="-check-bootstrap-configuration" depends="-initializePropertyValues">
<echo message="Checking for container.applicationURL..." />
<script language="javascript"> <![CDATA[
var applicationURL = project.getProperty("container.applicationURL");
if (applicationURL.startsWith("prepackaged://")) {
project.setProperty("bootstrap.exists", true);
var appPath = new java.io.File(applicationURL.split("://")[1]);
var bootstrapPath = new java.io.File(project.getProperty("bootstrap.config.dir"));
if (!bootstrapPath.isAbsolute()) {
bootstrapPath = new java.io.File(project.getProperty("basedir"), bootstrapPath);
}
var appPath = appPath.getPath().substr(appPath.getPath().indexOf("/"));
var file = new java.io.File(bootstrapPath + "/" + appPath);
if (!file.exists()) {
project.setProperty("javascript.failed", "Failed when retrieving " + file.getAbsolutePath() + ": prepackaged
resource not available.");
}
} else {
var task = HybridClientCustomizationTooliOS.createTask("echo");
task.setMessage("skip bootstrap configuration ...");
task.perform();
}
]]></script>
<fail if="javascript.failed" message="${javascript.failed}" />
</target>
<scriptdef name="validatePrepackaging" language="javascript">
<attribute name="appUrl" />
<![CDATA[
function validatePrepackagedApp(url) {
var appPath = url.substring(("prepackaged://").length);
// Create a <fileset dir="" includes=""/>
var fs = project.createDataType("fileset");
fs.setDir(new java.io.File(project.getProperty("basedir")+"/resources/prepackage"));
fs.setIncludes("**/*.html");
var ds = fs.getDirectoryScanner(project);
var files = ds.getIncludedFiles();
var matchFound = false;
for (var i = 0; i < files.length; ++i) {
if (files[i] == appPath) {
matchFound = true;
break;
}
}
if (!matchFound) {
var fail = project.createTask("fail");
fail.setMessage("Prepackaged app not found for url " + url);
fail.perform();
}
}
var appUrl = attributes.get("appurl");
if (appUrl !== null && appUrl.lastIndexOf("prepackaged", 0) === 0) {
validatePrepackagedApp(attributes.get("appurl"))
}
]]>
</scriptdef>
<target name="validate-bootstrap" depends="-initializePropertyValues, -config-js-exists" if="config.js.exists">
<!-- Check showLoginScreen property -->
<condition property="bootstrap.boolean.showLoginScreen.configured">
<or>
<istrue value="${bootstrap.boolean.showLoginScreen}"/>
<isfalse value="${bootstrap.boolean.showLoginScreen}"/>
</or>
</condition>
<fail message="The 'bootstrap.boolean.showLoginScreen' parameter must be boolean"
unless="bootstrap.boolean.showLoginScreen.configured" />
<!-- Check bootstrap.boolean.partitioning property -->
<condition property="bootstrap.boolean.partitioning.configured">
<or>
<istrue value="${bootstrap.boolean.partitioning}" />
<isfalse value="${bootstrap.boolean.partitioning}" />
</or>
</condition>
<fail message="The 'bootstrap.boolean.partitioning' parameter must be boolean"
unless="bootstrap.boolean.partitioning.configured" />
<!-- Check app mode property -->
<condition property="bootstrap.string.mode.configured">
<or>
<equals arg1="${bootstrap.string.mode}" arg2="singleapp" />
<equals arg1="${bootstrap.string.mode}" arg2="'singleapp'" />
<equals arg1="${bootstrap.string.mode}" arg2="multiapp" />
<equals arg1="${bootstrap.string.mode}" arg2="'multiapp'" />
</or>
</condition>
<fail message="The 'bootstrap.string.mode' parameter must be 'singleapp' or 'multiapp'"
unless="bootstrap.string.mode.configured" />
<!-- Check bootstrap.boolean.multiappFastUpdate property -->
<condition property="bootstrap.boolean.multiappFastUpdate.configured">
<or>
<istrue value="${bootstrap.boolean.multiappFastUpdate}" />
<isfalse value="${bootstrap.boolean.multiappFastUpdate}" />
</or>
</condition>
<fail message="The 'bootstrap.boolean.multiappFastUpdate' parameter must be boolean"
unless="bootstrap.boolean.multiappFastUpdate.configured" />
<!-- Validation of singleapp or multiapp configuration -->
<condition property="provided.applicationURL">
<not>
<or>
<equals arg1="${bootstrap.string.applicationURL}" arg2="undefined" />
<equals arg1="${bootstrap.string.applicationURL}" arg2="null" />
<equals arg1="${bootstrap.string.applicationURL}" arg2="" />
</or>
</not>
</condition>
<condition property="provided.localURL">
<not>
<or>
<equals arg1="${bootstrap.string.localURL}" arg2="undefined" />
<equals arg1="${bootstrap.string.localURL}" arg2="null" />
<equals arg1="${bootstrap.string.localURL}" arg2="" />
</or>
</not>
</condition>
<condition property="provided.defaultUsername">
<not>
<or>
<equals arg1="${bootstrap.string.defaultUsername}" arg2="undefined" />
<equals arg1="${bootstrap.string.defaultUsername}" arg2="null" />
<equals arg1="${bootstrap.string.defaultUsername}" arg2="" />
</or>
</not>
</condition>
<condition property="provided.defaultPassword">
<not>
<or>
<equals arg1="${bootstrap.string.defaultPassword}" arg2="undefined" />
<equals arg1="${bootstrap.string.defaultPassword}" arg2="null" />
<equals arg1="${bootstrap.string.defaultPassword}" arg2="" />
</or>
</not>
</condition>
<condition property="provided.profileServiceUrl">
<not>
<or>
<equals arg1="${bootstrap.string.profileService.url}" arg2="undefined" />
<equals arg1="${bootstrap.string.profileService.url}" arg2="null" />
<equals arg1="${bootstrap.string.profileService.url}" arg2="" />
</or>
</not>
</condition>
<!-- Check whether invalid singleApp mode configuration -->
<condition property="invalid.singleAppModeWithoutAppURL">
<and>
<equals arg1="${bootstrap.string.mode}" arg2="singleapp" />
<isfalse value="${provided.profileServiceUrl}" />
<isfalse value="${provided.applicationURL}" />
</and>
</condition>
<fail if="invalid.singleAppModeWithoutAppURL"
message="In 'singleApp' mode the 'bootstrap.string.applicationURL' property must be specified." />
<!-- Check whether invalid singleApp mode configuration -->
<condition property="invalid.singleAppModeWithoutUser">
<and>
<equals arg1="${bootstrap.string.mode}" arg2="singleapp" />
<isfalse value="${provided.profileServiceUrl}" />
<isfalse value="${bootstrap.boolean.showLoginScreen}"/>
<or>
<isfalse value="${provided.defaultUsername}" />
<isfalse value="${provided.defaultPassword}" />
</or>
</and>
</condition>
<fail if="invalid.singleAppModeWithoutUser"
message="In 'singleApp' without Login Screen the 'defaultUsername' and 'defaultPassword' properties must be
specified." />
<!-- Invalid singleapp with localURL configuration -->
<condition property="invalid.singleAppModeWithLocalURL">
<and>
<istrue value="${provided.localURL}" />
<equals arg1="${bootstrap.string.mode}" arg2="multiapp" />
</and>
</condition>
<fail if="invalid.singleAppModeWithLocalURL"
message="'localURL' parameter works only in 'singleApp' mode." />
<!-- Invalid profile based single app -->
<condition property="invalid.profileBasedSingleAppMode">
<and>
<equals arg1="${bootstrap.string.mode}" arg2="singleapp" />
<istrue value="${provided.profileServiceUrl}" />
<or>
<isfalse value="${bootstrap.boolean.showLoginScreen}"/>
</or>
</and>
</condition>
<fail if="invalid.profileBasedSingleAppMode"
message="In 'singleApp' mode with 'profileService.url' set, 'showLoginScreen' must be set to 'true'."/>
<!-- Check whether invalid multiApp mode configuration -->
<condition property="invalid.multiAppMode">
<and>
<equals arg1="${bootstrap.string.mode}" arg2="multiapp" />
<or>
<isfalse value="${bootstrap.boolean.showLoginScreen}"/>
<isfalse value="${provided.profileServiceUrl}" />
<istrue value="${provided.applicationURL}" />
</or>
</and>
</condition>
<fail if="invalid.multiAppMode"
message="In 'multiApp' mode 'profileService.url' and 'showLoginScreen' must be set, and 'applicationURL' property
should remain undefined."/>
<validatePrepackaging appUrl="${bootstrap.string.applicationURL}" />
<validatePrepackaging appUrl="${bootstrap.string.localURL}" />
<echo message="Bootstrap validation completed." />
</target>
<target name="-update-prepopulated-cachemanifest-ids" depends="-initializePropertyValues" if="-cachemanifestupdaterenabled">
<script language="javascript"> <![CDATA[
// Don't use importClass as it fails on Java 8
var prepackagedir = project.getProperty("basedir")+"/resources/prepackage";
var localUrl = project.getProperty("bootstrap.string.localURL");
if (localUrl && localUrl != 'undefined' && localUrl != 'null') {
localUrl = localUrl.substring(1, localUrl.length()-1); // Trim quotes.
var algorithm = project.getProperty("cachemanifestupdater.algorithm");
var appUrl = localUrl.split(":/")[1];
if (!appUrl.endsWith(".html")) {
appUrl += "/index.html";
}
var file = new java.io.File(prepackagedir + appUrl);
if (file.exists()) {
var task = HybridClientCustomizationTooliOS.createTask("echo");
task.setMessage("Launching cacheManifestUpdater task for index file "+file.getAbsolutePath()+
" with algorithm "+algorithm+"...");
task.perform();
task = HybridClientCustomizationTooliOS.createTask("cacheManifestUpdater");
task.setIndexFile(file);
task.setAlgorithm(algorithm);
task.perform();
project.setProperty("javascript.output", "...updated cache manifest for application: "+localUrl+".");
} else {
project.setProperty("javascript.failed", "Failed when retrieving " + file.getAbsolutePath() + ": prepackaged
resource not available.");
}
} else {
project.setProperty("javascript.output", "Skipping step: localURL not set.");
}
]]>
</script>
<fail if="javascript.failed" message="${javascript.failed}" />
<echo message="${javascript.output}" />
</target>
<target name="-verify-splashscreen-logo" depends="-initializePropertyValues">
<available file="${container.branding.dir}/splashlogo.png" property="container.splashScreen.logo.exists" />
<available file="${container.branding.dir}/[email protected]" property="container.splashScreen.logo.exists" />
<available file="${container.branding.dir}/[email protected]" property="container.splashScreen.logo.exists" />
</target>
<target name="-update-splashscreen-background-colors" depends="-initializePropertyValues"
if="container.splashScreen.logo.exists">
<script language="javascript"> <![CDATA[
var splashScreenHex = project.getProperty("container.splashScreenBackground");
var colorHexRegexResult = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(splashScreenHex);
var colorHexSimplifiedRegexResult = /^#?([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$/i.exec(splashScreenHex);
var defineBackgroundColorsFromRegex = function(regexResult, colorRange){
project.setProperty("-container.splashScreenBackground.red", parseInt(regexResult[1], 16)/colorRange);
project.setProperty("-container.splashScreenBackground.green", parseInt(regexResult[2], 16)/colorRange);
project.setProperty("-container.splashScreenBackground.blue", parseInt(regexResult[3], 16)/colorRange);
}
if(colorHexRegexResult){
defineBackgroundColorsFromRegex (colorHexRegexResult, 255);
}else if(colorHexSimplifiedRegexResult){
defineBackgroundColorsFromRegex (colorHexSimplifiedRegexResult, 15);
}else{
project.setProperty("-container.splashScreenBackground.error", "Invalid splashcreen color property");
}
]]>
</script>
<fail if="-container.splashScreenBackground.error" message="${-container.splashScreenBackground.error}" />
</target>
<target name="-remove-splashscreen-logos" depends="-initializePropertyValues">
<delete>
<fileset dir="${ios.assets.splashlogo.dir}" includes="*.png"/>
</delete>
</target>
<target name="-copy-splashscreen-logos" depends="-remove-splashscreen-logos, -initializePropertyValues"
if="container.splashScreen.logo.exists">
<copy todir="${ios.assets.splashlogo.dir}">
<fileset dir="${container.branding.dir}" includes="splashlogo*.png"/>
</copy>
<scaleImage source="${ios.assets.splashlogo.dir}/[email protected]"
destination="${ios.assets.splashlogo.dir}/splashlogo.png" scale="0.5" override="false"/>
<scaleImage source="${ios.assets.splashlogo.dir}/[email protected]"
destination="${ios.assets.splashlogo.dir}/splashlogo.png" scale="0.33" override="false"/>
<scaleImage source="${ios.assets.splashlogo.dir}/[email protected]"
destination="${ios.assets.splashlogo.dir}/[email protected]" scale="0.66" override="false"/>
<scaleImage source="${ios.assets.splashlogo.dir}/splashlogo.png"
destination="${ios.assets.splashlogo.dir}/[email protected]" scale="2" override="false"/>
<scaleImage source="${ios.assets.splashlogo.dir}/[email protected]"
destination="${ios.assets.splashlogo.dir}/[email protected]" scale="1.5" override="false"/>
<scaleImage source="${ios.assets.splashlogo.dir}/splashlogo.png"
destination="${ios.assets.splashlogo.dir}/[email protected]" scale="3" override="false"/>
</target>
<target name="-remove-launchscreen-images" depends="-initializePropertyValues"
if="container.splashScreen.logo.exists">
<delete>
<fileset dir="${container.branding.dir}" includes="LaunchImage*.png"/>
</delete>
</target>
<target name="-set-splashscreen-plist" depends="-initializePropertyValues" if="container.splashScreen.logo.exists" >
<plistbuddy cmd="Add:UILaunchStoryboardName string &quot;launchScreen&quot;" path="${ios.info.plist}" />
</target>
<target name="-update-splashscreen-plist" depends="-initializePropertyValues">
<plistbuddy cmd="Delete:UILaunchStoryboardName" path="${ios.info.plist}" failonerror="false" />
<antcall target="-set-splashscreen-plist" />
</target>
<target name="-update-splashscreen-view" depends="-initializePropertyValues, -verify-splashscreen-logo, -updatesplashscreen-background-colors, -update-splashscreen-plist, -copy-splashscreen-logos, -remove-launchscreen-images"
if="container.splashScreen.logo.exists">
<echo message="Updating splash screen color: ${container.splashScreenBackground}"/>
<property name="splash-screen-background-xpath" value="//document/objects/view/color"/>
<xmltask source="${basedir}/HybridClient/HybridClient/launchScreen.xib"
dest="${basedir}/HybridClient/HybridClient/launchScreen.xib">
<attr path="${splash-screen-background-xpath}" attr="red" value="${-container.splashScreenBackground.red}"/>
<attr path="${splash-screen-background-xpath}" attr="green" value="${container.splashScreenBackground.green}"/>
<attr path="${splash-screen-background-xpath}" attr="blue" value="${-container.splashScreenBackground.blue}"/>
</xmltask>
</target>
<target name="-ios-build" depends="-initializePropertyValues, clean, validate, validate-bootstrap, -scriptify-properties, update-prepopulated-cachemanifest-ids, -update-splashscreen-view">
<mkdir dir="build" />
<echoproperties destfile="build/ant.properties">
<propertyset>
<propertyref prefix="bootstrap."/>
<propertyref prefix="cachemanifestupdater."/>
<propertyref prefix="container."/>
<propertyref prefix="ios."/>
</propertyset>
</echoproperties>
<condition property="hybridclientsh.bootstrap.arg1" value="-b" else="">
<isset property="bootstrap.exists"/>
</condition>
<condition property="hybridclientsh.bootstrap.arg2" value="${bootstrap.config.dir}" else="">
<isset property="bootstrap.exists"/>
</condition>
<exec executable="/bin/zsh" failonerror="true" >
<arg value="-e" />
<arg value="hybrid_client.sh" />
<arg value="-i" />
<arg value="${container.modules.include}" />
<arg value="-e" />
<arg value="${container.modules.exclude}" />
<arg value="${hybridclientsh.bootstrap.arg1}" />
<arg value="${hybridclientsh.bootstrap.arg2}" />
<arg value="prepare" />
</exec>
<exec executable="bundle" failonerror="true">
<arg value="exec" />
<arg value="rake" />
<arg value="-f" />
<arg value="customize.rb" />
<arg value="ct:archive" />
</exec>
</target>
<target name="ios" depends="-ios-build" description="Customize Pega Hybrid Container for iOS">
<echo message="Final .ipa file: out/${ios.filename}" />
</target>
<include file="build-pega.xml" as="pega"/>
<target name="pega" depends="pega.build-pega"/>
<include file="build-amp.xml" as="amp"/>
<target name="amp" depends="amp.build-amp"/>
</project>