Search code examples
svndirectory-structuremodularity

Nested trunks in svn for modules?


Lets say I'm developing a product A which is modular so I have modules B1, B2, B3 which all can build on their own.

I have this SVN structure

svn  
    |-----branches  
    |-----tags  
    |-----trunk
            |-----A
                  |----B1
                       |-----branches
                       |-----tags
                       |-----trunk

Same goes for B2 and B3.

Is this an acceptable way of structuring the SVN folders? or should the B1,B2,B3 perhaps be outside of A's trunk folder? (this way they wouldnt be part of the tags and such)

How would you structure a project like this? - where you have a product with can be built with zero or more modules


Solution

  • Outside, definitely. Like you mentioned, what would a trunk within a tag mean? Structure as:

    svn 
      |--- A
           |--- trunk
           |--- tags
           |--- branches
      |--- B1
           |--- trunk
         ....
    

    and use either SVN externals or your packaging system to pull in the modules. Alternatively, if the modules and the main product are always built and used together, then

    svn 
      |---- A
           |--- trunk
                  |--- B1
                  |--- B2
    

    without a trunk/branches/tags structure for the subprojects does the trick.