0 Replies Latest reply on Jan 17, 2013 11:48 AM by bwong82

    Problem deleting resources when doing a clean from an ANT build script




      I'm trying to incorporate an ant build script to be used in the FlashBuilder IDE, but I am running into an issue when trying to delete a swc file that is created when running the 'clean' target. 


      I get the error that "Problem Occurred"


      'Deleting files...' has encountered a problem.  Problems encourntered while deleting resources.


      Problems encountered while deleting resources.

      Could not delete 'C:\project_src\trunk\flash\labs\bin\commonUtilities.swc'.

      Problems encountered while deleting files.

      Could not delete: C:\project_src\trunk\flash\labs\bin\commonUtilities.swc.


      This error occurs even when I try to delete by right clicking from the Package Explorer in Flash Builder.  When I try to delete it from Windows Explorer I get an error stating that FlashBuilder.exe is using the file.  This makes me suspect that somehow Flash Builder has locked this file.  In order for the clean to work I need to close FlashBuilder and then reopen it.


      One interesting note, is that once I reopen Flash Builder and if I do a clean/build repeatly just ONLY the swc project it works without fail, BUT once I try to do a full build with the main project, linking does the 'lock' happen.


      This problem does not occur if I am using the default "Flex" in the Builders under the Properties for the project.  It only occurs when I import and use my own build file.


      I'm extremely new to ant and using the flex compiler.  I'm using the <compc> to compile my swc file.  Does the <compc> some how cause FlashBuilder to hold on to the swc file produced?


      Buildfile: C:\project_src\trunk\flash\master-build.xml



            [delete] Deleting C:\project_src\trunk\flash\labs\bin\commonUtilities.swc



      C:\project_src\trunk\flash\master-build.xml:37: Unable to delete file C:\project_src\trunk\flash\labs\bin\commonUtilities.swc


      Total time: 614 milliseconds


      I'm using the following:



          [echo] ANT_HOME: C:/apache-ant-1.8.4

          [echo] flexTasks jar location: C:/apache-ant-1.8.4/lib/flexTasks.jar

          [echo] FLEX_HOME: C:/Program Files (x86)/Adobe/Adobe Flash Builder 4.5/sdks/4.5.0

          [echo] BRANCH_BASE: C:/justice_src/trunk/

          [echo] DEBUG: false



      Here's the target for clean-labs:


      <target name="clean-labs">

            <delete verbose="true" failOnError="true">

                    <fileset dir="${BRANCH_BASE}/flash/labs/bin/" includes="labs.swc" />




      The build target for the swc for the compc part is as follows:


      <compc output="${BRANCH_BASE}/flash/labs/bin/commonUtilities.swc"



                                       incremental="true" >


      The build target for the main project is using <mxmlc> and includes


      <compiler.library-path dir="${BRANCH_BASE}/flash/labs/bin/" append="true">

          <include name="commonUtilities.swc" />



      Does anyone have any idea what is going on? Any thoughts on solutions and workarounds are greatly appreciated.