Svn organization problem

I'm not sure how to organize these projects as they all depend on each other.

It is currently all in the following structure, which is difficult to manage

-trunk
 |-bin - compiled common dlls
 |-lib - static libs for use with common dlls
 |-src - common dll source code
 |-include - headers for common dlls
 |-common.sln - VS 2008 solutions for common dlls
 |-samples
 ||-res - resources for samples
 |||-img
 |||-snd
 ||-c++ - c++ samples for common dlls, tends to double up as tests
 |||-various VS 2008 sample solutions
 ||-py - python versions for some samples
 |||-...
 |-wrappers
  |-python
  ||-bin - compiled python extension dll
  ||-src - source for python wrapper
  -Apps - actaul programs using common dlls, each with its own dir and solution
  |-...

      

This has a number of problems: -1 svn structure is just a bit of a mess, I have no real way to create bracnh for just one application, for example - Release machines for anything is a huge pain because of the file paths used by the application. For example, a python program needs to know where the python extension dll is and where each of the shared DLLs are. These paths are very different from svn from what they will be for release (where they are all similar in the shared directory)

0


a source to share


2 answers


Eurrghh!

Split everything into separate projects / dlls / libraries / artefacts - whatever you want to be named and follow the recommended SVN structure:

/ (root)
  /Application1
    /branch
    /tag
    /trunk
  /Application2
    /branch
    /tag
    /trunk
  /LibraryX
    /branch
    /tag
    /trunk
  /LibraryY
    /branch
    /tag
    /trunk

      

Then, when the application expects one of these libraries or dependencies to be in a directory within that structure, use the svn: external property to pull it in.

For example, if you want the compiled dll from LibraryX to be in a folder named dll in Application1, you need to add the following svn: external property to your repository in / Application 1 /:

svn://repositoryname/LibraryX/buildoutput/ dll

      

When you order Application1, you will receive all of its files, plus it will add a folder called dll to your working copy, which will be extracted from the library XX / buildoutput /

You can also check each project in its own folder and cherry-pick specific files. But this requires a slightly different approach: you will have folders with the same parent folder on your local computer, which you select as follows:



Application1 (checked out from svn://repositoryname/Application1/trunk)
LibraryX (checked out from svn://repositoryname/LibraryX/tag/stable)

      

So, if you want to get a specific file from the LibraryX build output, add:

svn:externals ../LibraryX/build/thelibfile.dll libfile.dll

      

.. as a property of the checked working copy of Application1, and it would pull libfile.dll from LibraryX and put it in the root of the Application1 working directory.

Please note, the main benefit of this is that with tags you can use your applications in specially marked versions of your dependencies. In the example above, the developer can work on the Application1 trunk, but using the stable version of the libraries. When the next stable release of a library is re-tagged, it is simply updated and it will be superimposed on all your developers' machines within their working development copies.

External resources only work for individual files, when you checkout them and link to local working copies, you can't do that directly from the repository, as you can with folders .. yet.

You can only use individual files with subversion 1.6.x version

+3


a source


In general, if you have multiple projects in a subversion repository and obfuscating it, you want to do one of two things:
1) You combine it all into one monolithic project because everyone is working on the same thing, and hence the tags and branches are applicable to everything. This is usually done where the same team is working on all the code, and projects are really just components compiled differently.

2) You split different projects separately, put them in your own repository (or at least split them from the top using your trunk / branch / tag section under that project directory) and create them completely separately and publish them to the repository. in this case, a shared file system or a web server.

In your particular case, everything looks like this: you have two projects, a common set of library code and some users of this code. This way you end up with a top level structure:



  • Applications
  • General
  • Samples (maybe ?!)
  • Packers

Each of them will have their own torso, tags, branch structure under this project directory. each also has a copy of the compiled binary that represents the output of the dependent projects (or refers to the version in the repository), and so you have a formal way of moving forward through the dependencies.

+1


a source







All Articles