-
Notifications
You must be signed in to change notification settings - Fork 1
/
Lokad.Shared.Silverlight.build
140 lines (114 loc) · 5.75 KB
/
Lokad.Shared.Silverlight.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
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
<?xml version="1.0" encoding="utf-8" ?>
<Project DefaultTargets="integrate" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="Resource\Build\MSBuild.Community.Tasks.targets" />
<Import Project="Resource\Build\NCoverExplorer.MSBuildTasks.targets"/>
<!-- Main build entry file (extends development builds)-->
<PropertyGroup>
<!--
Primary configuration properties (override them via command line
if needed
-->
<BuildPath Condition="$(BuildPath)==''">$(MSBuildProjectDirectory)\Build</BuildPath>
<Configuration Condition="$(Configuration)==''">Release</Configuration>
<ArtifactDirectory Condition="$(ArtifactDirectory)==''">$(BuildPath)\Artifact</ArtifactDirectory>
<PackageDirectory Condition="$(PackageDirectory)==''">$(BuildPath)\_Package</PackageDirectory>
<Version Condition="$(Version)==''">0.0.0.0</Version>
<!--
Derived configuration properties
-->
<TestPath>$(BuildPath)\Test</TestPath>
<LibraryPath>$(BuildPath)\Library</LibraryPath>
<LibrarySource>Source\Lokad.Shared\bin\$(Configuration)</LibrarySource>
<QualitySource>Source\Lokad.Quality\bin\$(Configuration)</QualitySource>
<ApiSource>Source\Lokad.Api.Core\bin\$(Configuration)</ApiSource>
<BaseName>$(MSBuildProjectName)</BaseName>
<MSBuildTargets>Silverlight 2.0</MSBuildTargets>
</PropertyGroup>
<!--
Solution redirects. Every VS project normally knows how to support these targets
-->
<Target Name="Build">
<MSBuild Projects="$(BaseName).sln" Targets="Build" Properties="Configuration=$(Configuration);MSBuildTargets=$(MSBuildTargets);BuildConstants=SILVERLIGHT2"/>
</Target>
<Target Name="Clean">
<MSBuild Projects="$(BaseName).sln" Targets="Clean" Properties="Configuration=$(Configuration)"/>
<CreateItem Include="**/Debug/**/*.*;**/Release/**/*.*">
<Output ItemName="_binaryFiles" TaskParameter="Include"/>
</CreateItem>
<Delete Files="@(_binaryFiles)" TreatErrorsAsWarnings="true"/>
<RemoveDir Directories="$(BuildPath)" />
</Target>
<Target Name="Rebuild" DependsOnTargets="Clean;Build;" />
<Target Name="Integrate" DependsOnTargets="Clean;Test;Report" />
<Target Name="Release" DependsOnTargets="Clean;_Version;Build;Test;Report;Distrib" />
<Target Name="Report" DependsOnTargets="Clean;Build;Copy">
<MakeDir Directories="$(ArtifactDirectory)" />
</Target>
<!--
Copies built items to the distrib directory
-->
<Target Name="Copy" DependsOnTargets="Build">
<MakeDir Directories="$(BuildPath)"/>
<!--Library-->
<CreateItem Include="$(LibrarySource)\*.*;$(QualitySource)\*.*">
<Output ItemName="libraryFiles" TaskParameter="Include"/>
</CreateItem>
<Copy SourceFiles="@(libraryFiles)" DestinationFolder="$(LibraryPath)" />
<!--All Tests-->
<CreateItem Include="Test\**\bin\$(Configuration)\*.*" Exclude="Test\**\bin\$(Configuration)\*.xml;Test\**\bin\$(Configuration)\*.pdb;">
<Output ItemName="TestFiles" TaskParameter="Include"/>
</CreateItem>
<Copy SourceFiles="@(TestFiles)" DestinationFolder="$(TestPath)" />
</Target>
<Target Name="Config">
<Message Text="This sub-solution does not need configuration" />
</Target>
<Target Name="Test" DependsOnTargets="Build;Copy">
<MakeDir Directories="$(ArtifactDirectory)" />
<CreateItem Include="$(TestPath)\*.Test.dll;$(TestPath)\*.Tests.dll">
<Output ItemName="_testFiles" TaskParameter="Include"/>
</CreateItem>
<CreateItem Include="$(TestPath)\Lokad.*.dll" Exclude="$(TestPath)\*.Test.dll;$(TestPath)\*.Tests.dll">
<Output ItemName="_coverageFiles" TaskParameter="Include"/>
</CreateItem>
<Exec Command="nunit-console.exe @(_testFiles->'"%(FullPath)"', ' ') /nologo /noshadow /xml="$(ArtifactDirectory)\$(MSBuildProjectName).Tests-result.xml"" WorkingDirectory="Resource/Tool/NUnit" />
<!---->
<!--@(_testFiles->'"%(FullPath)"', ' ')-->
</Target>
<Target Name="_Version">
<CreateItem Include="**\GlobalAssemblyInfo.cs">
<Output ItemName="_VersionPaths" TaskParameter="Include"/>
</CreateItem>
<CreateItem Include="@(_VersionPaths->'%(SubFolder)%(RecursiveDir)VersionAssemblyInfo.cs')">
<Output ItemName="_VersionFiles" TaskParameter="Include"/>
</CreateItem>
<Time Format="yyyy-MM-dd HH:mm">
<Output TaskParameter="FormattedTime" PropertyName="BuildTime" />
</Time>
<AssemblyInfo OutputFile="%(_VersionFiles.FullPath)" CodeLanguage="CS"
AssemblyVersion="$(Version)"
AssemblyFileVersion="$(Version)"
AssemblyConfiguration="$(Configuration) built on $(BuildTime)" />
</Target>
<Target Name="WipeResources">
<!--Wipe old version files-->
<CreateItem Include="**\VersionAssemblyInfo.cs">
<Output ItemName="_VersionPaths" TaskParameter="Include"/>
</CreateItem>
<Delete Files="@(_VersionPaths)" />
</Target>
<Target Name="GenerateHelp" DependsOnTargets="Build;Copy">
<!--<Exec Command="Resource\Tool\SHFB\SandcastleBuilderConsole.exe $(BaseName).shfb" />-->
</Target>
<Target Name="Distrib" DependsOnTargets="Clean;Build;Copy;Config;GenerateHelp">
<MakeDir Directories="$(PackageDirectory)" />
<CreateItem Include="**\*.*" Exclude="**\.svn\**\*.*;**\_svn\**\*.*;*.user;*.suo;*.db;**\bin\**\*.*;**\obj\**\*.*;Resource\Tool\**\*.*;Build\**\*.*;Resource\Build\Profile.Local\*.*">
<Output ItemName="_SourceFiles" TaskParameter="Include" />
</CreateItem>
<Zip Files="@(_SourceFiles)" ZipFileName="$(PackageDirectory)\$(BaseName)-Source-$(Version).zip" Flatten="false" />
<CreateItem Include="$(LibraryPath)\*.*">
<Output ItemName="_libFiles" TaskParameter="Include" />
</CreateItem>
<Zip Files="@(_libFiles)" ZipFileName="$(PackageDirectory)\$(BaseName)-Lib-$(Version).zip" Flatten="true" />
</Target>
</Project>