Closed RehanSaeed closed 9 years ago
Thanks @rehansaeed have you tried it with a pattern like sw-* to see if that works? I'd like to find a general pattern that we can use here.
I've now done some testing. Adding this line removes the images from the generated project but the icons no longer appear in the VS New Project dialogue. You get the default project icon instead.
<ls-ProjectTemplateFilesToRemoveOnCopy
Include="_preprocess.xml;_Definitions\_project.vstemplate.xml;sw-file-icon.png;sw-file-previewimage.png;"/>
Removing sw-file-icon.png;sw-file-previewimage.png;
or using sw-*
as you suggested causes the icons to appear in the VS New Project dialogue but the files also appear in the generated project.
I also noticed the line below. I tried playing with it but it seems to have not effect. I haven't done much MSBuild for some time so I'm not sure what it does.
<!-- copy source folder to dest so that the files can be included in the generated vsix -->
<PropertyGroup>
<ls-CopyExcludeStatement Condition=" '$(ls-CopyExcludeStatement)'=='' ">*.user *.suo project.lock.json _preprocess.xml sw-*icon.png *swexclude*</ls-CopyExcludeStatement>
...
@RehanSaeed
Removing
sw-file-icon.png;sw-file-previewimage.png;
or usingsw-*
as you suggested causes the icons to appear in the VS New Project dialogue but the files also appear in the generated project.
Ok thanks, that's what I was afraid of.
I also noticed the line below.
ls-CopyExcludeStatement
I converted the copy from the template source to obj folder to use robocopy.exe to copy the files. That property contains the cmd line parameters to robocopy.exe for overall excludes like node_modules
. We don't want to use that because that will prevent the files from going into obj which means they will not go into the template all together. We want them in the template but not in the .xproj
file.
I was hoping we could get this to work w/o changes to the CreateTemplateTask but that doesn't look feasible. I think we can do the following.
ExcludeFilesRegex
in which we can give a regular expression that can be used to exclude files. We should default the value of that property to something like sw-.*
so that we can easily exclude files.
By creating this as a property if we need to override the default we can do that in the .targets file.I think this would be pretty easy to get added, if you agree do you think you could help? FYI making changes to TemplateBuilder sources and then testing that with SideWaffle is easy. Do the following.
TemplateBuilder
from the command line using build.ps1
build.ps1 -setMSBuildOverrides
. This will set two MSBuild properties to redirect MSBuild .targets and task to the build outputs of the sourcesTo do a local end-to-end test using the nuget pkg generated from sources you can do the following.
c:\temp\nuget\localrepo
build.ps1
, which should copy the build .nupkg
to c:\temp\nuget\localrepo
c:\temp\nuget\localrepo
and use that to install the latest packageThoughts?
I have created a new pull request for the CreateTemplateTask enhancements (https://github.com/ligershark/template-builder/pull/78) and another for ligershark.templates.targets (https://github.com/ligershark/template-builder/pull/77).
Everything now seems to work, except Preprocess replacements seem to have stopped working.
Updated (https://github.com/ligershark/template-builder/pull/77) to remove _preprocess.xml from the robocopy which fixes replacements.
Everything seems to be working now :)
I will do some thorough testing this weekend before pushing out my ASP.NET 5 update to ASP.NET MVC Boilerplate.
@RehanSaeed I think we can close this since your other PR was merged. Let me know if I'm wrong here.
Excellent, Thank you!
Added a new ignored file to support preview images called sw-file-previewimage.png, following the convention from sw-file-icon.png.