-
Notifications
You must be signed in to change notification settings - Fork 0
/
HelloCI.build
106 lines (87 loc) · 4.09 KB
/
HelloCI.build
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
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
ToolsVersion="4.0"
DefaultTargets="Test" >
<UsingTask AssemblyFile=".\thirdparty\tools\MSBuildAsyncExec\AsyncExec.dll" TaskName="AsyncExec.AsyncExec" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
</PropertyGroup>
<ItemGroup>
<BuildArtifacts Include=".\buildartifacts\" />
<SolutionFile Include=".\HelloCI.sln" />
<Cassini Include="$(CommonProgramFiles)\microsoft shared\DevServer\11.0\WebDev.WebServer40.EXE" />
<Website Include=".\buildartifacts\_PublishedWebsites\HelloCI.Web" />
<SolutionRoot Include="."/>
</ItemGroup>
<ItemGroup>
<NUnit Include=".\thirdparty\tools\NUnit\nunit-console.exe" />
<TestAssembly Include=".\buildartifacts\HelloCI.Tests.dll" />
<TestResults Include=".\buildartifacts\TestResults.xml" />
</ItemGroup>
<ItemGroup>
<NCoverPath Include=".\thirdparty\tools\NCover"/>
<NCoverCoverage Include=".\buildartifacts\coverage.nccov"/>
<NCoverTrend Include=".\buildartifacts\coverage.trend"/>
<CoverageReportDir Include=".\buildartifacts\coverage\"/>
</ItemGroup>
<ItemGroup>
<FxCop Include=".\thirdparty\tools\FxCop\FxCopCmd.exe"/>
<AssembliesToAnalyze Include=".\buildartifacts\_PublishedWebsites\HelloCI.Web\bin\HelloCI.Web.dll"/>
<ReferencedAssemblies Include=".\packages\DotNetOpenAuth.AspNet.4.1.4.12333\lib\net40-full\"/>
<AnalysisReport Include=".\buildartifacts\FxCopAnalysis.xml" />
</ItemGroup>
<ItemGroup>
<MsDeploy Include=".\thirdparty\tools\Microsoft Web Deploy\msdeploy.exe"/>
<PackageFile Include=".\buildartifacts\package\HelloCI.zip"/>
</ItemGroup>
<PropertyGroup>
<WebServerName>192.168.1.3</WebServerName>
</PropertyGroup>
<Target Name="Clean">
<RemoveDir Directories="@(BuildArtifacts)" />
</Target>
<Target Name="Init" DependsOnTargets="Clean">
<MakeDir Directories="@(BuildArtifacts)" />
</Target>
<Target Name="Compile" DependsOnTargets="Init">
<MSBuild Projects="@(SolutionFile)" Targets="Rebuild" Properties="OutDir=%(BuildArtifacts.FullPath);Configuration=$(Configuration)" />
</Target>
<Target Name="StartWebsite" DependsOnTargets="StopWebsite;Compile">
<AsyncExec Command='"@(Cassini)" /port:9999 /path:"%(Website.FullPath)"' />
</Target>
<Target Name="StopWebsite">
<Exec Command="taskkill /f /im WebDev.WebServer40.exe" IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true"/>
</Target>
<Target Name="Test" DependsOnTargets="Compile">
<Exec Command="@(NUnit) @(TestAssembly) /xml=@(TestResults)" />
</Target>
<Target Name="TestWithCoverage" DependsOnTargets="Compile">
<NCover TestRunnerExe="@(NUnit)"
TestRunnerArgs="@(TestAssembly) /xml=@(TestResults)"
ToolPath="@(NCoverPath)"
WorkingDirectory="@(SolutionRoot)"
CoverageFile="@(NCoverCoverage)"
AppendTrendTo="@(NCoverTrend)"
IncludeAssemblies="$(CoveredAssemblies)"
ProjectName="HelloCI"
HtmlReportDir="@(CoverageReportDir)" />
</Target>
<Target Name="FxCop" DependsOnTargets="Test">
<Exec Command="@(FxCop) /file:@(AssembliesToAnalyze) /out:@(AnalysisReport) /directory:@(ReferencedAssemblies)" />
</Target>
<Target Name="Package" DependsOnTargets="Test">
<PropertyGroup>
<PackageDir>%(PackageFile.RootDir)%(PackageFile.Directory)</PackageDir>
<Source>%(Website.FullPath)</Source>
<Destination>%(PackageFile.FullPath)</Destination>
</PropertyGroup>
<MakeDir Directories="$(PackageDir)"/>
<Exec Command='"@(MsDeploy)" -verb:sync -source:iisApp="$(Source)" -dest:package="$(Destination)"' />
</Target>
<Target Name="Deploy" DependsOnTargets="Package">
<PropertyGroup>
<Source>%(PackageFile.FullPath)</Source>
</PropertyGroup>
<Exec Command='"@(MsDeploy)" -verb:sync -source:package="$(Source)" -dest:iisApp=HelloCI,computerName=$(WebServerName),username=Oetawan,password=18022010,authType=Basic' />
</Target>
</Project>