forked from EasyHook/EasyHook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-package.proj
187 lines (180 loc) · 9.34 KB
/
build-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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PackageDir>.\Deploy</PackageDir>
<FX35BuildDir>.\Build\netfx3.5-Release\x64</FX35BuildDir>
<FX4BuildDir>.\Build\netfx4-Release\x64</FX4BuildDir>
<AssemblyCopyright>Copyright (c) 2016 EasyHook Team</AssemblyCopyright>
<AssemblyTitlePostfix>(beta)</AssemblyTitlePostfix>
</PropertyGroup>
<!-- https://github.com/loresoft/msbuildtasks -->
<Import Project=".\MSBuildTasks.1.5.0.196\tools\MSBuild.Community.Tasks.Targets"/>
<!-- BeforeBuild: update version info across all projects -->
<Target Name="BeforeBuild" >
<ItemGroup>
<AssemblyInfoFiles Include=".\**\*AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<CppProjectFiles Include=".\**\*.vcxproj" />
</ItemGroup>
<ItemGroup>
<CppResourceFiles Include=".\**\*.rc" />
</ItemGroup>
<ItemGroup>
<NuGetAutopkgFiles Include=".\EasyHookNative.autopkg" />
<NuGetNuspecFiles Include=".\EasyHook.nuspec" />
</ItemGroup>
<!-- attempt to record the Subversion Repository revision in SVNRevision for use in AssemblyTitle -->
<CreateProperty Value="$(AssemblyTitlePostfix)">
<Output TaskParameter="Value" PropertyName="AssemblyTitlePostfix" />
</CreateProperty>
<!-- Increment Version number in Version.txt -->
<Version VersionFile="Version.txt" BuildType="Automatic" RevisionType="BuildIncrement">
<Output TaskParameter="Major" PropertyName="Major" />
<Output TaskParameter="Minor" PropertyName="Minor" />
<Output TaskParameter="Build" PropertyName="Build" />
<Output TaskParameter="Revision" PropertyName="Revision" />
</Version>
<Message Text="Updating AssemblyInfo to Version: $(Major).$(Minor).$(Build).$(Revision)"></Message>
<Message Text="Writing to AssemblyInfo files: @(AssemblyInfoFiles)"></Message>
<FileUpdate Files="@(AssemblyInfoFiles)"
Regex="(\d+)\.(\d+)\.(\d+)\.(\d+)"
ReplacementText="$(Major).$(Minor).$(Build).$(Revision)" />
<FileUpdate Files="@(AssemblyInfoFiles)"
Regex="AssemblyTitle\("(.*) (\([a-zA-Z]*\))"\)"
ReplacementText="AssemblyTitle("$1")" />
<FileUpdate Files="@(AssemblyInfoFiles)"
Regex="AssemblyTitle\("(.*)"\)"
ReplacementText="AssemblyTitle("$1 $(AssemblyTitlePostfix)")" />
<FileUpdate Files="@(AssemblyInfoFiles)"
Regex="AssemblyCopyright\(.*\)"
ReplacementText="AssemblyCopyright("$(AssemblyCopyright)")" />
<FileUpdate Files="@(CppProjectFiles)"
Regex="<Version>.*</Version>"
ReplacementText="<Version>$(Major).$(Minor).$(Build).$(Revision)</Version>" />
<FileUpdate Files="@(CppResourceFiles)" Encoding="Windows-1252"
Regex="FILEVERSION (\d+),(\d+),(\d+),(\d+)"
ReplacementText="FILEVERSION $(Major),$(Minor),$(Build),$(Revision)" />
<FileUpdate Files="@(CppResourceFiles)" Encoding="Windows-1252"
Regex="PRODUCTVERSION (\d+),(\d+),(\d+),(\d+)"
ReplacementText="PRODUCTVERSION $(Major),$(Minor),$(Build),$(Revision)" />
<FileUpdate Files="@(CppResourceFiles)" Encoding="Windows-1252"
Regex=""LegalCopyright", ".*""
ReplacementText=""LegalCopyright", "$(AssemblyCopyright)"" />
<FileUpdate Files="@(CppResourceFiles)"
Regex=""FileDescription", "(.*) (\([a-zA-Z]*\))""
ReplacementText=""FileDescription", "$1"" />
<FileUpdate Files="@(CppResourceFiles)" Encoding="Windows-1252"
Regex=""FileDescription", "(.*)""
ReplacementText=""FileDescription", "$1 $(AssemblyTitlePostfix)"" />
<FileUpdate Files="@(CppResourceFiles)" Encoding="Windows-1252"
Regex=""FileVersion", ".*""
ReplacementText=""FileVersion", "$(Major).$(Minor).$(Build).$(Revision)"" />
<FileUpdate Files="@(CppResourceFiles)" Encoding="Windows-1252"
Regex=""ProductVersion", ".*""
ReplacementText=""ProductVersion", "$(Major).$(Minor).$(Build).$(Revision)"" />
<FileUPdate Files="@(NugetAutopkgFiles)"
Regex="version : (\d+)\.(\d+)\.(\d+)\.(\d+);"
ReplacementText="version : $(Major).$(Minor).$(Build).$(Revision);" />
<FileUPdate Files="@(NuGetAutopkgFiles)"
Regex="version : (\d+)\.(\d+)\.(\d+)\.(\d+);"
ReplacementText="version : $(Major).$(Minor).$(Build).$(Revision);" />
<FileUPdate Files="@(NuGetNuspecFiles)"
Regex="<version>(\d+)\.(\d+)\.(\d+)\.(\d+)"
ReplacementText="<version>$(Major).$(Minor).$(Build).$(Revision)" />
</Target>
<!-- PreparePackage: Prepare Deployment package files within .\Deploy\ -->
<Target Name = "PreparePackage">
<!--DependsOnTargets="Build">-->
<ItemGroup>
<CommonFiles Include=".\LICENSE" />
<CommonFiles Include=".\README.md" />
<CommonFiles Include=".\EasyHookTestCert.cer" />
<CommonFiles Include=".\Public\easyhook.h" />
</ItemGroup>
<!-- Note: These ItemGroup's must be child of Target to ensure that the Include paths are evaluated AFTER the build has completed -->
<ItemGroup>
<NetFX35Files Include="$(FX35BuildDir)\EasyHook*.dll" />
<NetFX35Files Include="$(FX35BuildDir)\EasyLoad*.dll" />
<NetFX35Files Include="$(FX35BuildDir)\EasyHook*.lib" />
<NetFX35Files Include="$(FX35BuildDir)\EasyHook32Svc.exe" />
<NetFX35Files Include="$(FX35BuildDir)\EasyHook64Svc.exe" />
<NetFX35Files Include="$(FX35BuildDir)\FileMon.exe" />
<NetFX35Files Include="$(FX35BuildDir)\ProcessMonitor.exe" />
<NetFX35Files Include="$(FX35BuildDir)\ProcMonInject.dll" />
<NetFX35Files Include="$(FX35BuildDir)\ComplexParameterTest.exe" />
<NetFX35Files Include="$(FX35BuildDir)\ComplexParameterInject.dll" />
<NetFX35Files Include="$(FX35BuildDir)\TestFuncHooks.exe" />
<NetFX35Files Include="$(FX35BuildDir)\*.sys" />
</ItemGroup>
<ItemGroup>
<NetFX4Files Include="$(FX4BuildDir)\EasyHook*.dll" />
<NetFX4Files Include="$(FX4BuildDir)\EasyLoad*.dll" />
<NetFX4Files Include="$(FX4BuildDir)\EasyHook*.lib" />
<NetFX4Files Include="$(FX4BuildDir)\EasyHook32Svc.exe" />
<NetFX4Files Include="$(FX4BuildDir)\EasyHook64Svc.exe" />
<NetFX4Files Include="$(FX4BuildDir)\FileMon.exe" />
<NetFX4Files Include="$(FX4BuildDir)\FileMonInject.dll" />
<NetFX4Files Include="$(FX4BuildDir)\ProcessMonitor.exe" />
<NetFX4Files Include="$(FX4BuildDir)\ProcMonInject.dll" />
<NetFX4Files Include="$(FX4BuildDir)\ComplexParameterTest.exe" />
<NetFX4Files Include="$(FX4BuildDir)\ComplexParameterInject.dll" />
<NetFX4Files Include="$(FX4BuildDir)\TestFuncHooks.exe" />
<NetFX4Files Include="$(FX4BuildDir)\*.sys" />
</ItemGroup>
<MakeDir Directories = "$(PackageDir)"
Condition = "!Exists('$(PackageDir)')" />
<MakeDir Directories = "$(PackageDir)\NetFX3.5"
Condition = "!Exists('$(PackageDir)\NetFX3.5')" />
<MakeDir Directories = "$(PackageDir)\NetFX4.0"
Condition = "!Exists('$(PackageDir)\NetFX4.0')" />
<Copy SourceFiles="@(CommonFiles)"
DestinationFolder="$(PackageDir)\NetFX3.5" />
<Copy SourceFiles="@(CommonFiles)"
DestinationFolder="$(PackageDir)\NetFX4.0" />
<Copy SourceFiles="@(NetFX35Files)"
DestinationFolder="$(PackageDir)\NetFX3.5" />
<Copy SourceFiles="@(NetFX4Files)"
DestinationFolder="$(PackageDir)\NetFX4.0" />
</Target>
<!-- No need to export source
<Target Name="ExportSource">
<RemoveDir Directories="$(PackageDir)\Source" />
<SvnExport RepositoryPath="$(MSBuildProjectDirectory)"
LocalPath="$(PackageDir)\Source"></SvnExport>
</Target>
-->
<!-- Package: Create deployment ZIP file -->
<Target Name = "Package" DependsOnTargets="PreparePackage">
<ItemGroup>
<PackageFiles Include="$(PackageDir)\**\*.*" Exclude="$(PackageDir)\*.zip;$(PackageDir)\Source\**\*.*" />
</ItemGroup>
<!-- No longer packaging source files
<ItemGroup>
<SourceFiles Include="$(PackageDir)\Source\**\*.*" />
</ItemGroup>
-->
<Version VersionFile="Version.txt" BuildType="None" RevisionType="None">
<Output TaskParameter="Major" PropertyName="Major" />
<Output TaskParameter="Minor" PropertyName="Minor" />
<Output TaskParameter="Build" PropertyName="Build" />
<Output TaskParameter="Revision" PropertyName="Revision" />
</Version>
<Zip Files="@(PackageFiles)"
WorkingDirectory="$(PackageDir)"
ZipFileName="$(PackageDir)\EasyHook-$(Major).$(Minor).$(Build).$(Revision)-Binaries.zip"
ZipLevel="9" />
<Exec Command="NuGet.exe pack .\EasyHook.nuspec -NoPackageAnalysis -symbols" />
<Exec Command="powershell.exe -executionpolicy Unrestricted -command "& { &'.\tools\EasyHookNativePkg.ps1' } "" />
<!-- no longer archiving source files here
<Zip Files="@(SourceFiles)"
WorkingDirectory="$(PackageDir)\Source"
ZipFileName="$(PackageDir)\EasyHook-$(Major).$(Minor).$(Build).$(Revision)-Source.zip"
ZipLevel="9" />
-->
</Target>
<!-- Clean -->
<Target Name = "Clean">
<RemoveDir Directories=".\Build;$(PackageDir)\NetFX4.0;$(PackageDir)\NetFX3.5;$(PackageDir)\Source" />
</Target>
</Project>