R – How to structure a website project in Eclipse

eclipseflexbuilderproject-structure

I am starting a web application project that will have an Adobe Flex front-end and a PHP/MySQL back-end. I've developed a lot of C++ desktop applications, but am new to building web applications, and to the Eclipse environment. I have set up my current project structure in Subversion as:

--MyWebsite
  +--tags
  +--branches
  +--trunk
       ---index.html
       +--images
       +--BasicHtmlSubSite
       +--PHPServices
       +--FlexComponentA

I check out trunk into E:\Dev\Projects\MyWebSite\workspace, and that directory is also my Eclipse Workspace (but I excluded the .metadata folder from Subversion, and only check in the projects).

So my questions are:

1) Is this a good site structure? Specifically, how closely should my Subversion/Eclipse folder structure mirror the eventual folder structure in htdocs?

2) How do I include index.html (or maybe index.php someday) in an Eclipse project? I've tried putting it in a Static HTML project (StaticLandingPage) under the workspace, and adding a FileSync build action to move it to the root of the webserver, but the StaticLandingPage folder gets deployed to the server too, which I don't want. I just want to be able to deploy a single html file from within a project to the htdocs directory.

I should add that I'm developing on Windows, with Eclipse Ganymede, Adobe Flash Builder 4, PDT 2.x, Subclipse, FileSync, and the WST plugin (I think it was). I'm using XAMPP for a local server.

Best Answer

This doesn't work well in Eclipse at all.

You usually want your project checked into Eclipse either in a folder or at the root of your /trunk/. You can obviously organize things better than shoving everything into trunk, but here's an example anyway:

Example:

tags
branches
trunk
   |- MyProject (Eclipse project)
   |      |- php/html/js/whatever files
   |
   |- MyOtherProject (Eclipse project)
   |      |- php/html/js/whatever files
   |
   |- ThirdParty (Also an Eclipse project)
          |- All third party libraries that are shared, if you so wish

Why?

1) Checking out random files is a pain in Eclipse. Since everything in Eclipse is a project, the .project file rules. Therefore, whoever checks out your "folder" will have the same project configuration as you do, thus making it easier on the development team.

2) Better organized for multiple projects. Rather than have a completely new repository for another Web Project, you can just have multiple folders.