Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SVN and Project Structure Help

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are working on a project that currently will contain 2 modules. For now, we will just call them retail and admin. We are trying to figure out a good way of setting up our repositories so that we can share common codebase betwee nthe 2 modules without it turning into a maintenance nightmare.

We thought that we might be able to use the svn:externals but that is only on a directory level basis and there will be directories that have both shared and module specific resources.

Has anyone had to do something similar that cares to share their experiences and how they approached this? I'm not sure what other information one might require to help, but if you need anything else, ask and I'll see what I can provide.

Thanks.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34839
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gregg,
In CVS, we would put the common code in a separate project and have the other two projects refer to it. Is there any reason you can't do that in SVN. I haven't used it much, but I can't think of any inherent reason it wouldn't work.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jeanne Boyarsky:
Gregg,
In CVS, we would put the common code in a separate project and have the other two projects refer to it. Is there any reason you can't do that in SVN. I haven't used it much, but I can't think of any inherent reason it wouldn't work.


We are currently switching to SVN, and I can tell you: no, there is no reason to not do the same in SVN. In fact that's exactly what I would do.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to both of you. We started discussing that late yesterday. Now, we just have to figure out how to do it. Thanks again.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This may be a silly question, but what is preventing you from putting all the code (both "modules" and the shared code) in the same repository?
 
Vijay Vaddem
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Frank Carver:
This may be a silly question, but what is preventing you from putting all the code (both "modules" and the shared code) in the same repository?


How about organizing in the structure?

http://localhost/yourproject/
http://localhost/yourproject/modules/commonmodule
http://localhost/yourproject/modules/retail
http://localhost/yourproject/modules/admin

Ensure that each module will have its own build scripts
and the retail and admin modules depends on commonmodule
to be build before building them.

This means, the root folder 'yourproject' will call
commonmodule ---> retail ---> admin and so on..

Hope this helps..

Vijay
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Frank Carver:
This may be a silly question, but what is preventing you from putting all the code (both "modules" and the shared code) in the same repository?


Ah, yes, sure, do that! I missed that part of the original question.

As far as I can tell, it's the only way to have atomic commits across module boundaries....
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Don't forget that in SVN tags and branches are just directories. For ease of branching/tagging, setup the structure so that all modules share a common trunk directory:




Ensure that each module will have its own build scripts
and the retail and admin modules depends on commonmodule
to be build before building them.


Exactly! If you are using Eclipse, make each module its own Eclipse project.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic