Skip to content

Instantly share code, notes, and snippets.

@Klug76
Created February 22, 2016 12:37
Show Gist options
  • Save Klug76/49c2887bc5c41fda6fa0 to your computer and use it in GitHub Desktop.
Save Klug76/49c2887bc5c41fda6fa0 to your computer and use it in GitHub Desktop.
Ant: Build my AIR application for iOS and Android
<?xml version="1.0"?>
<flex-config xmlns="http://www.adobe.com/2006/flex-config">
<compiler>
<external-library-path append="true">
<path-element>anes/NativeAds.ane</path-element>
</external-library-path>
</compiler>
</flex-config>
# The location of the Flex SDK.
sdk.root=/Applications/Adobe\ Flash\ Builder\ 4.6/sdks/4.6.0
#change to .exe if you are using windows
bin.ext=
name=ZJokes
certificates.path=/Users/jkapitakis/Library/MobileDevice/Provisioning\ Profiles
ios.provision.path=${certificates.path}/Zoo_Jokes.mobileprovision
ios.certificate.path=${certificates.path}/cert_5Q44UJDZ3W.p12
ios.certificate.password=PASS
android.certificate.path=${certificates.path}/jokes_Android.p12
android.certificate.password=PASS
swf.version = 17
locale=el_GR
<?xml version="1.0" encoding="utf-8"?>
<project default="ios-simulator-launch" name="ZJokes">
<property file="build.properties"/>
<property name="SDK_HOME" value="${sdk.root}"/>
<property name="MXMLC.JAR" value="${SDK_HOME}/lib/mxmlc.jar"/>
<property name="COMPC.JAR" value="${SDK_HOME}/lib/compc.jar"/>
<property name="ADL" value="${SDK_HOME}/bin/adl"/>
<property name="ADT.JAR" value="${SDK_HOME}/lib/adt.jar"/>
<property name="ADT.BIN" value="${SDK_HOME}/lib/adt"/>
<property name="APP_ROOT_DIR" value="."/>
<property name="APP_NAME" value="${name}"/>
<property name="APP_ROOT_FILE" value="${APP_NAME}.swf"/>
<property name="APP_SOURCE_DIR" value="${APP_ROOT_DIR}/src"/>
<property name="MAIN_SOURCE" value="${APP_SOURCE_DIR}/${APP_NAME}.mxml"/>
<property name="APP_SOURCE_DESCRIPTOR" value="${APP_SOURCE_DIR}/${APP_NAME}-app.xml"/>
<property name="APP_DESCRIPTOR" value="${APP_NAME}-app.xml"/>
<property name="NATIVE_EXTENSIONS_DIR" value="anes"/>
<property name="OUTPUT_DIR" value="release"/>
<property name="IPHONE_SIMULATOR_PATH" value="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk"/>
<!-- <property name="IPHONE_SIMULATOR_PATH" value="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk"/> -->
<target name="compile">
<java jar="${MXMLC.JAR}" fork="true" failonerror="true">
<arg value="+flexlib=${SDK_HOME}/frameworks"/>
<arg value="+configname=airmobile"/>
<arg value="-file-specs=${MAIN_SOURCE}"/>
<arg value="-load-config+=ads.config"/>
<arg value="-load-config+=libs.config"/>
<arg value="-swf-version=${swf.version}"/>
<arg value="-output=${OUTPUT_DIR}/${APP_ROOT_FILE}"/>
</java>
<copy filtering="true" file="${APP_SOURCE_DESCRIPTOR}" tofile="${OUTPUT_DIR}/${APP_DESCRIPTOR}" overwrite="true" />
<replace file="${OUTPUT_DIR}/${APP_DESCRIPTOR}">
<replacefilter token="[This value will be overwritten by Flash Builder in the output app.xml]" value="${APP_ROOT_FILE}"/>
</replace>
</target>
<target name="copy-resources">
<mkdir dir="${OUTPUT_DIR}/assets"/>
<copy todir="${OUTPUT_DIR}/assets">
<fileset dir="${APP_SOURCE_DIR}/assets">
<include name="*/*"/>
</fileset>
</copy>
</target>
<target name="build-android" depends="copy-resources, compile">
<exec executable="${SDK_HOME}/bin/adt${bin.ext}" failonerror="true" dir="${OUTPUT_DIR}">
<arg value="-package"/>
<arg value="-target"/>
<arg value="apk"/>
<arg value="-airDownloadURL"/>
<arg value="http://www.amazon.com/gp/mas/dl/android/com.adobe.air"/>
<arg value="-storetype"/>
<arg value="pkcs12"/>
<arg value="-keystore"/>
<arg value="${android.certificate.path}"/>
<arg value="-storepass"/>
<arg value="${android.certificate.password}"/>
<arg value="${APP_NAME}.apk"/>
<arg value="${APP_DESCRIPTOR}"/>
<arg value="${APP_NAME}.swf"/>
<arg value="assets" />
<arg value="-extdir"/>
<arg value="../${NATIVE_EXTENSIONS_DIR}/" />
</exec>
</target>
<target name="ios-simulator-compile" depends="copy-resources, compile">
<exec executable="${SDK_HOME}/bin/adt${bin.ext}" failonerror="true" dir="${OUTPUT_DIR}">
<arg value="-package"/>
<arg value="-target"/>
<arg value="ipa-test-interpreter-simulator"/>
<arg value="-keystore"/>
<arg value="${ios.certificate.path}"/>
<arg value="-storetype"/>
<arg value="pkcs12"/>
<arg value="-storepass"/>
<arg value="${ios.certificate.password}"/>
<arg value="${APP_NAME}.ipa"/>
<arg value="${APP_DESCRIPTOR}"/>
<arg value="${APP_NAME}.swf"/>
<arg value="assets" />
<arg value="-extdir"/>
<arg value="../${NATIVE_EXTENSIONS_DIR}" />
<arg value="-platformsdk" />
<arg value="${IPHONE_SIMULATOR_PATH}" />
</exec>
</target>
<target name="ios-simulator-unistall" depends="ios-simulator-compile">
<exec executable="${SDK_HOME}/bin/adt${bin.ext}" failonerror="false" dir="${OUTPUT_DIR}">
<arg value="-uninstallApp"/>
<arg value="-platform"/>
<arg value="ios"/>
<arg value="-platformsdk" />
<arg value="${IPHONE_SIMULATOR_PATH}" />
<arg value="-device"/>
<arg value="ios-simulator"/>
<arg value="-appid"/>
<arg value="com.zoobytes.jokes"/>
</exec>
</target>
<target name="ios-simulator-install" depends="ios-simulator-unistall">
<exec executable="${SDK_HOME}/bin/adt${bin.ext}" failonerror="true" dir="${OUTPUT_DIR}">
<arg value="-installApp"/>
<arg value="-platform"/>
<arg value="ios"/>
<arg value="-platformsdk" />
<arg value="${IPHONE_SIMULATOR_PATH}" />
<arg value="-device"/>
<arg value="ios-simulator"/>
<arg value="-package"/>
<arg value="${APP_NAME}.ipa"/>
</exec>
</target>
<target name="ios-simulator-launch" depends="ios-simulator-install">
<exec executable="${SDK_HOME}/bin/adt${bin.ext}" failonerror="true" dir="${OUTPUT_DIR}">
<arg value="-launchApp"/>
<arg value="-platform"/>
<arg value="ios"/>
<arg value="-platformsdk" />
<arg value="${IPHONE_SIMULATOR_PATH}" />
<arg value="-device"/>
<arg value="ios-simulator"/>
<arg value="-appid"/>
<arg value="com.zoobytes.jokes"/>
</exec>
</target>
<target name="ios-device" depends="compile, copy-resources">
<exec executable="${SDK_HOME}/bin/adt${bin.ext}" failonerror="true" dir="${OUTPUT_DIR}">
<arg value="-package"/>
<arg value="-target"/>
<arg value="ipa-debug-interpreter"/>
<arg value="-listen"/>
<arg value="7936"/>
<arg value="-provisioning-profile"/>
<arg value="${ios.provision.path}"/>
<arg value="-keystore"/>
<arg value="${ios.certificate.path}"/>
<arg value="-storetype"/>
<arg value="PKCS12"/>
<arg value="-storepass"/>
<arg value="${ios.certificate.password}"/>
<arg value="${APP_NAME}.ipa"/>
<arg value="${APP_DESCRIPTOR}"/>
<arg value="${APP_ROOT_FILE}"/>
<arg value="assets" />
<arg value="-extdir"/>
<arg value="../${NATIVE_EXTENSIONS_DIR}/" />
</exec>
</target>
</project>
<?xml version="1.0"?>
<flex-config xmlns="http://www.adobe.com/2006/flex-config">
<compiler>
<include-libraries append="true">
<library>libs/blooddy_crypto.swc</library>
</include-libraries>
</compiler>
</flex-config>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment