jfarrell | 1f78987 | 2014-03-11 22:21:07 -0400 | [diff] [blame] | 1 | <project name="tutorial" default="dist" basedir="."> |
| 2 | |
| 3 | <description>Thrift actionscript 3.0 tutorial.</description> |
| 4 | |
| 5 | <property name="gen" location="gen-as3" /> |
| 6 | <property name="src" location="src" /> |
| 7 | <property name="thrift.src" location="../../lib/as3/src/" /> |
| 8 | <property name="dist" location="dist" /> |
| 9 | |
| 10 | <property name="final.name" value="as3-tutorial" /> |
| 11 | <property name="swf.name" value="${dist}/${final.name}.swf" /> |
| 12 | |
| 13 | <target name="flex.check" unless="FLEX_HOME"> |
| 14 | <fail message='You must set the FLEX_HOME property pointing to your flex SDK, eg. ant -DFLEX_HOME="/Applications/Adobe Flex Builder 3/sdks/3.2.0"'/> |
| 15 | </target> |
| 16 | |
| 17 | <target name="flex.init" depends="flex.check" unless="flex.finished"> |
| 18 | <taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" /> |
| 19 | <property name="flex.finished" value="true"/> |
| 20 | </target> |
| 21 | |
| 22 | <target name="init"> |
| 23 | <tstamp /> |
| 24 | <mkdir dir="${dist}"/> |
| 25 | </target> |
| 26 | |
| 27 | <target name="dist" depends="generate, flex.init, init"> |
| 28 | <mxmlc output="${swf.name}" file="${src}/CalculatorUI.as"> |
| 29 | <source-path path-element="${gen}" /> |
| 30 | <source-path path-element="${src}" /> |
| 31 | <source-path path-element="${thrift.src}" /> |
| 32 | </mxmlc> |
| 33 | </target> |
| 34 | |
| 35 | <target name="generate"> |
| 36 | <!-- Generate the thrift gen-java source --> |
| 37 | <exec executable="../../compiler/cpp/thrift" failonerror="true"> |
| 38 | <arg line="--gen as3 ../shared.thrift"/> |
| 39 | </exec> |
| 40 | <exec executable="../../compiler/cpp/thrift" failonerror="true"> |
| 41 | <arg line="--gen as3 ../tutorial.thrift"/> |
| 42 | </exec> |
| 43 | </target> |
| 44 | |
| 45 | <target name="clean"> |
| 46 | <delete dir="${gen}"/> |
| 47 | <delete dir="${dist}" /> |
| 48 | </target> |
| 49 | |
| 50 | </project> |