How to structure a website project in Eclipse
I am starting a web application project that will have Adobe Flex and PHP / MySQL frontend. I have developed a lot of C ++ desktop applications but new to building web applications and in the Eclipse environment. I set up my current project structure in Subversion as:
--MyWebsite
+--tags
+--branches
+--trunk
---index.html
+--images
+--BasicHtmlSubSite
+--PHPServices
+--FlexComponentA
I check out the trunk in E: \ Dev \ Projects \ MyWebSite \ workspace and that directory is also my Eclipse workspace (but I excluded the .metadata folder from Subversion and only check out projects).
So my questions are:
1) Is this a good site structure? Specifically, how closely does my Subversion / Eclipse folder structure reflect the structure of possible folders in htdocs?
2) How do I include index.html (or maybe index.php someday) in an Eclipse project? I tried to put it in a Static HTML project (StaticLandingPage) in the workspace and add a FileSync build action to move it to the root of the web server, but the StaticLandingPage folder will be deployed to the server as well, which I don't want. I just want to be able to deploy a single html file from the project to the htdocs directory.
I must add that I am developing on Windows, with Eclipse Ganymede, Adobe Flash Builder 4, PDT 2.x, Subclipse, FileSync, and a WST plugin (I think it was). I am using XAMPP for a local server.
source to share
This doesn't work at all in Eclipse.
Usually you want your project to be checked out in Eclipse either in a folder or in the root directory /trunk/
. You can obviously organize things better than dragging everything into the trunk, but here's an example:
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 for random files is a pain in Eclipse. Since everything in Eclipse is a project, the rules for the .project
. Therefore, whoever checks your "folder" will have the same project configuration as you, thereby simplifying the development team.
2) Better organized for multiple projects. Instead of having a completely new repository for another web project, you can simply have multiple folders.
source to share
I'm also trying to find a good project structure, but I'm approaching it from a project requirements strategy, not a best practice strategy.
My needs:
- I want to maximize reuse of source code.
- I want the documentation to be in the same repository tree as the project.
- I want multiple projects to rely on shared, stable, verified source libraries.
- I don't want source libraries scattered among multiple repositories.
- I want to keep the trunk clean for easy uploading 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]
source to share