views:

586

answers:

2

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.

+1  A: 

I'm also trying to find a good project structure, but am approaching it from a project requirements strategy rather than a best-practices strategy.

My needs are:

  1. I want to maximize reuse of source code.
  2. I want documentation to reside in the same repository tree as the project.
  3. I want multiple projects to draw upon common, stable, tested source libraries.
  4. I don't want source libraries scattered among multiple repositories.
  5. I want to keep the trunk pristine for easy upload to public distribution sites.

The structure that works best for me is as follows:

-- ROOT
--- README.HTML
+-- trunk
... --- index.html
... +-- glue
... +-- topic[s]
+-- tags
... +-- library_version[s]
+-- branches
... +-- development
... ... +-- topic[s]
... ... ... --- eclipse .project
... ... ... --- eclipse .texlipse
... ... ... --- topic.pdf
... ... ... +-- design
... ... ... ... --- topic.tex
... ... ... ... +-- reuse
... ... ... ... +-- sections
... ... ... ... +-- implementation
... ... ... ... ... --- eclipse .project
... ... ... ... ... --- source.*
... ... ... ... ... +-- contrib[s]
... ... ... ... ... ... --- contrib.oem 
... ... ... ... ... +-- flavor[s]
... ... ... ... ... ...  --- eclipse or other project files
... +-- rfcs
... ... +-- topic[s]
... +-- published_topics
... ... +-- glue
... ... +-- topic[s]
SmileAndNod
Getting this to works relies on a bit of magic borrowed from http://stackoverflow.com/questions/513697/how-to-set-up-multiple-source-folders-within-a-single-eclipse-project/513762#513762Basically, for each checkout directory (dev, pub or rfc), I have an eclipse worksace (eclipse.dev, eclipse.pub and eclipse.rfc). Each has a list of the relevant repositories, along with a single external project rooted inthe checkout root (Development, RFC, or published). When I check topics out, I pick the option: check out as a folder in an existing project.
SmileAndNod
You may want to look in to Team ProjectSets for manging multiple projects
Thorbjørn Ravn Andersen
+1  A: 

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.

Malaxeur