-
Notifications
You must be signed in to change notification settings - Fork 4
/
pecan-waffle-vs.targets
67 lines (56 loc) · 3.62 KB
/
pecan-waffle-vs.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="IncludePecanWaffleInVsix" BeforeTargets="CoreCompile" Condition=" '$(IncludePecanWaffleNuGetPkgInVsix)'=='true' ">
<Error Text="'Property 'PwPkgsDir' is not defined. Did you install the pecan-waffle nuget packaage?" Condition=" '$(PwPkgsDir)'=='' " />
<ItemGroup>
<pwNuGetPackage Include="$(PwPkgsDir)pecan-waffle.*\pecan-waffle.*.nupkg"/>
<frNuGetPackage Include="$(PwPkgsDir)file-replacer*\file-replacer*.nupkg"/>
<npNugetPackage Include="$(PwPkgsDir)nuget-powershell*\nuget-powershell*.nupkg"/>
<_pkgsToIncludeInVsix Include="@(pwNuGetPackage)" />
<_pkgsToIncludeInVsix Include="@(frNuGetPackage)" />
<_pkgsToIncludeInVsix Include="@(npNugetPackage)" />
</ItemGroup>
<Error Condition="!Exists('@(pwNuGetPackage)')" Text="Did not find pecan-waffle nuget package at [@(pwNuGetPackage)]" />
<Error Condition="!Exists('@(frNuGetPackage)')" Text="Did not find file-replacer nuget package at [@(frNuGetPackage)]" />
<Error Condition="!Exists('@(npNugetPackage)')" Text="Did not find nuget-powershell nuget package at [@(npNugetPackage)]" />
<Message Text="Adding nuget packages to vsix [@(_pkgsToIncludeInVsix)]" />
<!-- add the packages to -->
<ItemGroup>
<VSIXSourceItem Include="@(_pkgsToIncludeInVsix)" />
</ItemGroup>
</Target>
<PropertyGroup>
<pwOutputDirectory Condition=" '$(pwOutputDirectory)'=='' " >$(IntermediateOutputPath)templatesTemp</pwOutputDirectory>
</PropertyGroup>
<Target Name="AddPecanFilesToVsix" BeforeTargets="Build;CreateVsixContainer">
<!--
powershell.exe –command "& { C:\Data\mycode\pecan-waffle\pecan-add-template-to-vsix.ps1 'dev' 'aspnet5-webapi'
'C:\Data\mycode\JumpStreetMobile\JumpStreetMobileVs\templates\pw-templateinfo.ps1'
'C:\Data\mycode\JumpStreetMobile\JumpStreetMobileVs\bin\Debug\JumpStreetMobile.vsix' 'templates' -Verbose }"
-->
<Error Text="'Property 'PwAddTemplateScriptPath' is not defined. Did you install the pecan-waffle nuget packaage?" Condition=" '$(PwAddTemplateScriptPath)'=='' " />
<Error Text="pecan-waffle script not found at [$(PwAddTemplateScriptPath)]" Condition=" !Exists('$(PwAddTemplateScriptPath)')" />
<PropertyGroup>
<psCommand>$(PowerShellExe) -noprofile -NonInteractive -executionpolicy Unrestricted -command "& '$(PwAddTemplateScriptPath)' '$(pwInstallBranch)' '$(pwTemplateRoot)' '$(pwOutputDirectory)' '$(pwTemplateZipRelDir)' $(pwTemplateExtraArgs)"</psCommand>
</PropertyGroup>
<Message Text="Adding template files to vsix with command:$(psCommand)" Importance="low" />
<Exec Command="$(psCommand)" />
<ItemGroup>
<_pwTemplateFilesForVsix Include="$(pwOutputDirectory)\**\*">
<VSIXSubPath>%(RecursiveDir)</VSIXSubPath>
</_pwTemplateFilesForVsix>
<VSIXSourceItem Include="@(_pwTemplateFilesForVsix)">
<VSIXSubPath>%(_pwTemplateFilesForVsix.RecursiveDir)</VSIXSubPath>
</VSIXSourceItem>
</ItemGroup>
<Message Text="VSIXSourceItem:%0a%0d@(VSIXSourceItem,'%0a%0d')" Importance="low" />
</Target>
<Target Name="CleanTemplatesTemp" AfterTargets="Clean" Condition=" '$(pwOutputDirectory)' != '' and Exists('$(pwOutputDirectory)')">
<Message Text="Cleaning templates temp folder at [$(pwOutputDirectory)]" />
<ItemGroup>
<_oldtemplatefiles Include="$(pwOutputDirectory)\**\*"/>
</ItemGroup>
<Delete Files="@(_oldtemplatefiles)" />
<RemoveDir Directories="$(pwOutputDirectory)" ContinueOnError ="true" />
</Target>
</Project>