Little renaming.
[dotnetoauth.git] / build.proj
blob4db4d0673ecb2849172e3b75b5df014be662eff2
1 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
2         <Import Project="$(MSBuildProjectDirectory)\tools\DotNetOAuth.Common.Settings.targets"/>\r
3         <PropertyGroup>\r
4                 <AutomatedBuild>true</AutomatedBuild>\r
5         </PropertyGroup>\r
6 \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
11         <ItemGroup>\r
12                 <!--<SampleDirectories Include="" />-->\r
13                 <Samples Include="$(ProjectRoot)\samples\**\*.csproj" />\r
14         </ItemGroup>\r
15         \r
16         <Target Name="Clean" DependsOnTargets="CleanDocumentation">\r
17                 <MSBuild Projects="$(ProjectRoot)\src\$(ProductName).sln" Targets="Clean" />\r
18                 <ItemGroup>\r
19                         <DirtyDirectories Include="\r
20                                                    $(ProjectRoot)\bin;\r
21                                                    $(ProjectRoot)\**\obj;\r
22                                                    $(ProjectRoot)\doc\api;\r
23                                                    $(ProjectRoot)\drops;\r
24                                                    $(ProjectRoot)\src\PrecompiledWeb;\r
25                                                    " />\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
32                                              " />\r
33                 </ItemGroup>\r
34                 <Delete Files="@(DirtyFiles)" />\r
35                 <RemoveDir Directories="@(DirtyDirectories)" />\r
36         </Target>\r
38         <Target Name="BuildProduct">\r
39                 <MSBuild Projects="$(ProjectRoot)\src\$(ProductName)\$(ProductName).csproj" />\r
40         </Target>\r
42         <Target Name="BuildTests">\r
43                 <MSBuild Projects="$(ProjectRoot)\src\$(ProductName).Test\$(ProductName).Test.csproj" />\r
44         </Target>\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
49         </Target>\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
56         </Target>\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
63         </Target>\r
65         <Target Name="Documentation" DependsOnTargets="BuildProduct;Chm">\r
66         </Target>\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
74         </Target>\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
79                 <PropertyGroup>\r
80                         <Sign>true</Sign>\r
81                 </PropertyGroup>\r
82         </Target>\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
88         </Target>\r
90         <Target Name="Drop" DependsOnTargets="_SetDropProperties;GetBuildVersion;_EnsureCleanDrop;Build;Documentation">\r
91                 <Warning Condition=" '$(Configuration)' != 'release' " Text="Building $(Configuration) instead of Release!" />\r
92                 <PropertyGroup>\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
98                 </PropertyGroup>\r
99                 <ItemGroup>\r
100                         <DropDirectories Include="\r
101                                                  $(DropDirectory);\r
102                                                  $(DropBinDirectory);\r
103                                                  $(DropSamplesDirectory);\r
104                                                  $(DropSpecsDirectory);\r
105                                                                                  " />\r
107                         <DropSourceFiles Include="\r
108                                                   $(ProjectRoot)\Doc\$(ProductName).chm;\r
109                                                   $(ProjectRoot)\Doc\*.htm*;\r
110                                                   " />\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
122                                                                                                                         " />\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
136                                                                                 " />\r
138                         <AllDropTargets Include="\r
139                                                                                 @(DropFiles);\r
140                                                                                 @(DropBinFiles);\r
141                                                                                 @(DropSamplesFiles);\r
142                                                                                 @(DropDocFiles);\r
143                                                                                 @(DropSpecsFiles)\r
144                                                                                 " />\r
145                 </ItemGroup>\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
150                 <ItemGroup>\r
151                         <SampleProjectTargets Include="$(DropSamplesDirectory)\**\*.csproj" />\r
152                 </ItemGroup>\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
156         </Target>\r
158         <Target Name="Nightly" DependsOnTargets="Drop;Test">\r
160         </Target>\r
162 </Project>\r