Sharing a Flex project with a team

April 28, 2009

Recently I've been working on a Flex project with another developer. We use SVN (subversion) and have been committing the entire Flex project to the repository. The problem with this is that any compiler/custom settings you have break as they are stored as part of the project.

The solution that we have come up with is for each developer to...

  1. Create a new Flex project which is outside of your working copy (files & folders that are committed to version control).
  2. Right click on the Flex Project in Flex Builder and select "new -> folder"
  3. Type in "src_svn" for the folder name
  4. Click the "Advanced button"
  5. Tick the "Link to folder in the file system" and browse to the "src" folder in your working copy
  6. Click the "Finish" button
  7. You should now see all the existing mxml files in a folder called "src_svn"
  8. Right click on the project folder in Flex Builder and select "properties"
  9. Select "Flex Build Path" section and change the "Main source folder" from "src" to "src_svn"
  10. Select the "Flex Applications" section
  11. Highlight the projectname.mxml (marked as deleted) and click the Remove button
  12. Click the "Add" button and select the an mxml file from the list
  13. Hightlight the mxml file you just added above and click the "Set as default" button
  14. Click "OK"

That's it, you can now edit the source code (mxml files) under version control but still have your own project settings. You may also want to link to the libs folder the same way you did when creating a new folder.


11 comments

  1. If you are using Subversion, just use the svn:ignore property on the respective files/folders which contain user specific settings. No need to duplicate and link folders.

    Comment by sck – April 28, 2009
  2. That is an interesting approach I hadn't thought of. In my shop we just removed all the project customization stuff from the SVN repository, so it's just the core files, but that has it's own demons as well.

    Comment by Russell Brown – April 28, 2009
  3. I've found it really handy to go the opposite route, committing everything (.project, .actionscriptProperties, etc.) to SVN.

    We then tokenize the properties files with Eclipse resources, making them work across machines. This way, links to things like other projects, external libs, etc., get propagated to developer's workstations as part of their next SVN update.

    Comment by Joe Rinehart – April 28, 2009
  4. The easier way to do this is just to right click on your .project file>>Team>>Add to svn:ignore. You can do this with any files you don't want in the repo, such as the Actionscript.properties and Flex.properties files.

    Comment by TJ Downes – April 28, 2009
  5. The easier way to do this is just to right click on your .project file>>Team>>Add to svn:ignore. You can do this with any files you don't want in the repo, such as the Actionscript.properties and Flex.properties files.

    Comment by TJ Downes – April 28, 2009
  6. I would argue that the only things you don't want in source control are .project files and the bin-debug folder. I have found the easiest way to handle this is to set the svn:ignore property on these files which is working well in my team.

    Comment by Adam Lofts – April 28, 2009
  7. I forgot to mention that you can also go to Window>>Preferences>>Team>>Ignored Resources and set these filters to take effect for every project

    Comment by TJ Downes – April 28, 2009
  8. Thanks for the feedback everyone!

    We have used svn:ignore in the past, but it only takes one developer to forget to set their working copy up and you get the files committed (and downloaded on the next update).

    @TJ - the Window>>Preferences>>Team>>Ignored Resources is a top tip, thanks!

    @Joe - I really like that method. Sorry for being dense but are you using ANT or something to build the properties file?

    Thanks again everyone :)

    Comment by John Whish – April 28, 2009
  9. I've had luck on large teams with the svn:ignore approach and like you said I've had to set up a project all over again because someone forgot to put "ignore". Thanks for offering this as a possible condition. I an think of at least two cases where this could have saved me an hour or two.

    Comment by diamondTearz – April 28, 2009
  10. @diamondTearz, thanks for the comment. Glad I've given some food for thought :)

    Comment by John Whish – April 28, 2009
  11. Any suggestions for ignoring the auto-generated html template content as well. You can't just ignore the whole folder.

    Comment by Tom Schober – October 28, 2009

Leave a comment

If you found this post useful, interesting or just plain wrong, let me know - I like feedback :)

Please note: If you haven't commented before, then your comments will be moderated before they are displayed.