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