-
Notifications
You must be signed in to change notification settings - Fork 7
/
ColorCode.msbuild
64 lines (52 loc) · 3.08 KB
/
ColorCode.msbuild
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
<Project ToolsVersion="4.0" DefaultTargets="all" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask AssemblyFile="3rdParty\CodePlex.MSBuildTasks.dll" TaskName="CodePlex.MSBuildTasks.RegexReplace"/>
<UsingTask AssemblyFile="3rdParty\CodePlex.MSBuildTasks.dll" TaskName="CodePlex.MSBuildTasks.Zip"/>
<UsingTask AssemblyFile="3rdParty\xUnit\xunit.runner.msbuild.dll" TaskName="Xunit.Runner.MSBuild.xunit"/>
<PropertyGroup Condition="'$(Configuration)' == ''">
<Configuration>Debug</Configuration>
</PropertyGroup>
<PropertyGroup Condition="'$(BuildNumber)' == ''">
<BuildNumber>$(BUILD_NUMBER)</BuildNumber>
</PropertyGroup>
<PropertyGroup Condition="'$(BuildNumber)' == ''">
<BuildNumber>$(ccnetlabel)</BuildNumber>
</PropertyGroup>
<PropertyGroup Condition="'$(BuildNumber)' == ''">
<BuildNumber>0</BuildNumber>
</PropertyGroup>
<Target Name="clean">
<MSBuild Projects="ColorCode.sln" Targets="Clean" Properties="Configuration=Debug"/>
<MSBuild Projects="ColorCode.sln" Targets="Clean" Properties="Configuration=Release"/>
</Target>
<Target Name="compile" DependsOnTargets="clean">
<MSBuild Projects="ColorCode.sln" Targets="Build" Properties="Configuration=Debug"/>
<MSBuild Projects="ColorCode.sln" Targets="Build" Properties="Configuration=Release"/>
</Target>
<Target Name="run-facts" DependsOnTargets="compile">
<xunit Assembly="ColorCode.Facts\bin\Debug\ColorCode.Facts.dll" Xml="ColorCode.Facts.xunit.results.xml" />
</Target>
<Target Name="run-tests" DependsOnTargets="compile">
<xunit Assembly="ColorCode.AcceptanceTests\bin\Debug\ColorCode.AcceptanceTests.dll" ShadowCopy="false" Xml="ColorCode.AcceptanceTests.xunit.results.xml" />
</Target>
<Target Name="all" DependsOnTargets="compile;run-facts;run-tests" />
<Target Name="set-version">
<Exec Command="attrib -r GlobalAssemblyInfo.cs"/>
<RegexReplace Pattern='AssemblyVersion\("(\d+\.\d+\.\d+)\.\d+"\)' Replacement='AssemblyVersion("$1.$(BuildNumber)")' Files='GlobalAssemblyInfo.cs'/>
<RegexReplace Pattern='AssemblyInformationalVersion\("(\d+\.\d+\.\d+)\.\d+"\)' Replacement='AssemblyVersion("$1.$(BuildNumber)")' Files='GlobalAssemblyInfo.cs'/>
</Target>
<Target Name="clean-archive">
<RemoveDir Directories="Output"/>
</Target>
<Target Name="archive" DependsOnTargets="clean-archive;compile">
<MakeDir Directories="Output" />
<CreateItem Include="ColorCode\bin\Debug\ColorCode.dll;ColorCode\bin\Debug\ColorCode.pdb">
<Output TaskParameter="Include" ItemName="DebugFilesToArchive"/>
</CreateItem>
<CreateItem Include="ColorCode\bin\Release\ColorCode.dll;ColorCode\bin\Release\ColorCode.pdb">
<Output TaskParameter="Include" ItemName="ReleaseFilesToArchive"/>
</CreateItem>
<Zip ZipFileName="Output\ColorCode-$(BuildNumber).debug.zip" Files="@(DebugFilesToArchive)" StripPath="true"/>
<Zip ZipFileName="Output\ColorCode-$(BuildNumber).release.zip" Files="@(ReleaseFilesToArchive)" StripPath="true"/>
</Target>
<Target Name="ci" DependsOnTargets="set-version;all;archive" />
</Project>