SVN misplaces my Flex project-files

A little over a week ago I made a post about Flex running old versions of my SWF. In a nutshell; Flex Builder 3 seemed to disregard any changes I made to the classes in my (Actionscript-only) project, and compile an SWF with older versions of the edited classes.

A few days later however, I concluded that it was not so much Flex 3 that was causing this issue, but rather Subversion.

Whenever I commited my changes to the Subversion-repository, the latest run-files (Main.swf and Main.html) from the bin-debug-folder on my harddisk would be commited to the html-template-folder in the repository.
As the html-template-folder serves as a template-depot (duh) for your Flex project, any files in it will be copied to the bin-debug-folder after compilation, effectively overwriting your freshly compiled SWF in this scenario.

Initially, this may go by unnoticed, as it will not be untill you update your project (or do a new checkout of the same project), that the run-files will be in the html-template-folder.

I work around this issue by commiting, updating, and removing the run-files from the html-template-folder, but I have yet to come across a proper solution for this problem. So any suggestions are more than welcome. The same goes for any explanation about this strange issue with Subversion..

UPDATE:Through the comments someone exlained where this issue is coming from, here’s a quote:

“your bin, bin-debug and html-template directories should *NOT* be committed to svn.

The problem you are having is that it’s copying all of the files in the html-template folder into the bin-debug folder, including the .svn hidden folder. SVN uses the .svn folder to determine where to put the files in the repository, so when you copy that folder, even though it’s in a different folder than when it started, the files will continue to be copied into the original location.”

UPDATE: ..also, if you would like to keep these folders in your SVN-repository nevertheless, here’s what you’ll need to do (credits go to Matthew for this one):

“Goto your project properties and pull up the Flex Compiler tab and the first checkbox you should see says somethign to the effect of “Copy non-embedded files to the output directory”, well uncheck that. This will allow you to keep your bin folders in the repo”

26 thoughts on “SVN misplaces my Flex project-files

  1. ^^^ Ignore my previous post…

    Here’s an easy way to remove .svn files from your Flex project:

    svn ignore: bin, bin-debug, bin-release (I don’t worry about the ‘copy non-embedded assets’ setting).

    Use the (default) html-template folder as before, and make sure it’s in version control. If someone else checks the project out, ‘html-template’ will be there for them too.

    Create a batch file in the root directory of your project, and paste the following lines: (save as “remove_svn.bat”)

    IF EXIST %~dp0\bin FOR /F “tokens=*” %%G IN (‘DIR /B /AD /S %~dp0\bin\*.svn*’) DO RMDIR /S /Q “%%G”
    IF EXIST %~dp0\bin-debug FOR /F “tokens=*” %%G IN (‘DIR /B /AD /S %~dp0\bin-debug\*.svn*’) DO RMDIR /S /Q “%%G”
    IF EXIST %~dp0\bin-release FOR /F “tokens=*” %%G IN (‘DIR /B /AD /S %~dp0\bin-release\*.svn*’) DO RMDIR /S /Q “%%G”

    This removes (recursively) all the .svn folders (and children) from: bin, bin-release, and bin-debug ONLY IF those folders are present.

    Run the batch file before committing/updating to keep your project clean.

Comments are closed.