forked from disruptor-net/Disruptor-net
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Build.xml
156 lines (140 loc) · 6.53 KB
/
Build.xml
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
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<PropertyGroup>
<MSBuildCommunityTasksPath>$(MSBuildProjectDirectory)\Lib\MSBuild.Community\</MSBuildCommunityTasksPath>
<SourceDir>$(MSBuildProjectDirectory)</SourceDir>
<NUnitToolPath>$(MSBuildProjectDirectory)\Lib\NUnit\</NUnitToolPath>
<TargetDir>$(MsBuildProjectDirectory)\Target\</TargetDir>
<ReportDir>$(TargetDir)Report\</ReportDir>
<PerfReportDir>$(ReportDir)Perf\</PerfReportDir>
<UnitReportDir>$(ReportDir)Unit\</UnitReportDir>
<DocDir>$(TargetDir)Doc\</DocDir>
<DistDir>$(TargetDir)Dist\</DistDir>
<BinDir>$(TargetDir)Bin\</BinDir>
<NuGetDir>$(TargetDir)Package\</NuGetDir>
<MSBuildNuGetTasksPath>$(MSBuildProjectDirectory)\Tools\MSBuildNuGetTasks</MSBuildNuGetTasksPath>
</PropertyGroup>
<Import Project="$(MSBuildCommunityTasksPath)MSBuild.Community.Tasks.Targets" />
<Import Project="$(MSBuildNuGetTasksPath)\MSBuild.NuGet.Tasks.Targets" />
<Target Name="Clean">
<RemoveDir Directories="$(TargetDir)" />
<RemoveDir Directories="$(MSBuildProjectDirectory)\Atomic\bin" />
<RemoveDir Directories="$(MSBuildProjectDirectory)\Atomic\obj" />
<RemoveDir Directories="$(MSBuildProjectDirectory)\Disruptor\bin" />
<RemoveDir Directories="$(MSBuildProjectDirectory)\Disruptor\obj" />
<RemoveDir Directories="$(MSBuildProjectDirectory)\Disruptor.Scheduler\bin" />
<RemoveDir Directories="$(MSBuildProjectDirectory)\Disruptor.Scheduler\obj" />
<RemoveDir Directories="$(MSBuildProjectDirectory)\Atomic.Tests\bin" />
<RemoveDir Directories="$(MSBuildProjectDirectory)\Atomic.Tests\obj" />
<RemoveDir Directories="$(MSBuildProjectDirectory)\Disruptor.PerfTests\bin" />
<RemoveDir Directories="$(MSBuildProjectDirectory)\Disruptor.PerfTests\obj" />
<RemoveDir Directories="$(MSBuildProjectDirectory)\Disruptor.Tests\bin" />
<RemoveDir Directories="$(MSBuildProjectDirectory)\Disruptor.Tests\obj" />
</Target>
<Target Name="PreBuild" DependsOnTargets="Clean">
<MakeDir Directories="$(TargetDir)" />
<MakeDir Directories="$(ReportDir)" />
<MakeDir Directories="$(DocDir)" />
<MakeDir Directories="$(DistDir)" />
<MakeDir Directories="$(PerfReportDir)" />
<MakeDir Directories="$(UnitReportDir)" />
<MakeDir Directories="$(BinDir)" />
<MakeDir Directories="$(NuGetDir)" />
</Target>
<Target Name="UpdateVersion" Condition=" '$(DisruptorVersion)' != '' " DependsOnTargets="PreBuild">
<AssemblyInfo CodeLanguage="CS"
OutputFile="$(MsBuildProjectDirectory)\Version.cs"
AssemblyCompany="http://github.com/odeheurles/Disruptor-net/network"
AssemblyProduct="Disruptor"
AssemblyCopyright="Copyright © disruptor-net"
AssemblyVersion="$(DisruptorVersion)"
AssemblyFileVersion="$(DisruptorVersion)" />
</Target>
<!-- Compiles the VS solution -->
<Target Name="Build" DependsOnTargets="UpdateVersion">
<MSBuild
Projects="NDisruptor.sln"
Properties="Configuration=Release;OutputPath=$(BinDir);Optimize=true"
StopOnFirstFailure="true"
ContinueOnError="false"
/>
</Target>
<!-- Run Unit tests (Using MSBuild.Community) -->
<Target Name="Test" DependsOnTargets="Build">
<NUnit
Assemblies="$(BinDir)\Disruptor.Tests.dll"
ToolPath="$(NUnitToolPath)"
OutputXmlFile="$(UnitReportDir)\Disruptor.Tests.xml"
/>
<NUnit
Assemblies="$(BinDir)\Atomic.Tests.dll"
ToolPath="$(NUnitToolPath)"
OutputXmlFile="$(UnitReportDir)\Atomic.Tests.xml"
/>
</Target>
<!-- Run performance tests (Using MSBuild.Community) -->
<Target Name="Perf" DependsOnTargets="Build">
<NUnit
Assemblies="$(BinDir)\Disruptor.PerfTests.dll"
ToolPath="$(NUnitToolPath)"
OutputXmlFile="$(UnitReportDir)\UnitTests.xml"
/>
</Target>
<Target Name="Package" DependsOnTargets="Test">
<!-- Zip binnaries -->
<ItemGroup>
<DisruptorZip Include="$(BinDir)Disruptor.dll" />
<DisruptorZip Include="$(BinDir)Disruptor.pdb" />
<DisruptorZip Include="$(BinDir)Disruptor.XML" />
<DisruptorZip Include="$(BinDir)Atomic.dll" />
<DisruptorZip Include="$(BinDir)Atomic.pdb" />
<DisruptorZip Include="$(BinDir)Atomic.XML" />
<DisruptorZip Include="$(BinDir)Disruptor.Scheduler.dll" />
<DisruptorZip Include="$(BinDir)Disruptor.Scheduler.pdb" />
<DisruptorZip Include="$(BinDir)Disruptor.Scheduler.XML" />
</ItemGroup>
<Zip Files="@(DisruptorZip)" WorkingDirectory="$(BinDir)" ZipFileName="Target\Dist\Disruptor-binaries-$(DisruptorVersion).zip" ZipLevel="9" />
<!-- Zip perf test runner -->
<ItemGroup>
<DisruptorPerfZip Include="$(BinDir)Disruptor.dll" />
<DisruptorPerfZip Include="$(BinDir)Disruptor.pdb" />
<DisruptorPerfZip Include="$(BinDir)Disruptor.XML" />
<DisruptorPerfZip Include="$(BinDir)Disruptor.PerfTests.exe" />
<DisruptorPerfZip Include="$(BinDir)Disruptor.PerfTests.pdb" />
<DisruptorPerfZip Include="$(BinDir)Atomic.dll" />
<DisruptorPerfZip Include="$(BinDir)Atomic.pdb" />
<DisruptorPerfZip Include="$(BinDir)Atomic.XML" />
<DisruptorPerfZip Include="$(BinDir)Disruptor.Scheduler.dll" />
<DisruptorPerfZip Include="$(BinDir)Disruptor.Scheduler.pdb" />
<DisruptorPerfZip Include="$(BinDir)Disruptor.Scheduler.XML" />
<DisruptorPerfZip Include="$(BinDir)nunit.framework.dll" />
</ItemGroup>
<Zip Files="@(DisruptorPerfZip)" WorkingDirectory="$(BinDir)" ZipFileName="Target\Dist\Disruptor-perfRunner-$(DisruptorVersion).zip" ZipLevel="9" />
<!-- Update NuGet manifest -->
<ManifestUpdate
ManifestFile="$(SourceDir)\Package.nuspec"
WorkingDirectory="$(BinDir)"
Version="$(DisruptorVersion)"
/>
<!-- Create NuGet package -->
<Pack
NuGetExePath="$(SourceDir)\Tools\NuGet\NuGet.exe"
ManifestFile="$(SourceDir)\Package.nuspec"
BasePath="$(BinDir)"
OutputDirectory="$(NuGetDir)"
Verbose="true"
/>
<!-- Copy packages to output folder -->
<ItemGroup>
<Zips Include="Target\Dist\Disruptor-binaries-$(DisruptorVersion).zip" />
<Zips Include="Target\Dist\Disruptor-perfRunner-$(DisruptorVersion).zip" />
</ItemGroup>
<Copy
SourceFiles="@(Zips)"
DestinationFolder="C:\Disruptor-release"
/>
</Target>
<Target Name="PackAndPublish" DependsOnTargets="Package">
<Exec Command="$(SourceDir)\Tools\NuGet\NuGet.exe Push $(NuGetDir)Disruptor.$(DisruptorVersion).nupkg"/>
</Target>
</Project>