Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best practice for saving libraries from their actual projects

For some educational reasons I've started a while ago to build my own library. It started out as a simple library with some usable classes, but as it still grows everyday and I've been using it already in some of the projects, it began to be impossible to keep track of the changes, since I wasn't using SVN.

Now I've started using SVN I wanted to add the library as well as projects to different SVN repository. One for every project (as the library is a project too).

What is the best practise to save my library apart from the project? Every project has a /library/ directory which holds all kind of libraries in it. So whats my best practise to follow:

  • I could add the /library/framework/ directory and set it on ignore in the project SVN and then checkout the library in that directory (is this even possible?)
    • Pro: Every project has its own framework, if the framework might change it won't break any code in the project.
    • Con: If I have like 100 projects and they all need a essential update (security wise), i have to update all of them manually.
  • I also could checkout the library somewhere on the server and symlink the /library/framework/ directory after ignoring it in the project svn.
    • Pro: One update will fix all projects in case of an essential update.
    • Con: As said above: one update will fix / change all projects...
    • Con: What if the project needs to be setup to another server (not mine...)

Anyone having any thoughts?

like image 757
Niels Avatar asked Oct 10 '22 04:10

Niels


1 Answers

I usually use svn externals for this. So i would create the library dir in the project then add externals definitions for separate libraries and components.

This doesnt necessarily address your question of updating multiple projects, but IMO thats a separate issue that can be handled through automation and doesnt come into play when we are talking organization/versioning/development.

like image 80
prodigitalson Avatar answered Oct 13 '22 00:10

prodigitalson