-
Notifications
You must be signed in to change notification settings - Fork 0
/
VisualStudio.Templates.package.proj
92 lines (73 loc) · 3.39 KB
/
VisualStudio.Templates.package.proj
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<Project DefaultTargets="Build">
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
<Version Condition="'$(Version)' == ''">1.0.0</Version>
<OutputPath>bin\$(Configuration)\</OutputPath>
<_SolutionDir>$(MSBuildProjectDirectory)\</_SolutionDir>
<_NuGetPackageFolder>$(USERPROFILE)\.nuget\packages\</_NuGetPackageFolder>
<_VsSDKBuildToolsFolder>$(_NuGetPackageFolder)microsoft.vssdk.buildtools\17.12.2069\tools\vssdk\</_VsSDKBuildToolsFolder>
<_VsixUtil>$(_VsSDKBuildToolsFolder)bin\VsixUtil.exe</_VsixUtil>
</PropertyGroup>
<Target Name="Init">
<Error Condition="'$(OutDir)' == ''" Text="No 'OutDir' property has been specified." />
<Error Condition="'$(PublishUrl)' == ''" Text="No 'PublishUrl' property has been specified." />
</Target>
<Target Name="Clean" DependsOnTargets="Init">
<RemoveDir Condition="Exists('$(OutDir)')" Directories="$(OutDir)" />
</Target>
<Target Name="Build" DependsOnTargets="Clean">
<!-- Updates the version of the VSIX package -->
<PropertyGroup>
<_VsixManifestNamespaces>
<Namespace Prefix="vsx" Uri="http://schemas.microsoft.com/developer/vsx-schema/2011" />
</_VsixManifestNamespaces>
</PropertyGroup>
<XmlPoke
XmlInputPath="$(_SolutionDir)src\VisualStudio.Templates\source.extension.vsixmanifest"
Value="$(Version)"
Query="/vsx:PackageManifest/vsx:Metadata/vsx:Identity/@Version"
Namespaces="$(_VsixManifestNamespaces)"/>
<!-- Build the Visual Studio Templates VSIX -->
<MSBuild Projects="$(_SolutionDir)src\VisualStudio.Templates\VisualStudio.Templates.csproj"
Properties="
Configuration=$(Configuration);
Platform=$(Platform);
OutputPath=$(OutputPath);
OutDir=$(OutputPath)" />
<!-- Copy the VSIX to the output folder -->
<Copy SourceFiles="$(_SolutionDir)src\VisualStudio.Templates\$(OutputPath)PosInformatique.VisualStudio.Templates.vsix"
DestinationFolder="$(OutDir)\PosInformatique Visual Studio Templates" />
</Target>
<Target Name="Publish" DependsOnTargets="Build">
<!-- Generate the ATOM file for the VSIX packages -->
<Exec Command="$(_VsixUtil) createVsixFeed -source "$(OutDir)\PosInformatique Visual Studio Templates" -filename gallery -output "$(OutDir)\PosInformatique Visual Studio Templates"" />
<!-- Fix the <link href=""> attribute to use the PublishUrl -->
<PropertyGroup>
<_AtomNamespaces>
<Namespace Prefix="atom" Uri="http://www.w3.org/2005/Atom" />
</_AtomNamespaces>
</PropertyGroup>
<XmlPoke
XmlInputPath="$(OutDir)\PosInformatique Visual Studio Templates\gallery.xml"
Value="$(PublishUrl)PosInformatique.VisualStudio.Templates_Icon_logo.jpg"
Query="/atom:feed/atom:entry/atom:link/@href"
Namespaces="$(_AtomNamespaces)"/>
<!-- Generate the web.config at the OutDir folder to allow download VSIX -->
<PropertyGroup>
<_WebConfig>
<![CDATA[<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".vsix" mimeType="application/vsix" />
</staticContent>
</system.webServer>
</configuration>]]>
</_WebConfig>
</PropertyGroup>
<WriteLinesToFile
File="$(OutDir)\PosInformatique Visual Studio Templates\web.config"
Overwrite="true"
Lines="$(_WebConfig)" />
</Target>
</Project>