Question: How should I organize my source tree?

- J.D. Meier, Jason Taylor, Alex Mackman, Prashant Bansode

Answer

Your source tree structure consists of a combination of folder structure, file structure, and branch structure. Within your Main branch, the following folder and file structure has been proven to work for teams of various sizes:
  • Main – Container for all assets you need in order to ship the product
    • Source – Container for everything you need in order to build
      • Code – Container for source code
      • Shared Code – Container for source code that is shared from other projects
      • Unit Tests – Container for unit tests
      • Lib – Container for binary dependencies
    • Docs – Container for documentation that will ship with the product
    • Installer – Container for installer source code and binaries
    • Builds – Container for team build scripts
    • Tests – Container for test team test cases

Any branches that you create off of Main will copy this folder and file structure into the new branch; for example:
  • Development – Development branch
    • Source – Container for everything you need in order to build
      • Code – Container for source code
      • Shared Code – Container for source code that is shared from other projects
      • Unit Tests – Container for unit tests
      • Lib – Container for binary dependencies
  • Main – Integration branch
    • Source – Container for everything you need in order to build
      • Code – Container for source code
      • Shared Code – Container for source code that is shared from other projects
      • Unit Tests – Container for unit tests
      • Lib – Container for binary dependencies
    • Docs – Container for documentation that will ship with the product
    • Installer – Container for installer source code and binaries
    • Builds – Container for team build scripts
    • Tests – Container for test team test cases

Additional Resources


Last edited Jul 19, 2007 at 12:13 AM by jtaylorsi, version 6

Comments

RichardBerg May 3, 2007 at 9:20 PM 
If the applications all ship together (e.g. the various applications that make up Visual Studio) then you probably want to store them together. In other words, you'd have several different "Code" folders. For applications that have little or nothing to do with each other, you should probably have another layer of folders between Main and Source like you said.

RandyInMarin Apr 26, 2007 at 9:27 PM 
How do you place multiple applications in the same team project? Should there be folders (e.g., App1, App2, etc.) between Main and Source for each application that each contains the Source, Docs, ..., Tests folders? Is the Source folder the location of the solution file(s)?