Skip to content

Instantly share code, notes, and snippets.

@beautifycode
Created April 8, 2011 08:51
Show Gist options
  • Save beautifycode/909514 to your computer and use it in GitHub Desktop.
Save beautifycode/909514 to your computer and use it in GitHub Desktop.
Light-weight and clean iOS AIR 2.6 ANT build file. Works, yes.
<?xml version="1.0" encoding="UTF-8"?>
<project default="1. Create directories" name="Deploy AIR 2.6 on iOS">
<tstamp>
<format property="timestamp" pattern="yyyy-MM-dd_HH-mm-ss" />
</tstamp>
<property environment="env." />
<property name="flex_home" location="${env.FLEX_HOME}_AIR26" />
<!--
* When not having an environmental path variable set, use this:
* <property name="flex_home" value="Path/To/Your/Flex-With-AIR2.6-SDK" />
-->
<property name="mxmlc" value="${flex_home}/lib/mxmlc.jar" />
<property name="adt" value="${flex_home}/lib/adt.jar" />
<property name="app_name" value="Sample Application" />
<property name="source_class" value="src/com/beautifycode/sampleapp/Application.as" />
<property name="main_src" value="src" />
<property name="bin_dir" value="bin" />
<property name="assets_dir" value="assets" />
<property name="certificates_dir" value="cert" />
<property name="deploy_dir" value="deploy" />
<property name="libs_dir" value="libs" />
<property name="swf_file" value="${bin_dir}/sampleApp.swf" />
<property name="ios_target" value="ipa-debug" />
<property name="provisioning_file" value="${certificates_dir}/sampleApp.mobileprovision" />
<property name="certificate_file" value="/Users/Marvin/workspace/ios-dev.p12" />
<property name="certificate_pw" value="myPW" />
<property name="ipa_file" value="${deploy_dir}/${app_name}_${timestamp}.ipa" />
<property name="app_descriptor" value="bin/sampleApp-app.xml" />
<target name="1. Create directories">
<mkdir dir="${assets_dir}" />
<mkdir dir="${deploy_dir}" />
<mkdir dir="${bin_dir}" />
<mkdir dir="${libs_dir}" />
<mkdir dir="${certificates_dir}" />
</target>
<target name="2. Compile SWF">
<java jar="${mxmlc}" fork="true" failonerror="true">
<arg value="-debug=false" />
<arg value="-optimize=true" />
<arg value="+flexlib=${flex_home}/frameworks" />
<arg value="+configname=air" />
<arg value="-source-path=src/" />
<arg value="-file-specs=${source_class}" />
<arg value="-output=${swf_file}" />
<arg value="-l+=${libs_dir}" />
</java>
</target>
<target name="3. Package for iOS" depends="2. Compile SWF">
<java jar="${adt}" fork="true" failonerror="true">
<arg line="-package" />
<arg line="-target ${ios_target}" />
<arg line="-storetype pkcs12" />
<arg line="-keystore '${certificate_file}'" />
<arg line="-storepass '${certificate_pw}'" />
<arg line="-provisioning-profile '${provisioning_file}'" />
<arg line="'${ipa_file}'" />
<arg line="'${app_descriptor}'" />
<arg line="'${swf_file}'" />
<arg line="'${assets_dir}/Default.png'" />
<arg line="'${assets_dir}/icons/iOSicon-29.png'" />
<arg line="'${assets_dir}/icons/iOSicon-57.png'" />
<arg line="'${assets_dir}/icons/iOSicon-512.png'" />
</java>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment