2 Replies Latest reply on Jan 29, 2010 11:49 AM by archemedia

    Ant compiling

    archemedia Level 4

      Hi,

       

      I started using ant to compile my Flex projects. Ant is super btw!

      I'll have a few problems so I hope someone can help me out.

       

      The first problem I encountered was adding a source path to the compiler.

      Normally, you would do that in the project properties like this:

       

      -locale en_US -source-path=version

       

      where version is a subfolder of the src folder.

       

      I want to take it out of the additional compile field and put it in my ant script, so I use this:

       

      <target name="compile flex project" depends="init">
              <mxmlc file="${SRC_DIR}/OPR.mxml" output="${DEPLOY_DIR}/OPR.swf">
                  <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
                  <source-path path-element="${FLEX_HOME}/frameworks"/>
                 <source-path path-element="${SRC_DIR}/version"/>

              </mxmlc>
      </target>

       

      I also tried:

                 <compiler.source-path path-element="version"/>

       

      In both cases, I got the error:


      Warning: Source path entry, '/Volumes/Data SL/Documents/FLEX WORKSPACES/PRO/OPR/src/version', is a subdirectory of source path entry, '/Volumes/Data SL/Documents/FLEX WORKSPACES/PRO/OPR/src'.

       

      Can anyone help me on this?

       

      Thx,

       

      Dany

        • 1. Re: Ant compiling
          Dexterous

          Hi Dany,

           

          The first method is correct.

           

          But you only need to add another property for the mxmlc node which allows to overlap the source path

           

          allow-source-path-overlap="true"

           

          in your case:

           

          <target name="compile flex project" depends="init">
                  <mxmlc file="${SRC_DIR}/OPR.mxml" output="${DEPLOY_DIR}/OPR.swf"

                        allow-source-path-overlap="true">
                      <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
                      <source-path path-element="${FLEX_HOME}/frameworks"/>
                     <source-path path-element="${SRC_DIR}/version"/>

                  </mxmlc>
          </target>

          1 person found this helpful
          • 2. Re: Ant compiling
            archemedia Level 4

            Thx, dexterous, that was helpful.

            In the mean time, I also handle doc creation. The code looks like this:

             

            <target name="build doc" depends="init">
                    <exec executable="${asdoc.exe}" failonerror="true">
                        <arg line="-doc-sources '${SRC_DIR}'" />
                        <arg line="-warn-level-not-supported=false"/>
                        <arg line="-main-title ${DOC_TITLE}" />
                        <arg line="-window-title ${DOC_TITLE}" />
                        <arg line="-footer ${DOC_FOOTER}" />
                        <arg line="-output '${DOC_DIR}'" />
                    </exec>
                </target>

             

            This works fine but, some of the classes I use are in a library project. With the mxmlc compile target, I managed to add the lib folder through:

            <compiler.library-path dir="${basedir}" append="true">
                            <include name="libs" />
                        </compiler.library-path>

             

            which worked fine. Is there a way  to tell the asdoc compiler to do the same?

             

            Thx,

             

            Dany