Re: Advice on code sharing
From: BRM <bm_witness_at_yahoo.com>
Date: Tue, 20 Jan 2009 15:03:31 -0800 (PST)
I've got a similar situation where I've broken things out into shared libraries.
I basically solved it by using a script to pull down the shared library into a special folder. This way the shared library can live wherever and it doesn't bother the project. The script is knowledgeable enough to do checks and exports, and to know the difference between a release tag and the trunk. (It's specific to my repo, so while there is some stuff that would be helpful, there wouldn't be a lot).
So my project exists on its own, without the dependencies checked in under its repo path. It knows about the dependencies through a special file (e.g. dependencies.list.txt) that is read by the script which then pulls the dependencies down to a special folder (e.g. dependencies), and then compiles them as appropriate each then puts its output file (e.g. shared.lib) in a special parallel folder (e.g. dependencies/debug). The project can then link against them by using the special parallel folder in its linker path.
My version is specific to my repository layout and is implemented on Windows using batch files (for Visual Studios) and a Windows Scripting Host JavaScript program to do the heavy lifting.
In the past, I have also done this directly in Makefiles for a CVS repository - where the Makefile would checkout a folder if it didn't exist. Not quite as robust, but also worked very well.
My advice:
- Do something similar with a script. The SVN command-line utilities provide a great interface for scripts that is easy to parse and figure things out. I only used 'svn export/checkout/update/status' and 'svnversion' to do everything SVN related.
Once you work out those, it won't be hard, and it is well worth it.
My biggest issue was that I had to have a script that (a) ran on Windows and (b) would run on any developer's system without requiring them to install anything third-party - so Python, Perl, etc. were all out of question. Windows Scripting Host provided a good system and supports JavaScript and VBScript out of the box, though looking up the latest installed version for the Collabnet SVN command-line utilties was a bit problematic in JavaScript. (Microsoft only documents the VBscript method, and provides no JavaScript examples. I can be done, just a bit harder - namely since I had to query a changing registry path since the version number is in the path.)
Ben
________________________________
Hi
We are trying to handle a situation where we have two simulation packages -- call them SIM1 and SIM2. Each of these are set up as separate projects in a svn repository
It turns out that SIM1 and SIM2 today have much code that is common or share functionality and we are attempting to create a common code share in a new project
We know that you can use the externals property to set up a checkout of SHARE as
One problem is the procedure needed to enable the handling of share. I have the following questions:
I figure someone must have dealt with similar problems before, but I was not able to find information beyond use of the externals property. I appreciate any help from folks.
Kindly,
------------------------------------------------------
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
|
This is an archived mail posted to the Subversion Users mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.