-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathBuild.proj
54 lines (48 loc) · 2.73 KB
/
Build.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
<?xml version="1.0" encoding="utf-8" ?>
<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<PropertyGroup>
<Root>$(MSBuildProjectDirectory)\</Root>
<InnoSetupPath>C:\Program Files (x86)\Inno Setup 5\iscc.exe</InnoSetupPath>
<Version>1.5.0.0</Version>
<VersionShort>1.5</VersionShort>
<ProductName>ResEx</ProductName>
<!-- Use the following two lines for beta versions -->
<!--<VersionShort>1.5Beta</VersionShort>-->
<!--<ProductName>ResEx Beta</ProductName>-->
<SolutionFileName>$(Root)ResEx.sln</SolutionFileName>
<SetupOutputPath>$(Root)</SetupOutputPath>
<InnoSetupScript>$(Root)setup.iss</InnoSetupScript>
<OutputFileName>ResExSetup$(VersionShort)</OutputFileName>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
<Target Name="Build">
<CallTarget Targets="UpdateVersionInCode"/>
<CallTarget Targets="BuildSolution"/>
<CallTarget Targets="BuildSetup"/>
</Target>
<Target Name="UpdateVersionInCode">
<Message Text="Updating AssemblyInfo file with new version number"/>
<FileUpdate Files="$(Root)\CommonAssemblyInfo.cs"
IgnoreCase="true" Multiline="false" Singleline="false"
Regex="AssemblyVersion\("*.{2,}"\)"
ReplacementText="AssemblyVersion("$(Version)")"/>
<FileUpdate Files="$(Root)\CommonAssemblyInfo.cs"
IgnoreCase="true" Multiline="false" Singleline="false"
Regex="AssemblyFileVersion\("*.{2,}"\)"
ReplacementText="AssemblyFileVersion("$(Version)")"/>
<FileUpdate Files="$(Root)\CommonAssemblyInfo.cs"
IgnoreCase="true" Multiline="false" Singleline="false"
Regex="AssemblyProduct\("ResEx"\)"
ReplacementText="AssemblyProduct("$(ProductName)")"/>
</Target>
<Target Name="BuildSolution">
<Message Text="Building Solution"/>
<MSBuild Projects="$(SolutionFileName)"
Targets="Clean;Build"
Properties="Configuration=$(Configuration)"/>
</Target>
<Target Name="BuildSetup">
<Message Text="Build the Inno Setup script"/>
<Exec Command=""$(InnoSetupPath)" "$(InnoSetupScript)" /o$(SetupOutputPath) /dVersion=$(Version) /dVersionShort=$(VersionShort) /dConfiguration=$(Configuration) /dOutputFileName=$(OutputFileName) /dProductName="$(ProductName)""></Exec>
</Target>
</Project>