views:

73

answers:

3

we are currently starting a project involving people on windows and linux and using SVN.

The problem is that people who want to use Visual Studio (2010 for most of them) have problem with the folder structure and the syncing of there project.

they've got ankhsvn (http://ankhsvn.open.collab.net/), they are mapping the project to real folder, so everyone have the good file structure and the solution is on the SVN (we would prefer not to but ankhsvn kind of need it) other people just chekout the project folder under the solution on SVN.

But if someone that is not using SVN add a new file VS doesn't add it automatically and that cause a lot of trouble.

So is our setup right? is there a way to work well with this kind of environment? how would you suggest us to work?

+1  A: 

I would separate my tree structure (maybe completely separate repos) based on your team's makeup or the environment you're targeting.

Everyone needs to have an SVN client - those who can't use AnkhSVN because they are in Eclipse can use something like Tortoise or an SVN plugin for Eclipse. SVN doesn't know or care about the fact that it's tracking your C# or Java or whatever code. If you add a file to your local HDD it will not magically appear inside the repo.

Alex
the problem isn't about comiting to svn but for the visual studio people to have a well synced project when they checkout, actually the file is synced on there HDD but not on there VS project/solution where they got to add it manually every time
djo0012
Can you post a screenshot of your folder structure?
Alex
That's not something you can magically resolve, and it has little to do with version control. A Visual Studio project doesn't automatically contain everything in the folder it is in, and AnkhSVN doesn't automatically add everything it finds to your project file. Instead, the project file (.csproj, .vbproj, etc.) contains a list of files that should be included. Versioning the project file will at least synchronize the project structure among VS users, but other than that, you'd need a tool that can convert between VS and Eclipse projects.
tdammers
the thing is that eclipse project just use the file that are there, it doesn't need to be told which file to use, but VS yes. So I'm searching something that could work on VS so that they could use SVN like pretty much everyone else, but more I search and more I think it's not possible and that VS just work with VS and there is no 'good' way around it.A converter would have to be run at every checkout, for me the result is about the same as manually adding all new file to the VS project, but thank for the help
djo0012
as asked here is the folder structure of the solution http://pastebin.com/7RDUy6ak in eclipse we checkout the folders ourSrc as 2 separate project, in visual studio we checkout the trunk that is the full solution
djo0012
A: 

Maintaining multiple build targets is difficult if you have to update project files for each target. For example, adding a new source file requires updating a Visual Studio project and a makefile.

How about giving CMake a try? It can generate project files for several build environments. We use it at my job to support multiple versions of Visual Studio on either 32 or 64-bit Windows as well as multiple versions of gcc on 32 or 64-bit Linux. Each project (a library or executable) requires maintaining a single CMakeLists.txt file that is used to generate the target project files.

Jaime Soto
I'll have a look a it, but the problem that I see after a really fast checkup of it is that the same problem will happen that is you've got to manually add file in to place (on the HDD and in the cmakelist.txt ) and you've got to generate a solution/project almost every checkout. tell me if I'm wrong (I'd be happy) but it's probably still better than the actual setup
djo0012
You would have to replace any existing makefiles and Visual Studio projects with CMake configuration files. Setting up CMake will require significant work if your project is large. However, it will save you the headache of updating every project file whenever you step up to a new version of Visual Studio or decide to add support for a new platform/compiler. You will need to generate solution/project files after the initial checkout. After that, the solution/project files are regenerated only if there were changes to the CMake files. I think these changes are automatically detected by CMake.
Jaime Soto
ok, so if I understand well (and I'll test it when possible) we wont have to generate the solution/project manually every-time that is done automatically when needed, the only thing that is to be done manually is adding the file in cmakelist.txt that shouldn't be too bad. And for the setup, the project is just starting so it's still very small (a dozen file max and not too much dependency)
djo0012
A: 

I'd say that Cmake is definitely the way to go: it will allow you to maintain only one set of files (the CMakeLists.txt) and you will be able to generate projects for all Visual Studio versions, for Eclipse, Xcode and makefiles for gcc, CC, etc...

In terms of the difficulty of setting up cmake: it's not that much work in most cases. You don't need to specify the list of files to be included, as you mention in your comment to Jaime's answer. You can include (glob) a folder. That way, when new source files are added, they will be included in your solution whenever you refresh it by running the cmake command.

Also having your project in cmake may help setting up a continuous integration framework, such as Hudson. It can monitor your code repository (svn) and call cmake when changes are submitted, build your project, run unit tests.

project(MyNeatProject)

include_directories(h/ hpp/)
file(GLOB_RECURSE _my_src ./c/*.c)
file(GLOB_RECURSE _my_hdr ./h/*.h)
add_library( some_library SHARED ${YBMBS_SRC} ${YBMBS_HDR})
target_link_libraries( some_library dependency1 dependency2)
Mathieu JVL