-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathHeyHttpBuild.proj
More file actions
39 lines (35 loc) · 1.58 KB
/
HeyHttpBuild.proj
File metadata and controls
39 lines (35 loc) · 1.58 KB
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
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
Without this PropertyGroup, build fails with:
error MSB4126: The specified solution configuration "|Any CPU" is invalid. Please specify a valid solution
configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug
/p:Platform="Any CPU") or leave those properties blank to use the default solution configuration.
-->
<PropertyGroup Condition=" '$(BuildConfiguration)' == '' ">
<BuildConfiguration>Release</BuildConfiguration>
</PropertyGroup>
<ItemGroup>
<ProjectFiles Include="$(MSBuildProjectDirectory)\**\*.sln">
<Properties>Configuration=$(BuildConfiguration)</Properties>
</ProjectFiles>
</ItemGroup>
<Target Name="ZipWithPowerShell5">
<ItemGroup>
<ZipFiles Include="HeyHttp\bin\Release\*.*" />
<ZipFiles Include="HeyHttp\bin\Release\wwwroot" />
</ItemGroup>
<Exec Command="PowerShell -command Compress-Archive @(ZipFiles, ',') HeyHttp\bin\Release\HeyHttp.zip" />
</Target>
<Target Name="Zip">
<Exec Command="powershell -command Add-Type -A System.IO.Compression.FileSystem;[IO.Compression.ZipFile]::CreateFromDirectory('HeyHttp\bin\Release', 'HeyHttp$(VersionLabel).zip')" />
</Target>
<!--
This target must exists, otherwise build fails with:
error MSB4057: The target "Build" does not exist in the project.
-->
<Target Name="Build">
<MSBuild Projects="@(ProjectFiles)" />
<CallTarget Targets="Zip" />
</Target>
</Project>