ligershark / template-builder

This project will output a NuGet package which can be used to help create Visual Studio Item Templates and Project templates
Other
42 stars 28 forks source link

- fix for multi-project template structure #79

Closed wouterroos closed 8 years ago

wouterroos commented 9 years ago

I put some effort in fixing a project structure issue when creating a multi-project template. If you like/want this for the main version, feel free to pull this code. I have yet to test compatibility with single project templates, but it's a start

sayedihashimi commented 9 years ago

@lynx2504 the build is failing https://ci.appveyor.com/project/sayedihashimi/template-builder/build/1.0.102. Does build.ps1 build successfully on your machine?

wouterroos commented 9 years ago

Sorry, I forgot to set Embed Interop Types to false in the ENVDTE80 reference. It should build now.

sayedihashimi commented 9 years ago

@Reagann what happens if a user adds a new multi-project into a solution that has existing projects? The code here looks like it might move those existing projects around as well.

wouterroos commented 9 years ago

Haven't thought about that, I don't know if it is possible to separate the created projects from the allready existing ones.

wouterroos commented 9 years ago

I added support to exclude existing projects from the restructuring process. I also improved the delete logic of the 'obsolete' solution folder by implementing a delay on another thread so the folder can be deleted after the wizard has finished.

wouterroos commented 9 years ago

@sayedihashimi: Hello, It's been a while and I was wondering if there is any chance that the functionality I developed is going to be merged to the main tree? I worked out the issues mentioned previously and i'm confident this will help a lot of people building better visual studio templates. If there are any concerns about the code, let me know and I will look into it. If there are concerns about the applicability of the code in certain scenarios, we could add a setting (for example with a CustomParameter in the *.vstemplate file) which determines if the functionality should be executed. I look forward to hearing from you.

sayedihashimi commented 9 years ago

Hey @wouterroos I think it may be risky to update the existing RootWizard without testing other multi-project templates. I'd like to get this in though. How about updating the commit to add a new wizard? That way it's easy for users to opt into this new flow.

Thoughts?

wouterroos commented 8 years ago

Ok. any naming preference? I will try to get it in somewhere this week.

sayedihashimi commented 8 years ago

Anything with Wizard at the end should work.

wouterroos commented 8 years ago

I added SolutionWizard.cs containing the restructuring logic to the project and restored RootWizard.cs to its original state. I also altered ChildWizard.cs to check which 'RootWizard' is used and get the $saferootprojectname$ value from that Wizard. Do you have an ETA on when this will be available on NuGet?

wouterroos commented 8 years ago

Any updates on this?

sayedihashimi commented 8 years ago

@wouterroos sorry for the delay, I lost the notification. Too many github emails :)

Thanks for the changes. I've merged the PR and published as version 1.1.4.5-beta. I've also updated SideWaffle to use this latest version.

@wouterroos if you're up for it I think it would be good to add details of how to use this to the SideWaffle wiki. We could either add info about this to the existing multi-project doc or create a new topic.

wouterroos commented 8 years ago

@sayedihashimi Thanks! I will see to it that the wiki will be updated with some relevant information/instructions on how to use the new functionality.

CMewes commented 8 years ago

@wouterroos / @sayedihashimi

Hi, i have created a new Multi-Project Template. This works great but i have this "folder" issue i would like to solve. So i have changed "WizardExtension" in csharp.vstemplate to `

TemplateBuilder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
<FullClassName>TemplateBuilder.SolutionWizard</FullClassName>

`

But if a create a new Project based on the template, it generates the solution but then i got this error: error

Any Idea, why this occurs?

KR Claus

sayedihashimi commented 8 years ago

For multi-project templates I have a new way which is easier to get working see http://youtu.be/ysvTROB963k.