5 Replies Latest reply on Jun 24, 2011 12:17 PM by Cage Sh

    CI problems

    Cage Sh

      I want to test my air application built with FLEX SDK 3.5. Even though I have some warnings: Warning: 'GridCheckBox' has been deprecated.  I can run it or debug it.

       

      Now I write an ANT. But in the build process, application does not run, after the compile. Can any one tell me why?

       

       

       

       

      Below is my build.xml:

      <?xml version="1.0" encoding="utf-8"?>
      <project name="sellsService"
         default="build"
         basedir=".">

      <property name="DEBUG"
           value="true"/>
      <property file="build.properties"/>

      <fail unless="flex.home"
          message="flex.home should be set (in build.properties file)"/>
      <property name="FLEX_HOME"
           value="${flex.home}"/>
      <property name="MXMLC.JAR"
           value="${FLEX_HOME}/lib/mxmlc.jar"/>
      <property name="AUTO_LIB_ROOT"
           value="${FLEX_HOME}/frameworks/libs"/>

      <property name="APP_NAME"
           value="PointOfService"/>

      <property name="PROJECT_ROOT"
           value="${basedir}"/>
      <property name="SOURCE_ROOT"
           value="${PROJECT_ROOT}/src/app/main"/>
      <property name="TEST_SRC_ROOT"
           value="${PROJECT_ROOT}/src/app/main"/>
      <property name="CI_APP_DESCRIPTOR"
           value="${PROJECT_ROOT}/src/app/main/${APP_NAME}-app.xml"/>
      <property name="OUTPUT_ROOT"
           value="${PROJECT_ROOT}/src/app/deploy"/>
      <property name="REPORT_ROOT"
           value="${PROJECT_ROOT}/report"/>
      <property name="LIB_ROOT"
           value="${PROJECT_ROOT}/frameworks/thirdparty/libs"/>
      <property name="SNAPSHOT_SRC_ROOT"
           value="${PROJECT_ROOT}/src/app/main/snapshots"/>

      <!-- Location of the Monkey ant tasks -->
      <path id="libraries">
        <fileset dir="${basedir}/jars2">
         <include name="**/*.jar"/>
        </fileset>
      </path>

      <!-- FlexUnit ant task -->
      <taskdef resource="flexUnitTasks.tasks"
          classpathref="libraries"/>

      <target name="build">
        <antcall target="clean"/>
        <antcall target="init"/>
        <antcall target="setup"/>
        <antcall target="compile"/>
        <antcall target="execute_tests"/>
      </target>

      <target name="clean">
        <delete dir="${OUTPUT_ROOT}"/>
        <delete dir="${REPORT_ROOT}"/>
      </target>

      <target name="init">
        <mkdir dir="${OUTPUT_ROOT}"/>
        <mkdir dir="${REPORT_ROOT}"/>
      </target>

      <target name="setup">
        <copy file="${CI_APP_DESCRIPTOR}"
           todir="${OUTPUT_ROOT}"/>

        <copy todir="${OUTPUT_ROOT}/snapshots">
         <fileset dir="${SNAPSHOT_SRC_ROOT}"/>
        </copy>
      </target>

      <!-- compile the application and tests -->
      <target name="compile">

        <java jar="${MXMLC.JAR}"
           fork="true"
           failonerror="true">
         <jvmarg value="-Xmx512m"/>
         <!-- avoid running out of heap space during compile -->
         <arg value="-debug=true"/>

         <arg value="+flexlib=${FLEX_HOME}/frameworks"/>
         <arg value="+configname=air"/>

         <arg value="-source-path"/>
         <arg value="${SOURCE_ROOT}"/>
         <arg value="${TEST_SRC_ROOT}"/>

         <arg value="-file-specs=${SOURCE_ROOT}/${APP_NAME}.mxml"/>

         <arg value="-includes"/>
         <arg value="FlexMonkeyTestController"/>
        
         <arg value="-includes"/>
         <arg value="delegates.GlassButtonAutomationImpl"/>

         <arg value="-define+=FLEXMONKEY::antRun,true"/>
         <arg value="-define+=FLEXMONKEY::snapshotDirectory,'file://${PROJECT_ROOT}/src/app/deploy/snap shots'"/>
        

         <arg value="-include-libraries+=${LIB_ROOT}/automation_monkey3.x.swc"/>
         <arg value="-include-libraries+=${LIB_ROOT}/flexunit-4.1.0_RC2-28-flex_3.5.0.12683.swc"/>
         <arg value="-include-libraries+=${LIB_ROOT}/flexunit-aircilistener-4.1.0_RC2-28-3.5.0.12683.sw c"/>
         <arg value="-include-libraries+=${LIB_ROOT}/flexunit-cilistener-4.1.0_RC2-28-3.5.0.12683.swc"/ >

         <arg value="-include-libraries+=${AUTO_LIB_ROOT}/automation.swc"/>
         <arg value="-include-libraries+=${AUTO_LIB_ROOT}/automation_agent.swc"/>
         <arg value="-include-libraries+=${AUTO_LIB_ROOT}/automation_dmv.swc"/>
         <arg value="-include-libraries+=${AUTO_LIB_ROOT}/automation_flashflexkit.swc"/>

         <arg value="-output=${OUTPUT_ROOT}/${APP_NAME}.swf"/>
        </java>
      </target>

      <!-- run the tests -->
      <target name="execute_tests">
        <flexunit player="air"
            precompiledAppDescriptor="${OUTPUT_ROOT}/${APP_NAME}-app.xml"
            toDir="${REPORT_ROOT}"
            haltonfailure="false"
            verbose="true"/>

        <junitreport todir="${REPORT_ROOT}">
         <fileset dir="${REPORT_ROOT}">
          <include name="TEST-*.xml"/>
         </fileset>
         <report format="frames"
           todir="${REPORT_ROOT}/html"/>
        </junitreport>
      </target>

      </project>