ligershark / side-waffle

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

pecan-waffle video #379

Closed sayedihashimi closed 5 years ago

sayedihashimi commented 8 years ago

FYI last week I made a video of creating vs templates with pecan-waffle https://youtu.be/ysvTROB963k.

If you're working on a multi-project template and having a hard time, I suggest you try pecan-waffle.

QHQuach commented 8 years ago
  1. Just to make sure, at some point of the video, I guess you are referencing to the below line of code in ps1 to do folder exclusion?

    $templateInfo | exclude-folder '.vs', 'artifacts', 'package', 'bin', 'obj'

  2. Does this method support including files/folders at solution level (e.g. readme.md, global.json for ASP.NET core version specifier)?

Thanks for quick reply.

sayedihashimi commented 8 years ago

For solution level files you'll need to use a custom wizard. U can derive from existing wizard.

Also for files, they are all included by default, then excludes are processed.

arhill05 commented 8 years ago

If I understand correctly from your above comment, you can't embed a project within a solution folder then?

sayedihashimi commented 8 years ago

Not out of the box, you'll need to creates custom wizard. It should be pretty straight forward using the existing pecan-waffle wizard if you've done bs extensibility.

clausthalVK commented 7 years ago

@sayedihashimi Hi, I am using pecan-waffel to create a .net core web template.. I can create a template but now i want to add wizard to it I added wizard library but it does not work.. is there any particular setup i have to do first.. would be great if there is a small sample code snippet

sayedihashimi commented 7 years ago

@clausthalVK what are you trying to do?

clausthalVK commented 7 years ago

@sayedihashimi I need to create a .net core template..which needs to connect to one of our server and based on that information i need to generate some more file...static template works fine when i don't add wizard.. but when I add cutom wizard it doest not generate the structure.. could you please specify which class should i use for extensibility from pecanwaffel library

sayedihashimi commented 7 years ago

@clausthalVK pecan-waffle is implemented as a custom wizard see https://github.com/ligershark/pecan-waffle/blob/master/vs-src/PecanWaffle/PecanWizard.cs. Wizards are registered in the .vstemplate file for example https://github.com/sayedihashimi/pecan-waffle-samples/blob/master/templates/MyCustomTemplate/_project.vstemplate#L19.

If you create an additional custom wizard you can add it to your .vstemplate file after the pecanwaffle wizard. Note: I wouldn't run any custom wizards before the pecanwaffle wizard that creates files or does anything to the project. Adding wizards after should be OK for most cases.

The PecanWizard does some custom stuff so it's possible that this method won't work depending on the details of what you're doing. If you run into that problem then what I would recommend is to extend the PecanWizard, add your custom logic to that and then replace the wizard entry in the .vstemplate file to your own custom wizard.

clausthalVK commented 7 years ago

@sayedihashimi thanks for your suggestion.. i have already done the same.. I have added my own wizard after pecanwaffle wizard. the only issue adding wizard after is that dictionary replacement added in second wizard are not included into pecanwaffle wizard.. but i have a work around for that ... I reall appreciate your nice work...pecan waffel has helped me alot

sayedihashimi commented 7 years ago

@clausthalVK ok great, glad to hear you got things working. Is your project open source? If so can you send me a pointer to the code?

sayedihashimi commented 5 years ago

For multi-project templates the recommend approach now is to use SideWaffle V2 (VS2017+)