1 Reply Latest reply: Aug 30, 2011 12:46 PM by Mike Britton RSS

    ANT build file example

    Mike Britton Community Member

      Does anyone have an ANT build file for an ADEP project I could look at?

       

      Thanks!

        • 1. Re: ANT build file example
          Mike Britton Community Member

          Never mind - answered my own question:

           

           

          <project name="Basic Tiles Build" default="dist">
              <property environment="env" />
              <property name="output.dir" value="../../catalogs/Tiles" />

           

              <!--
                  Sets the "mosaic.sdk.dir" using this precedence:
              1. MOSAIC_HOME system environment variable
              2. Relative path that is the grandparent of this script's directory
              -->
              <condition property="mosaic.sdk.dir" value="${env.MOSAIC_HOME}/sdk">
                  <isset property="env.MOSAIC_HOME" />
              </condition>
              <condition property="mosaic.sdk.dir" value="${root.dir}/sdk">
                  <available file="${root.dir}/sdk" type="dir" />
              </condition>
              <condition property="mosaic.sdk.dir" value="${basedir}/../../../../sdk">
                  <available file="${basedir}/../../../../sdk" type="dir" />
              </condition>

           

              <condition property="mosaic.sdk.dir.found">
                  <isset property="mosaic.sdk.dir" />
              </condition>
              <fail message="Failed to find Mosaic SDK" unless="mosaic.sdk.dir.found" />
              <echo message="Mosaic SDK ${mosaic.sdk.dir}" />

           

              <property name="FLEX_HOME" value="${env.FLEX_HOME}" />
              <taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />

           

              <!-- =================================================================== -->
              <!-- Clean                                                               -->
              <!-- =================================================================== -->
              <target name="clean">
                  <delete dir="bin-debug" />
              </target>

           


              <!-- =================================================================== -->
              <!-- Build                                                               -->
              <!-- =================================================================== -->
              <target name="build">
                  <antcall target="-build">
                      <param name="file.name" value="ComplexContextSetGet" />
                  </antcall>
                  <antcall target="-build">
                      <param name="file.name" value="ComplexContextWatcher" />
                  </antcall>
                  <antcall target="-build">
                      <param name="file.name" value="ContextWatcher" />
                  </antcall>
                  <antcall target="-build">
                      <param name="file.name" value="MessageReceiver" />
                  </antcall>
                  <antcall target="-build">
                      <param name="file.name" value="MessageSender" />
                  </antcall>
                  <antcall target="-build">
                      <param name="file.name" value="SetAndGetContext" />
                  </antcall>
                  <antcall target="-build">
                      <param name="file.name" value="RetrieveData" />
                  </antcall>
              </target>
              <target name="-build">
                  <antcall target="compile">
                      <param name="target.dir" value="bin-debug" />
                      <param name="debug" value="true" />
                      <param name="file.name" value="${file.name}" />
                  </antcall>

           

                  <mkdir dir="${output.dir}/${file.name}" />
                  <copy file="bin-debug/${file.name}.swf" todir="${output.dir}/${file.name}" />

           

              </target>

           

              <target name="compile">
                  <mkdir dir="${target.dir}" />
                  <mxmlc file="src/${file.name}.mxml"
                         output="${target.dir}/${file.name}.swf"
                         debug="${debug}"
                         actionscript-file-encoding="UTF-8"
                         keep-generated-actionscript="true"
                         static-rsls="true"
                         fork="true"
                         maxmemory="512m">
                      <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml" />
                      <source-path path-element="src/" />
                      <compiler.include-libraries dir="${mosaic.sdk.dir}/flex/sdks/4.1.0/frameworks/libs" append="true">
                          <include name="mosaic-tile.swc" />
                      </compiler.include-libraries>
                     <includes symbol="mx.managers.systemClasses.MarshallingSupport" />
                      <include-libraries file="${FLEX_HOME}/frameworks/libs/automation/automation.swc" />
                      <include-libraries file="${FLEX_HOME}/frameworks/libs/automation/automation_agent.swc" />
                      <include-libraries file="${FLEX_HOME}/frameworks/libs/automation/qtp.swc" />
                      <include-libraries file="${FLEX_HOME}/frameworks/libs/automation/automation_dmv.swc" />
                      <source-path path-element="${FLEX_HOME}/frameworks" />
                  </mxmlc>
              </target>

           

              <!-- =================================================================== -->
              <!-- Dist                                                                -->
              <!-- =================================================================== -->
              <target name="dist" depends="clean,build" />
              <target name="smoke" depends="build" />
              <target name="all" depends="build" />
          </project>