Removed old .refresh file.
[dotnetoauth.git] / build.proj
blobbcdb82ff16e22b87b74d6a88fb511aabd0ee6496
1 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2         <Import Project="$(MSBuildProjectDirectory)\tools\DotNetOpenAuth.Common.Settings.targets"/>
3         <PropertyGroup>
4                 <AutomatedBuild>true</AutomatedBuild>
5         </PropertyGroup>
7         <Import Project="$(ProjectRoot)\tools\$(ProductName).Versioning.targets"/>
8         <Import Project="$(ProjectRoot)\tools\Documentation.targets"/>
9         <UsingTask AssemblyFile="$(ProjectRoot)\lib\MSBuild.Community.Tasks.dll" TaskName="Zip"/>
11         <ItemGroup>
12                 <!--<SampleDirectories Include="" />-->
13                 <Samples Include="$(ProjectRoot)\samples\**\*.csproj" />
14         </ItemGroup>
15         
16         <Target Name="Clean" DependsOnTargets="CleanDocumentation">
17                 <MSBuild Projects="$(ProjectRoot)\src\$(ProductName).sln" Targets="Clean" />
18                 <ItemGroup>
19                         <DirtyDirectories Include="
20                                                    $(ProjectRoot)\bin;
21                                                    $(ProjectRoot)\**\obj;
22                                                    $(ProjectRoot)\doc\api;
23                                                    $(ProjectRoot)\drops;
24                                                    $(ProjectRoot)\src\PrecompiledWeb;
25                                                    " />
26                         <DirtyDirectories Include="@(SampleDirectories->'%(FullPath)\bin')" />
27                         <DirtyDirectories Include="@(SampleDirectories->'%(FullPath)\obj')" />
28                         <DirtyFiles Include="
29                                              $(ProjectRoot)\**\*~;
30                                              $(ProjectRoot)\**\*.log*;
31                                              $(ProjectRoot)\doc\$(ProductName).chm;
32                                              " />
33                 </ItemGroup>
34                 <Delete Files="@(DirtyFiles)" />
35                 <RemoveDir Directories="@(DirtyDirectories)" />
36         </Target>
38         <Target Name="BuildProduct">
39                 <MSBuild Projects="$(ProjectRoot)\src\$(ProductName)\$(ProductName).csproj" />
40         </Target>
42         <Target Name="BuildTests">
43                 <MSBuild Projects="$(ProjectRoot)\src\$(ProductName).Test\$(ProductName).Test.csproj" />
44         </Target>
46         <Target Name="BuildSamples">
47                 <!-- poor man's list of samples until we decide to maintain the real list here. -->
48                 <MSBuild Projects="@(Samples)" />
49         </Target>
51         <Target Name="Build">
52                 <!-- We explicitly pass the Sign property in because if properties are set
53                      inside this very .proj file instead of being passed on the command-line, their
54                      values won't propagate automatically. -->
55                 <MSBuild Projects="$(ProjectRoot)\src\$(ProductName).sln" Properties="Sign=$(Sign)" />
56         </Target>
58         <Target Name="Rebuild">
59                 <!-- We explicitly pass the Sign property in because if properties are set
60                      inside this very .proj file instead of being passed on the command-line, their
61                      values won't propagate automatically. -->
62                 <MSBuild Projects="$(ProjectRoot)\src\$(ProductName).sln" Targets="Rebuild" Properties="Sign=$(Sign)" />
63         </Target>
65         <Target Name="Documentation" DependsOnTargets="BuildProduct;Chm">
66         </Target>
68         <!-- Test depends on "Build" rather than "BuildTests" until we can figure out how to build the 
69              no-.csproj file test project (to copy binaries to Bin directory). -->
70         <Target Name="Test" DependsOnTargets="Build"
71                 Inputs="$(OutputPath)\$(ProductName).Test.dll"
72                 Outputs='$(OutputPath)\Test-results.xml;$(OutputPath)\Test-output-results.log'>
73                 <Exec Command='"mstest.exe" /testcontainer:"$(OutputPath)\$(ProductName).Test.dll"' />
74         </Target>
76         <Target Name="_SetDropProperties">
77                 <!-- This target is necessary because PropertyGroups within the same Target as 
78                      where CallTarget is fired do NOT affect those called targets. -->
79                 <PropertyGroup>
80                         <Sign>true</Sign>
81                 </PropertyGroup>
82         </Target>
84         <Target Name="_EnsureCleanDrop">
85                 <!-- This target only does a clean sufficient to guarantee that our DotNetOpenAuth.dll is rebuilt, but
86                      we don't usually want to clean our documentation because that takes forever to build froms scratch. -->
87                 <MSBuild Projects="$(ProjectRoot)\src\$(ProductName).sln" Targets="Clean" />
88         </Target>
90         <Target Name="Drop" DependsOnTargets="_SetDropProperties;GetBuildVersion;_EnsureCleanDrop;BuildProduct;BuildSamples;Documentation">
91                 <Warning Condition=" '$(Configuration)' != 'release' " Text="Building $(Configuration) instead of Release!" />
92                 <PropertyGroup>
93                         <DropDirectory>$(ProjectRoot)\drops\$(ProductName)-$(BuildVersion)</DropDirectory>
94                         <DropZip>$(DropDirectory).zip</DropZip>
95                         <DropBinDirectory>$(DropDirectory)\Bin</DropBinDirectory>
96                         <DropSamplesDirectory>$(DropDirectory)\Samples</DropSamplesDirectory>
97                         <DropSpecsDirectory>$(DropDirectory)\Specs</DropSpecsDirectory>
98                 </PropertyGroup>
99                 <ItemGroup>
100                         <DropDirectories Include="
101                                                  $(DropDirectory);
102                                                  $(DropBinDirectory);
103                                                  $(DropSamplesDirectory);
104                                                  $(DropSpecsDirectory);
105                                                                                  " />
107                         <DropSourceFiles Include="
108                                                                                                                                 $(ProjectRoot)\Doc\$(ProductName).chm;
109                                                                                                                                 $(ProjectRoot)\Doc\*.htm*;
110                                                                                                                                 $(ProjectRoot)\LICENSE.txt;
111                                                                                                                                 $(ProjectRoot)\CONTRIB.txt;
112                                                                                                                                 " />
113                         <DropBinSourceFiles Include="$(OutputPath)\$(ProductName).???" />
114                         <DropSamplesSourceFiles Include="$(ProjectRoot)\Samples\**" Exclude="
115                                                                                                                         $(ProjectRoot)\**\obj\**;
116                                                                                                                         $(ProjectRoot)\**\*.user;
117                                                                                                                         $(ProjectRoot)\**\*.sln.cache;
118                                                                                                                         $(ProjectRoot)\**\*.suo;
119                                                                                                                         $(ProjectRoot)\**\*.user;
120                                                                                                                         $(ProjectRoot)\**\*.gitignore;
121                                                                                                                         $(ProjectRoot)\**\*.ldf;
122                                                                                                                         $(ProjectRoot)\**\*.log*;
123                                                                                                                         $(ProjectRoot)\**\*~;
124                                                                                                                         $(ProjectRoot)\**\Debug\**;
125                                                                                                                         $(ProjectRoot)\**\Settings.StyleCop;
126                                                                                                                         " />
127                         <DropSpecsSourceFiles Include="$(ProjectRoot)\Doc\specs\*.htm*" />
129                         <DropFiles Include="@(DropSourceFiles->'$(DropDirectory)\%(RecursiveDir)%(FileName)%(Extension)')"/>
130                         <DropBinFiles Include="@(DropBinSourceFiles->'$(DropBinDirectory)\%(RecursiveDir)%(FileName)%(Extension)')"/>
131                         <DropSamplesFiles Include="@(DropSamplesSourceFiles->'$(DropSamplesDirectory)\%(RecursiveDir)%(FileName)%(Extension)')"/>
132                         <DropSpecsFiles Include="@(DropSpecsSourceFiles->'$(DropSpecsDirectory)\%(RecursiveDir)%(FileName)%(Extension)')"/>
134                         <AllDropSources Include="
135                                                                                 @(DropSourceFiles);
136                                                                                 @(DropBinSourceFiles);
137                                                                                 @(DropSamplesSourceFiles);
138                                                                                 @(DropDocSourceFiles);
139                                                                                 @(DropSpecsSourceFiles);
140                                                                                 " />
142                         <AllDropTargets Include="
143                                                                                 @(DropFiles);
144                                                                                 @(DropBinFiles);
145                                                                                 @(DropSamplesFiles);
146                                                                                 @(DropDocFiles);
147                                                                                 @(DropSpecsFiles)
148                                                                                 " />
149                 </ItemGroup>
151                 <!-- clean up any previous drop with the same name so we don't aggregate files. -->
152                 <Delete Files="$(DropZip)" />
153                 <RemoveDir Directories="$(DropDirectory)" />
155                 <MakeDir Directories="@(DropDirectories)" />
156                 <Copy SourceFiles="@(AllDropSources)" DestinationFiles="@(AllDropTargets)" SkipUnchangedFiles="true" />
157                 <!-- fix up the samples so that they will compile right out of the drop -->
158                 <ItemGroup>
159                         <SampleProjectTargets Include="$(DropSamplesDirectory)\**\*.csproj" />
160                 </ItemGroup>
161                 <ChangeProjectReferenceToAssemblyReference Projects="@(SampleProjectTargets)"
162                   ProjectReference="..\..\src\$(ProductName)\$(ProductName).csproj" Reference="..\..\Bin\$(ProductName).dll" />
163                 <Zip Files="@(AllDropTargets)" ZipFileName="$(DropZip)" WorkingDirectory="$(ProjectRoot)\drops" />
164         </Target>
166         <Target Name="Nightly" DependsOnTargets="Drop;Test">
168         </Target>
170 </Project>