ligershark / side-waffle

A collection of Item- and Project Templates for Visual Studio
Other
657 stars 205 forks source link

How to preserve the folder structure? #396

Closed mahima-gopalakrishnan closed 7 years ago

mahima-gopalakrishnan commented 7 years ago

I hope this is not an issue and only needs a minor correction in the templates.

====================Update to my question to add more clarity============== I have a template where I have grouped my source code projects under "src" folder and unit test projects under "test" folder in the file system. So my folder structure in the file system looks like this:

Definitions |CSharp.vstemplate src |ABC |__ABC.csproj, ABC_preprocess.xml, MyTemplate.vstemplate |XYZ |____XYZ.csproj, XYZ_preprocess.xml, MyTemplate.vstemplate test |ABCTest |_____ABCTest.csproj, ABCTest_preprocess.xml, MyTemplate.vstemplate |XYZTest |_____XYZTest.csproj, XYZTest_preprocess.xml, MyTemplate.vstemplate

I am able to successfully template them. When I create a solution from this multi-project template, the "src" and "test" folders are missing in the file system. So the project folders ABC, XYZ, ABCTest and XYZTest are all at the same level. So my folder structure looks like this:

Definitions |CSharp.vstemplate ABC |ABC.csproj, ABC_preprocess.xml, MyTemplate.vstemplate XYZ |XYZ.csproj, XYZ_preprocess.xml, MyTemplate.vstemplate ABCTest |__ABCTest.csproj, ABCTest_preprocess.xml, MyTemplate.vstemplate XYZTest |XYZTest.csproj, XYZTest_preprocess.xml, MyTemplate.vstemplate

The VS solution folders are created successfully. No problem there.

Where am I going wrong? Any help is appreciated.

Lramelot commented 7 years ago

Encountering the same issue, have you found something?

codewithtyler commented 7 years ago

@sayedihashimi can you help answer this one?

sayedihashimi commented 7 years ago

In VS the src and test folders are "solution folders". TemplateBuilder leverages the existing VS template support for the actual template. As far as I know it's not possible out of the box to create solution folders with a .vstemplate. You could support this by creating a custom wizard though. I think the custom wizard could be implemented like:

Lramelot commented 7 years ago

@sayedihashimi I'll go for this solution, many thanks for your support!

codewithtyler commented 7 years ago

@mahima-gopalakrishnan have you tried the solution listed above?

mahima-gopalakrishnan commented 7 years ago

@sayedihashimi "src" and "test" are not solution folders. Actually I'm able to successfully create VS solution folders. You can see that in this pic. The solution has all the solution folders that I wanted.

vs_sln_folders

So in the file system, I'd like the projects under the "Apis", "Business" and "Data" solution folders to be created under a "src" folder because they are source code. And the projects under "Tests" solution folder to be under "tests" folder in the file system.

sayedihashimi commented 7 years ago

@mahima-gopalakrishnan the nodes in VS where you see "Apis", "Business", etc are referred to as "Solution Folders". TemplateBuilder will put the projects in the right location, but in Visual Studio you won't see the folders.

mahima-gopalakrishnan commented 7 years ago

@sayedihashimi True. Apis, Business etc are solution folders. I'm able to successfully create those folders through the template. I was asking about the "src" and "test" folders which are file system folders. Attaching a pic of the folder structure under my multi-project template.

file_sys_folders

When I generate a solution from this template, my folder structure looks like this: sample_sln_file_sys_folders

You can see that all the "src" and "test" folders are missing.

mahima-gopalakrishnan commented 7 years ago

Looks like custom wizard is the only option. Closing the issue.