1 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <Import Project="$(MSBuildProjectDirectory)\tools\DotNetOpenAuth.Common.Settings.targets"/>
4 <AutomatedBuild>true</AutomatedBuild>
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"/>
12 <!--<SampleDirectories Include="" />-->
13 <Samples Include="$(ProjectRoot)\samples\**\*.csproj" />
16 <Target Name="Clean" DependsOnTargets="CleanDocumentation">
17 <MSBuild Projects="$(ProjectRoot)\src\$(ProductName).sln" Targets="Clean" />
19 <DirtyDirectories Include="
21 $(ProjectRoot)\**\obj;
22 $(ProjectRoot)\doc\api;
24 $(ProjectRoot)\src\PrecompiledWeb;
26 <DirtyDirectories Include="@(SampleDirectories->'%(FullPath)\bin')" />
27 <DirtyDirectories Include="@(SampleDirectories->'%(FullPath)\obj')" />
30 $(ProjectRoot)\**\*.log*;
31 $(ProjectRoot)\doc\$(ProductName).chm;
34 <Delete Files="@(DirtyFiles)" />
35 <RemoveDir Directories="@(DirtyDirectories)" />
38 <Target Name="BuildProduct">
39 <MSBuild Projects="$(ProjectRoot)\src\$(ProductName)\$(ProductName).csproj" />
42 <Target Name="BuildTests">
43 <MSBuild Projects="$(ProjectRoot)\src\$(ProductName).Test\$(ProductName).Test.csproj" />
46 <Target Name="BuildSamples">
47 <!-- poor man's list of samples until we decide to maintain the real list here. -->
48 <MSBuild Projects="@(Samples)" />
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)" />
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)" />
65 <Target Name="Documentation" DependsOnTargets="BuildProduct;Chm">
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"' />
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. -->
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" />
90 <Target Name="Drop" DependsOnTargets="_SetDropProperties;GetBuildVersion;_EnsureCleanDrop;BuildProduct;BuildSamples;Documentation">
91 <Warning Condition=" '$(Configuration)' != 'release' " Text="Building $(Configuration) instead of Release!" />
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>
100 <DropDirectories Include="
103 $(DropSamplesDirectory);
104 $(DropSpecsDirectory);
107 <DropSourceFiles Include="
108 $(ProjectRoot)\Doc\$(ProductName).chm;
109 $(ProjectRoot)\Doc\*.htm*;
110 $(ProjectRoot)\LICENSE.txt;
111 $(ProjectRoot)\CONTRIB.txt;
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;
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="
136 @(DropBinSourceFiles);
137 @(DropSamplesSourceFiles);
138 @(DropDocSourceFiles);
139 @(DropSpecsSourceFiles);
142 <AllDropTargets Include="
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 -->
159 <SampleProjectTargets Include="$(DropSamplesDirectory)\**\*.csproj" />
161 <ChangeProjectReferenceToAssemblyReference Projects="@(SampleProjectTargets)"
162 ProjectReference="..\..\src\$(ProductName)\$(ProductName).csproj" Reference="..\..\Bin\$(ProductName).dll" />
163 <Zip Files="@(AllDropTargets)" ZipFileName="$(DropZip)" WorkingDirectory="$(ProjectRoot)\drops" />
166 <Target Name="Nightly" DependsOnTargets="Drop;Test">