Jump to content

XLinks and Project Structure


dcameron

Recommended Posts

What's the best way to organize projects with shared dependencies?

Here's a sample scenario:

Project1 and Project2 both have a dependency on Lib1 and Lib2

Lib1 also has a dependency on Lib2

I need to be able to have TeamCity check this out and build it, too.

I have not been able to successfully create xlinks to solve this.

Whenever I use xlinks, I always end up in a situation where it tells me there's a change for Project1.csproj, but when I attent to commit it, it tells me there is no change. If I attempt to update, then it tells me there is a change pending.

Link to comment
Share on other sites

Hi,

I just keep my projects and components as separate visual studio projects (each in a separate plastic workspace + repository) and add them as existing projects in various visual studio workspaces to the project that needs them. No Xlinks required.

That way i can debug and edit the depenencies and also check them in nicely into their own plastic workspaces & repo's.

But i do not use teamcity so do not know it's constraints.

regards

Link to comment
Share on other sites

What's the best way to organize projects with shared dependencies?

I would say Xlinks.

Here's a sample scenario:

Project1 and Project2 both have a dependency on Lib1 and Lib2

Lib1 also has a dependency on Lib2

I need to be able to have TeamCity check this out and build it, too.

If you don't generate repository loops with the xlinks there should not be any problem.

I have not been able to successfully create xlinks to solve this.

Whenever I use xlinks, I always end up in a situation where it tells me there's a change for Project1.csproj, but when I attent to commit it, it tells me there is no change. If I attempt to update, then it tells me there is a change pending.

This is a little bit strange, does it appear as changed in the pending changes view? Can you try in a branch new workspace? I'm available to have an online meeting to check this behavior.

Link to comment
Share on other sites

I have my repos back to normal now, and here's where I'm at:

C.csproj depends on UT.csproj and CP.csproj

main.csproj depends on C.csproj, UT.csproj, and CP.csproj (and 5 more projects)

I added my xlinks to project C, checked them in, then did an update to get the xlinked projects.

I added all 8 projects to the solution in VS, then made project-references.

I always end up with a problem that forces me to delete my workspaces and repos and start over.

Link to comment
Share on other sites

I don't think I'm creating any loops.

mainproj

--subproj1(xlink)

----subproj7(xlink)

----subproj8(xlink)

--subproj2(xlink)

----subproj8(xlink)

--subproj3(xlink)

--subproj4(xlink)

--subproj5(xlink)

--subproj6(xlink)

--subproj7(xlink)

--subproj8(xlink)

Link to comment
Share on other sites

Nop, there're no loops but you are loading the same repository several times, which is not allowed.

The subproj8 repository is loaded 3 times by the mainproj, subproj1 and subproj2 repositories.

Is not possible to remove the subproj1 and subproj2 references and reuse the one you have in mainproj?

Link to comment
Share on other sites

Well, you are able by adding the project reference. Right click in the project -> Add reference -> In the "Projects" tab select the one you are going to reuse.

I think it's going to be:

1) Faster to compile.

2) Cleaner

3) You avoid duplicated projects and code.

Link to comment
Share on other sites

  • 4 months later...

Hello,

 

we are currently evaluating several source code revision control systems to decide which we will use in the future.

Beside some little bugs Plastic SCM seemed to be the best choice, but today I found this topic whit the following statement:

 

... you are loading the same repository several times, which is not allowed.

 

For me it seems to be a bug or at least one major limitation.

Is that really intented?

 

Regards

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

Hi,

 

At the moment is not possible to create a Xlink to a directory inside a linked repo. As a workaround, you can use cloaking rules to avoid updating some directories to your workspace.

 

From de documentation:

 

Through a submenu, these options offer to modify a cloaked list, by adding or removing an entry for each selected item. Cloaked items are items that the update operation won't download by default from the repository to the workspace. Download can be forced using the update forced operation instead. This is convenient in some scenarios, for instance when there are big files in the repository that are updated often, but you don't really work with them, so you prefer to skip downloading those cloaked files every time you switch the workspace to a different branch or do an update of the workspace.

Cloaked items are defined as entries in file named cloaked.conf. 

 

Regards,

Carlos

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...