Reputation: 3565
I have a large collection of existing Visual Studio projects/solutions located (due to historical reasons) at <drive>:\Folder\Source\
, which contains all development resources. This location is controlled by Git (hosted in BitBucket.) I'm trying to move to the VS Online (VSTS) and set up the build there.
I'm able to successfully import the BitBucket repository to VSTS, but the problem is that many, many projects reference non-relative paths that include \Folder\Source\
within Include Directories, Linker Directories, Pre- and Post-build events, etc. Obviously, the builds in the cloud fail because the repository is only aware of the contents of Source\
folder.
I can think of two ways how to resolve this:
Change all possible path references in all projects to relative ones. This might not be feasible due to the number of projects and the number of changes required. Also, I don't have control over all projects, so it'd be a significant work to re-do all this stuff.
Move Git working directory two levels up - basically, controlling everything under <drive>
with only <drive>:\Folder\Source\
un-ignored. This should be possible but doesn't look like a clean solution.
What would be really nice and should resolve this issue cleanly, if there'd be a way in VSTS to create two high-level empty folders Folder\Source
and import the repository there. This would mimic the actual structure and make all work as is. Is there a way to do so in VSTS? Any other ways to resolve this problem?
Upvotes: 0
Views: 2080
Reputation: 1999
Proposed solution
A typical build is composed by:
I would suggest you to restructure your projects in order to have to download a single repository (which could also contains no code, only submodules though), that would then download the others repository by mean of submodules contained within it. Also the usage of relative paths is absolutely mandatory.
Additional insight
You could of course run a script that downloads the source code (from several Git repositories) and put it in your desired directories, and then start the building of your project, making it more difficult than it should be.
Note that the problem you are experiencing is not strictly related to VSTS, but to any automatic build system. If you think about it, these systems just act as any person who want to build the application on his machine. Hence you should ask yourself: if I would like to download the source code and compile it, what I would do? The sequence of actions you would take need to be replicated as is on the automatic build system, for example with a script i mentioned above.
Said this, in your case you have convoluted constraints where you need to download files in precise location for no reason. Releasing those constraints would ease a lot the maintenance of the build.
Upvotes: 1