Added sreg client javascript support for responses.
[dotnetoauth.git] / build.proj
blob4805034669632541ce8ae9f3a7601935c9f8696e
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;Build;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                                                   " />
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)\**\*~;
122                                                                                                                         " />
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="
131                                                                                 @(DropSourceFiles);
132                                                                                 @(DropBinSourceFiles);
133                                                                                 @(DropSamplesSourceFiles);
134                                                                                 @(DropDocSourceFiles);
135                                                                                 @(DropSpecsSourceFiles);
136                                                                                 " />
138                         <AllDropTargets Include="
139                                                                                 @(DropFiles);
140                                                                                 @(DropBinFiles);
141                                                                                 @(DropSamplesFiles);
142                                                                                 @(DropDocFiles);
143                                                                                 @(DropSpecsFiles)
144                                                                                 " />
145                 </ItemGroup>
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 -->
150                 <ItemGroup>
151                         <SampleProjectTargets Include="$(DropSamplesDirectory)\**\*.csproj" />
152                 </ItemGroup>
153                 <ChangeProjectReferenceToAssemblyReference Projects="@(SampleProjectTargets)"
154                   ProjectReference="..\..\src\$(ProductName)\$(ProductName).csproj" Reference="..\..\Bin\$(ProductName).dll" />
155                 <Zip Files="@(AllDropTargets)" ZipFileName="$(DropZip)" WorkingDirectory="$(ProjectRoot)\drops" />
156         </Target>
158         <Target Name="Nightly" DependsOnTargets="Drop;Test">
160         </Target>
162 </Project>