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;Build;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*;
111 <DropBinSourceFiles Include="$(OutputPath)\$(ProductName).???" />
112 <DropSamplesSourceFiles Include="$(ProjectRoot)\Samples\**" Exclude="
113 $(ProjectRoot)\**\obj\**;
114 $(ProjectRoot)\**\*.user;
115 $(ProjectRoot)\**\*.sln.cache;
116 $(ProjectRoot)\**\*.suo;
117 $(ProjectRoot)\**\*.user;
118 $(ProjectRoot)\**\*.gitignore;
119 $(ProjectRoot)\**\*.ldf;
120 $(ProjectRoot)\**\*.log*;
121 $(ProjectRoot)\**\*~;
123 <DropSpecsSourceFiles Include="$(ProjectRoot)\Doc\specs\*.htm*" />
125 <DropFiles Include="@(DropSourceFiles->'$(DropDirectory)\%(RecursiveDir)%(FileName)%(Extension)')"/>
126 <DropBinFiles Include="@(DropBinSourceFiles->'$(DropBinDirectory)\%(RecursiveDir)%(FileName)%(Extension)')"/>
127 <DropSamplesFiles Include="@(DropSamplesSourceFiles->'$(DropSamplesDirectory)\%(RecursiveDir)%(FileName)%(Extension)')"/>
128 <DropSpecsFiles Include="@(DropSpecsSourceFiles->'$(DropSpecsDirectory)\%(RecursiveDir)%(FileName)%(Extension)')"/>
130 <AllDropSources Include="
132 @(DropBinSourceFiles);
133 @(DropSamplesSourceFiles);
134 @(DropDocSourceFiles);
135 @(DropSpecsSourceFiles);
138 <AllDropTargets Include="
147 <MakeDir Directories="@(DropDirectories)" />
148 <Copy SourceFiles="@(AllDropSources)" DestinationFiles="@(AllDropTargets)" SkipUnchangedFiles="true" />
149 <!-- fix up the samples so that they will compile right out of the drop -->
151 <SampleProjectTargets Include="$(DropSamplesDirectory)\**\*.csproj" />
153 <ChangeProjectReferenceToAssemblyReference Projects="@(SampleProjectTargets)"
154 ProjectReference="..\..\src\$(ProductName)\$(ProductName).csproj" Reference="..\..\Bin\$(ProductName).dll" />
155 <Zip Files="@(AllDropTargets)" ZipFileName="$(DropZip)" WorkingDirectory="$(ProjectRoot)\drops" />
158 <Target Name="Nightly" DependsOnTargets="Drop;Test">