This repository was archived by the owner on Oct 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathPackage.proj
113 lines (85 loc) · 4.39 KB
/
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?xml version="1.0" encoding="utf-8"?>
<!--
This script requires the MSBuild Community Tasks (http://msbuildtasks.tigris.org).
To build a new version package, run the default target.
msbuild Package.proj
You will be prompted to enter the version number on the command line in
W.X.Y.Z format. The version number will be inserted into the assembly metadata,
the project will be built (Win32 and x64 in Release), and the result is stored
in a zip file named UdtProtocol-[Version].zip.
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
DefaultTargets="Package"
ToolsVersion="4.0">
<PropertyGroup>
<Version></Version>
<NUnitHome>C:\Program Files (x86)\NUnit 2.5.10</NUnitHome>
</PropertyGroup>
<Target Name="Package"
DependsOnTargets="SetVersion;Build">
<ItemGroup>
<ZipFiles Include="$(MSBuildProjectDirectory)\UdtProtocol\bin\Release\**\*.dll" />
<ZipFiles Include="$(MSBuildProjectDirectory)\UdtProtocol\bin\Release\**\*.pdb" />
<ZipFiles Include="$(MSBuildProjectDirectory)\UdtProtocol\bin\Release\**\*.xml" />
</ItemGroup>
<Delete Files="$(MSBuildProjectDirectory)\UdtProtocol-$(Version).zip" />
<Zip Files="@(ZipFiles)"
WorkingDirectory="$(MSBuildProjectDirectory)\UdtProtocol\bin\Release"
ZipFileName="$(MSBuildProjectDirectory)\UdtProtocol-$(Version).zip"
ZipLevel="9" />
<ItemGroup>
<SignedZipFiles Include="$(MSBuildProjectDirectory)\UdtProtocol\bin\Release - Signed\**\*.dll" />
<SignedZipFiles Include="$(MSBuildProjectDirectory)\UdtProtocol\bin\Release - Signed\**\*.pdb" />
<SignedZipFiles Include="$(MSBuildProjectDirectory)\UdtProtocol\bin\Release - Signed\**\*.xml" />
</ItemGroup>
<Zip Files="@(SignedZipFiles)"
WorkingDirectory="$(MSBuildProjectDirectory)\UdtProtocol\bin\Release - Signed"
ZipFileName="$(MSBuildProjectDirectory)\UdtProtocol-Signed-$(Version).zip"
ZipLevel="9" />
</Target>
<Target Name="SetVersion">
<Prompt Text="Enter the version (example W.X.Y.Z):" Condition="'$(Version)' == ''" >
<Output TaskParameter="UserInput" PropertyName="Version" />
</Prompt>
<!-- Insert the version into the project resource file. -->
<!-- This is the version that is shown in the Explorer properties dialog. -->
<FileUpdate Files="$(MSBuildProjectDirectory)\UdtProtocol\UdtProtocol.rc"
Regex="(FILEVERSION|PRODUCTVERSION)\s+\d+,\d+,\d+,\d+"
ReplacementText="$1 $(Version.Replace('.', ','))"
Encoding="iso-8859-1" />
<FileUpdate Files="$(MSBuildProjectDirectory)\UdtProtocol\UdtProtocol.rc"
Regex="VALUE\s+"(FileVersion|ProductVersion)"\s*,\s*"\d+\.\d+\.\d+\.\d+""
ReplacementText="VALUE "$1", "$(Version)""
Encoding="iso-8859-1" />
<!-- Insert the version into the assembly attributes. -->
<FileUpdate Files="$(MSBuildProjectDirectory)\UdtProtocol\AssemblyInfo.cpp"
Regex="\[assembly:AssemblyVersionAttribute\("\d+\.\d+\.\d+\.\d+"\)\];"
ReplacementText="[assembly:AssemblyVersionAttribute("$(Version)")];"
Encoding="iso-8859-1" />
</Target>
<Target Name="Build">
<MSBuild Projects="$(MSBuildProjectDirectory)\UdtProtocol.sln"
Targets="Clean;Build"
Properties="Configuration=Release; Platform=Win32"
ToolsVersion="4.0" />
<!--
<Exec Command=""$(NUnitHome)\bin\net-2.0\nunit-console-x86.exe" "$(MSBuildProjectDirectory)\UdtProtocol-Test\bin\x86\Release\UdtProtocol-Test.dll""/>
-->
<MSBuild Projects="$(MSBuildProjectDirectory)\UdtProtocol.sln"
Targets="Clean;Build"
Properties="Configuration=Release; Platform=x64"
ToolsVersion="4.0" />
<!--
<Exec Command=""$(NUnitHome)\bin\net-2.0\nunit-console.exe" "$(MSBuildProjectDirectory)\UdtProtocol-Test\bin\x64\Release\UdtProtocol-Test.dll""/>
-->
<MSBuild Projects="$(MSBuildProjectDirectory)\UdtProtocol.sln"
Targets="Clean;Build"
Properties="Configuration=Release - Signed; Platform=Win32"
ToolsVersion="4.0" />
<MSBuild Projects="$(MSBuildProjectDirectory)\UdtProtocol.sln"
Targets="Clean;Build"
Properties="Configuration=Release - Signed; Platform=x64"
ToolsVersion="4.0" />
</Target>
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
</Project>