I have a project with several dependencies that are in various repositories. Each time I commit changes to my project, I make sure I write the revision numbers of all the dependent repositories so that in the event I ever have to come back to this revision (let's call it 5), I can immediately know which revisions of the dependent repositories revision 5 is guaranteed to work with, update the dependencies to the specified revisions, compile and run the project. So for example if I have:
Dep1 @ Revisions 10
Dep2 @ Revisions 20
Dep3 @ Revisions 10
Proj @ Revisions 35
And let's say that when 开发者_Python百科Proj was on revision 17
, the Dep1 revision was 5
, Dep2 revision was 13
and Dep3 revision was 3
. So in my SVN logs, I recorded something like this:
!! Works with Dep1 Rev 5, Dep2 Rev 13, Dep3 Rev 3
To me this seems primitive and makes me believe that there is a better way to do it. Now in one of my other questions, Ivy Dependency Manager has been recommended. I have not looked at it in detail yet (seems complicated and yet another thing I must learn). To me it seems like the log of SVN (and Mercurial etc.) could have been split into Log
and Dependencies (if any)
where the latter could be switched off if there were no dependencies (unless of course I am unaware of an easier/better solution). This would allow for a cleaner log that maybe even warned at each new commit to check the previously defined dependencies again and make sure they have not changed.
So, I was wondering how everyone manages this situations and if you have any tips, techniques, programs, suggestions that you can offer.
Thank you.
Add the dependant repositories as a subproject, submodule, or external depending on whatever your version control system calls it.
That way, you can keep the dependencies in sync as you work on the repository, however, it is still manual.
Even better is to write tests, so that you can automatically determine that the dependency satisfies all the requirements.
How do you compile your dependencies and how connected are they to your project? If they're not part of your project, compile them to .dll (or .jar or whatever) and commit it to your project. You can note the version and any notes in commit comment or a readme file (also commited to your project). And then work with that, and periodically update the dependency .dll.
精彩评论