开发者

SVN project folder tree structure vs production folder tree structure

开发者 https://www.devze.com 2023-01-03 10:42 出处:网络
While developing a PHP+JS web application we always try to separate big blocks of code into small modules/components, in order to make these last ones as much reusable as possible in other application

While developing a PHP+JS web application we always try to separate big blocks of code into small modules/components, in order to make these last ones as much reusable as possible in other applications.

Let's say we now have:

  1. the EcommerceApp (an ecommerce main application)
  2. a Server-file-mgr component (a component to view/manage file on server)
  3. a Mylib (a library of useful functions)
  4. a Mailist开发者_JS百科App (another main application to handle mail lists)

...

  • EcommerceApp needs both Server-file-mgr component and Mylib to work
  • Server-file-mgr needs Mylib to work
  • MaillistApp needs both Server-file-mgr component and Mylib to work too.

My idea is to simply structure the SVN project folder tree putting everything at the same level:

trunk/EcommerceApp
trunk/Server-file-mgr
trunk/Mylib
trunk/MaillistApp

But in real life to make these apps to work the folder tree structure must be the following:

EcommerceApp
 |_ Mylib
 |_ Server-file-mgr

MaillistApp
 |_ Mylib
 |_ Server-file-mgr

I mean Mylib and Server-file-mgr needs to be inside the EcommerceApp/MaillistApp folder.

How would you then structure the SVN folder, as I did or in a different/better/smarter way???

EDIT: somoene in the answers below suggested to structure SVN as real life folders, but I would then have on SVN two copies of the same folder, I mean I would have a trunk/EcommerceApp/Mylib and another copy under trunk/MaillistApp/Mylib, how would I keep them synchronized???


I would suggest the second one (as for real live). But i would suggest to create separate "Modules" for MyLib and Server-file-mgr (with their own trunk/tags/branches) if they are used anywhere else than in that product and use svn:externals to link them together. You can handle them as separate libraries.

EDIT:

trunk/
  EcommerceApp
   |_ Mylib
   |_ Server-file-mgr

  MaillistApp
   |_ Mylib
   |_ Server-file-mgr

You could do the following with svn:externals: You have to put them into Project/trunk folder.

Project/
   |_ trunk/
        |_ EcommerceApp (link to MyLib->tags/RELEASE-1.0)
        |_ MaillistApp (link to Server-file-mgr->tags/RELEASE-1.0)
   |_ tags
   |_ branches

MyLib/
   |_ trunk
   |_ tags
       |_ RELEASE-1.0
   |_ branches

Server-file-mgr/
   |_ trunk
   |_ tags
       |_ RELEASE-1.0
   |_ branches

Everytime you are creating a new release of MyLib or Server-file-mgr you can simply change the svn:externals in Project/trunk. So with this you have a separate development for your components.


You could use symbolic links (if you're on linux), if the only requirement is to be able to access them locally from EcommerceApp and MaillistApp directories. SVN is able to store symbolic links correctly.

trunk/EcommerceApp
 |-  Mylib -> ../Mylib
 |-  Server-file-mgr -> ../Server-file-mgr
trunk/Server-file-mgr
trunk/Mylib
trunk/MaillistApp
 |-  Mylib -> ../Mylib
 |-  Server-file-mgr -> ../Server-file-mgr
0

精彩评论

暂无评论...
验证码 换一张
取 消