forked from charlesw/tesseract
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.proj
76 lines (74 loc) · 3.22 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Package" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Version>3.0.0.0</Version>
<SourceDir>$(MSBuildProjectDirectory)\src</SourceDir>
<BuildDir>$(MSBuildProjectDirectory)\bin</BuildDir>
<ReleaseDir>$(MSBuildProjectDirectory)\release</ReleaseDir>
<ToolsDir>$(MSBuildProjectDirectory)\tools</ToolsDir>
<ExtensionTasksPath>$(ToolsDir)\MSBuild.ExtensionPack\</ExtensionTasksPath>
</PropertyGroup>
<Import Project="$(ExtensionTasksPath)\MSBuild.ExtensionPack.tasks"/>
<ItemGroup>
<Template Include="$(SourceDir)\AssemblyVersionInfo.template.cs" />
<Flavor Include="$(SourceDir)\Tesseract.sln">
<Configuration>Debug451</Configuration>
</Flavor>
<Flavor Include="$(SourceDir)\Tesseract.sln">
<Configuration>Release451</Configuration>
</Flavor>
<Flavor Include="$(SourceDir)\Tesseract.sln">
<Configuration>Debug45</Configuration>
</Flavor>
<Flavor Include="$(SourceDir)\Tesseract.sln">
<Configuration>Release45</Configuration>
</Flavor>
<Flavor Include="$(SourceDir)\Tesseract.sln">
<Configuration>Debug40</Configuration>
</Flavor>
<Flavor Include="$(SourceDir)\Tesseract.sln">
<Configuration>Release40</Configuration>
</Flavor>
<Flavor Include="$(SourceDir)\Tesseract.sln">
<Configuration>Debug40Client</Configuration>
</Flavor>
<Flavor Include="$(SourceDir)\Tesseract.sln">
<Configuration>Release40Client</Configuration>
</Flavor>
<Flavor Include="$(SourceDir)\Tesseract.sln">
<Configuration>Debug35</Configuration>
</Flavor>
<Flavor Include="$(SourceDir)\Tesseract.sln">
<Configuration>Release35</Configuration>
</Flavor>
<Flavor Include="$(SourceDir)\Tesseract.sln">
<Configuration>Debug20</Configuration>
</Flavor>
<Flavor Include="$(SourceDir)\Tesseract.sln">
<Configuration>Release20</Configuration>
</Flavor>
</ItemGroup>
<Target Name="PrepareBuild">
<Copy SourceFiles="$(SourceDir)\AssemblyVersionInfo.template.cs" DestinationFiles="$(SourceDir)\AssemblyVersionInfo.cs" />
<MSBuild.ExtensionPack.FileSystem.File TaskAction="Replace" RegexPattern="\$\(Version\)" Replacement="$(Version)" Files="$(SourceDir)\AssemblyVersionInfo.cs"/>
</Target>
<Target Name="ExpandFlavors" DependsOnTargets="PrepareBuild">
<CreateItem Include="@(Flavor)" AdditionalMetadata="Properties=Configuration=%(Flavor.Configuration)%3BPlatform=Any CPU%3BOutDir=$(BuildDir)\%(Flavor.Configuration)\">
<Output TaskParameter="Include" ItemName="ProjectToBuild" />
</CreateItem>
</Target>
<Target Name="RestorePackages">
<Exec Command='$(ToolsDir)\NuGet.exe restore "$(SourceDir)\Tesseract.sln"'/>
</Target>
<Target Name="Clean" DependsOnTargets="ExpandFlavors;RestorePackages">
<MSBuild Projects="@(ProjectToBuild)" Targets="Clean" />
<RemoveDir Directories="$(BuildDir)" />
</Target>
<Target Name="Build" DependsOnTargets="ExpandFlavors;RestorePackages">
<MSBuild Projects="@(ProjectToBuild)" Targets="Build" />
</Target>
<Target Name="Package" DependsOnTargets="Build">
<MakeDir Directories='$(ReleaseDir)'/>
<Exec Command='$(ToolsDir)\NuGet.exe pack "$(SourceDir)\Tesseract.nuspec" -BasePath "$(BuildDir)" -Version $(Version) -o "$(ReleaseDir)"'/>
</Target>
</Project>