Re: Project With Reusable Libraries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



John Dlugosz wrote:
Consider a directory tree something like this:

	...
	foo\
	  bar\
	   project-root\
	     app1\
	         contents of app1
	     app2\
	         contents of app2
	     lib1\
	         contents of library 1
	     lib2\
	         contents of library 2


Each project, whether application or library, has its own git repository
already.  A program, say app1, is now dependant on the libraries.  The
libraries are meant to be used in multiple applications.

This is not like what is described under subprojects, since the libs are
not "under" the application, but are peers in the directory structure.
It would be wrong to put lib1 and lib2 as subdirectories of app1 because
they are also used by app2, right?

Then again... if app1 and app2 are not always built as part of the same
set, they might have different versions of the libs specified.  I
understand that the newer versions of msysgit do hard linking so having
multiple repositories for the same thing won't waste disk space, but
still requires fetching to keep them in sync?

Anyway, how would you do it?


If app1 and app2 requires different versions of the same library, I'd
make them separate git projects entirely.

If they have to stay in the same project, I'd put their respective
libraries as a submodule under each app. You could get away without
having to fetch them if you stash the lib projects in the super
project and then link the app project's lib-submodules to the one
in the super-project, but it gets messy when you try to explain
that without some simple means of drawing things, so if you can't
write a "sync-submodules" script, I guess it's not really worth
the problem. Especially if the lib-repositories aren't huge.

--
Andreas Ericsson                   andreas.ericsson@xxxxxx
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux