This repository has been archived by the owner on Mar 20, 2019. It is now read-only.
/
projecttemplates.proj
280 lines (244 loc) · 14.2 KB
/
projecttemplates.proj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))\EnlistmentInfo.props" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))' != '' " />
<Import Project="$(MSBuildProjectDirectory)\..\tools\DotNetOpenAuth.automated.props"/>
<Import Project="ProjectTemplates.props"/>
<PropertyGroup>
<ProjectTemplateMaxPath Condition=" '$(ProjectTemplateMaxPath)' == '' ">10</ProjectTemplateMaxPath>
<LayoutDependsOn>
BuildUnifiedProduct;
ResignShippingDelaySignedAssemblies;
DeploySql;
LayoutProjects;
</LayoutDependsOn>
<!-- We don't need to build the project templates, but to make sure we're not shipping junk,
we default to building them as a validation step. -->
<LayoutDependsOn Condition=" '$(Validation)' == 'Full' ">
Validate;
$(LayoutDependsOn);
</LayoutDependsOn>
</PropertyGroup>
<ItemGroup>
<ProjectTemplates Include="**\*.*proj" Exclude="$(MSBuildThisFile)" />
<ProjectReferencesToRemove Include="..\RelyingPartyDatabase\RelyingPartyDatabase.sqlproj"/>
<AssemblyReferencesToReplaceWith Include="REMOVE" />
</ItemGroup>
<Target Name="Validate">
<MSBuild Projects="@(ProjectTemplates)" BuildInParallel="$(BuildInParallel)" />
</Target>
<Target Name="DeploySql">
<!-- This causes the SQL script that generates the database to be deployed to the RelyingPartyLogic class library. -->
<MSBuild Projects="RelyingPartyDatabase\RelyingPartyDatabase.sqlproj" Targets="Build" BuildInParallel="$(BuildInParallel)" />
</Target>
<Target Name="LayoutProjects">
<MSBuild Projects="..\src\$(ProductName)\$(ProductName).proj" Targets="Sign" BuildInParallel="$(BuildInParallel)">
<Output TaskParameter="TargetOutputs" ItemName="SignedProductAssemblies" />
</MSBuild>
<ItemGroup>
<UnifiedSignedProductAssembly Include="@(SignedProductAssemblies)" Condition=" '%(SignedProductAssemblies.FileName)' == '$(ProductName)' " />
<TemplateProjects Include="**\*.csproj" Exclude="$(MSBuildThisFile)">
<AfterTokens>$safeprojectname$</AfterTokens>
<!-- Projects can get changed after the transform+copy operation, so don't skip copying them. -->
<SkipUnchangedFiles>false</SkipUnchangedFiles>
</TemplateProjects>
<TemplateProjects>
<BeforeTokens>%(RecursiveDir)</BeforeTokens>
</TemplateProjects>
<TemplateProjectsLayout Include="@(TemplateProjects->'$(ProjectTemplatesLayoutPath)%(RecursiveDir)%(FileName)%(Extension)')"/>
<!-- Add external libraries and their symbols -->
<ProjectTemplateLibraries Include="@(UnifiedSignedProductAssembly)" />
<ProjectTemplateLibraries Include="@(UnifiedSignedProductAssembly->'%(SymbolPath)')" />
<ProjectTemplateLibraries Include="@(UnifiedSignedProductAssembly->'%(XmlDocumentationFile)')" />
<!-- ... and log4net -->
<ProjectTemplateLibraries Include="$(ProjectRoot)lib\log4net.dll" />
<ProjectTemplateLibraries Include="$(ProjectRoot)lib\log4net.xml" />
<ProjectTemplateLibrariesTargets Include="@(ProjectTemplateLibraries->'$(ProjectTemplatesLayoutPath)RelyingPartyLogic\lib\%(CultureDir)%(FileName)%(Extension)')">
<ApparentSource>RelyingPartyLogic\lib\%(ProjectTemplateLibraries.CultureDir)%(FileName)%(Extension)</ApparentSource>
<ActualSource>%(Identity)</ActualSource>
</ProjectTemplateLibrariesTargets>
<ProjectTemplateLibrariesSourceExceptions Include="@(ProjectTemplateLibrariesTargets->'%(ApparentSource)')"/>
<FixupReferenceAssemblies Include="@(ProjectTemplateLibrariesTargets)" Condition="'%(Extension)' == '.dll'" />
<InjectedLibraryItems Include="@(ProjectTemplateLibraries->'lib\%(CultureDir)%(FileName)%(Extension)')">
<Visible/>
<UnsignedAssemblyPath/>
<SymbolPath/>
<OriginalItemSpec/>
<MSBuildSourceProjectFile/>
<MSBuildSourceTargetName/>
<CultureDir/>
</InjectedLibraryItems>
<VSProjectTemplates Include="**\*.vstemplate" Exclude="*.vstemplate" />
<VSProjectTemplatesLayout Include="@(VSProjectTemplates->'$(ProjectTemplatesLayoutPath)%(RecursiveDir)%(FileName)%(Extension)')" />
</ItemGroup>
<Trim Inputs="@(TemplateProjects)" MetadataName="BeforeTokens" AllAfter="\">
<Output TaskParameter="Outputs" ItemName="TemplateProjectsTransformSource" />
</Trim>
<CopyWithTokenSubstitution SourceFiles="@(TemplateProjectsTransformSource)" DestinationFiles="@(TemplateProjectsLayout)">
<Output TaskParameter="CopiedFiles" ItemName="CopiedProjectFiles" />
</CopyWithTokenSubstitution>
<ChangeProjectReferenceToAssemblyReference
Projects="@(CopiedProjectFiles)"
Condition=" '%(CopiedProjectFiles.Extension)' == '.csproj' "
ProjectReferences="@(ProjectReferencesToRemove)"
References="@(AssemblyReferencesToReplaceWith)" />
<FixupReferenceHintPaths
Projects="@(CopiedProjectFiles)"
References="@(FixupReferenceAssemblies)"
/>
<AddProjectItems
Projects="@(CopiedProjectFiles)"
Condition="'%(CopiedProjectFiles.FileName)%(CopiedProjectFiles.Extension)' == 'RelyingPartyLogic.csproj'"
Items="@(InjectedLibraryItems)"
/>
<MergeProjectWithVSTemplate
ProjectItemTypes="@(VsTemplateProjectItemTypes)"
ReplaceParametersExtensions="@(VsTemplateParameterReplaceExtensions)"
SourceTemplates="@(VSProjectTemplates)"
SourceProjects="@(TemplateProjectsLayout)"
DestinationTemplates="@(VSProjectTemplatesLayout)"
SourcePathExceptions="@(ProjectTemplateLibrariesSourceExceptions)"
MaximumRelativePathLength="$(ProjectTemplateMaxPath)"
>
<Output TaskParameter="ProjectItems" ItemName="TemplateProjectItems"/>
</MergeProjectWithVSTemplate>
</Target>
<Target Name="Layout" DependsOnTargets="$(LayoutDependsOn)">
<ItemGroup>
<TemplateProjectItems Condition=" '%(Transform)' == 'true' ">
<BeforeTokens>%(RecursiveDir)</BeforeTokens>
<AfterTokens>$safeprojectname$</AfterTokens>
</TemplateProjectItems>
<TemplateProjectItems>
<SkipUnchangedFiles>true</SkipUnchangedFiles>
</TemplateProjectItems>
<TemplateProjectItemsForTransformSource Include="@(TemplateProjectItems->'%(SourceFullPath)')" />
<TemplateProjectItemsForTransformLayout Include="@(TemplateProjectItems->'%(DestinationFullPath)')" />
<RootVsTemplateSource Include="*.vstemplate" />
<ProjectTemplatesSource Include="@(RootVsTemplateSource)" />
<ProjectTemplatesLayout Include="@(RootVsTemplateSource->'$(ProjectTemplatesLayoutPath)%(FileName)%(Extension)')" />
<!-- Include the template icon -->
<ProjectTemplatesSource Include="$(ProjectRoot)doc\logo\favicon.ico" />
<ProjectTemplatesLayout Include="$(ProjectTemplatesLayoutPath)__TemplateIcon.ico" />
<TopLevelVS2010ProjectTemplates Include="@(ProjectTemplatesLayout)" Condition=" '%(Extension)' == '.vstemplate' and '%(RootDir)%(Directory)' == '$(ProjectTemplatesLayoutPath)' " />
<VS2010ProjectTemplateZipFiles Include="@(TopLevelVS2010ProjectTemplates->'%(RootDir)%(Directory)%(FileName).zip')" />
<TemplateProjectItemsForTransformLayoutFixups Include="@(TemplateProjectItemsForTransformLayout)" Condition=" '%(Extension)' == '.aspx' ">
<Pattern><%@ Register Assembly="DotNetOpenAuth[^"]+"</Pattern>
<Replacement><%@ Register Assembly="DotNetOpenAuth"</Replacement>
</TemplateProjectItemsForTransformLayoutFixups>
<TemplateProjectItemsForTransformLayoutFixups Include="@(TemplateProjectItemsForTransformLayout)" Condition=" '%(Extension)' == '.xaml' ">
<Pattern>xmlns\:(.+)assembly=DotNetOpenAuth([^;"]+)</Pattern>
<Replacement>xmlns:$1assembly=DotNetOpenAuth</Replacement>
</TemplateProjectItemsForTransformLayoutFixups>
<TemplateProjectItemsForTransformLayoutFixups Include="@(TemplateProjectItemsForTransformLayout)" Condition=" '%(Extension)' == '.config' ">
<Pattern>type="DotNetOpenAuth([^,]+), DotNetOpenAuth([^"]+)"</Pattern>
<Replacement>type="DotNetOpenAuth$1, DotNetOpenAuth"</Replacement>
</TemplateProjectItemsForTransformLayoutFixups>
</ItemGroup>
<Copy
SourceFiles="@(ProjectTemplatesSource)"
DestinationFiles="@(ProjectTemplatesLayout)"
SkipUnchangedFiles="true" />
<CopyWithTokenSubstitution
SourceFiles="@(TemplateProjectItemsForTransformSource)"
DestinationFiles="@(TemplateProjectItemsForTransformLayout)" />
<RegexFileReplace
Files="@(TemplateProjectItemsForTransformLayoutFixups)"
Pattern="%(Pattern)"
Replacement="%(Replacement)" />
<ItemGroup>
<ProjectTemplateIntendedFiles Include="
@(ProjectTemplatesLayout);
@(TemplateProjectItemsForTransformLayout);
@(VSProjectTemplatesLayout);
@(TemplateProjectsLayout);
@(VS2010ProjectTemplateZipFiles);
" />
<ProjectTemplateIntendedFiles Remove="@(ProjectItemShortPathAdjustments)" />
</ItemGroup>
<Purge Directories="$(ProjectTemplatesLayoutPath)"
IntendedFiles="@(ProjectTemplateIntendedFiles)" />
</Target>
<Target Name="Zip" DependsOnTargets="Layout" Returns="%(VS2010ProjectTemplateContents.ZipFile)">
<DiscoverProjectTemplates TopLevelTemplates="@(TopLevelVS2010ProjectTemplates)">
<Output TaskParameter="ProjectTemplates" ItemName="SubVS2010Templates" />
<Output TaskParameter="ProjectTemplateContents" ItemName="VS2010TemplateItemContents" />
</DiscoverProjectTemplates>
<ItemGroup>
<!-- Include in each template .zip file the top-level .vstemplate file itself. -->
<VS2010ProjectTemplateContents Include="@(TopLevelVS2010ProjectTemplates)">
<ZipFile>$(ProjectTemplatesLayoutPath)%(FileName).zip</ZipFile>
<WorkingDirectory>$(ProjectTemplatesLayoutPath)</WorkingDirectory>
</VS2010ProjectTemplateContents>
<!-- Now throw in all the files in each of the project-level template's directories and their children. -->
<VS2010ProjectTemplateContents Include="@(VS2010TemplateItemContents)">
<ZipFile>$(ProjectTemplatesLayoutPath)%(VS2010TemplateItemContents.TopLevelTemplateFileName).zip</ZipFile>
<WorkingDirectory>$(ProjectTemplatesLayoutPath)</WorkingDirectory>
</VS2010ProjectTemplateContents>
<!-- Include the template icon for each .zip file. -->
<VS2010ProjectTemplateContents Include="@(TopLevelVS2010ProjectTemplates->'$(ProjectTemplatesLayoutPath)__TemplateIcon.ico')">
<ZipFile>$(ProjectTemplatesLayoutPath)%(TopLevelVS2010ProjectTemplates.FileName).zip</ZipFile>
<WorkingDirectory>$(ProjectTemplatesLayoutPath)</WorkingDirectory>
</VS2010ProjectTemplateContents>
<ExtensionVsixContents Include="%(VS2010ProjectTemplateContents.ZipFile)" />
</ItemGroup>
<Zip
Files="@(VS2010ProjectTemplateContents)"
ZipFileName="%(VS2010ProjectTemplateContents.ZipFile)"
WorkingDirectory="%(VS2010ProjectTemplateContents.WorkingDirectory)"
ZipLevel="$(ZipLevel)"
/>
</Target>
<Target Name="Layout2008" DependsOnTargets="Layout">
<ItemGroup>
<ProjectTemplates2008Source Include="$(ProjectTemplatesLayoutPath)**" Exclude="$(ProjectTemplatesLayoutPath)*.zip" />
<ProjectTemplates2008Layout Include="@(ProjectTemplates2008Source->'$(ProjectTemplates2008LayoutPath)%(RecursiveDir)%(FileName)%(Extension)')" />
<ProjectTemplates2008Layout>
<HardLink Condition=" '%(Extension)' != '.csproj' ">true</HardLink>
</ProjectTemplates2008Layout>
<VS2008ProjectTemplates Include="@(ProjectTemplates2008Layout)" Condition="'%(Extension)' == '.vstemplate'" />
<TopLevelVS2008ProjectTemplates Include="@(VS2008ProjectTemplates)" Condition="'%(RootDir)%(Directory)' == '$(ProjectTemplates2008LayoutPath)'" />
<VS2008ProjectTemplateZipFiles Include="@(TopLevelVS2008ProjectTemplates->'%(RootDir)%(Directory)%(FileName).zip')" />
</ItemGroup>
<Message Text="VS2008ProjectTemplates: @(VS2008ProjectTemplates)" />
<HardLinkCopy SourceFiles="@(ProjectTemplates2008Source)" DestinationFiles="@(ProjectTemplates2008Layout)" />
<DowngradeProjects
Projects="@(ProjectTemplates2008Layout)"
Condition="'%(Extension)' == '.csproj'"
DowngradeMvc2ToMvc1="$(DowngradeMvc2ToMvc1)"
InPlaceDowngrade="true"
/>
<Purge Directories="$(ProjectTemplates2008LayoutPath)"
IntendedFiles="@(ProjectTemplates2008Layout);@(VS2008ProjectTemplateZipFiles)" />
</Target>
<Target Name="Zip2008" DependsOnTargets="Layout2008" Returns="%(VS2008ProjectTemplateContents.ZipFile)">
<DiscoverProjectTemplates TopLevelTemplates="@(TopLevelVS2008ProjectTemplates)">
<Output TaskParameter="ProjectTemplates" ItemName="SubVS2008Templates" />
<Output TaskParameter="ProjectTemplateContents" ItemName="VS2008TemplateItemContents" />
</DiscoverProjectTemplates>
<ItemGroup>
<!-- Include in each template .zip file the top-level .vstemplate file itself. -->
<VS2008ProjectTemplateContents Include="@(TopLevelVS2008ProjectTemplates)">
<ZipFile>$(ProjectTemplates2008LayoutPath)%(FileName).zip</ZipFile>
<WorkingDirectory>$(ProjectTemplates2008LayoutPath)</WorkingDirectory>
</VS2008ProjectTemplateContents>
<!-- Now throw in all the files in each of the project-level template's directories and their children. -->
<VS2008ProjectTemplateContents Include="@(VS2008TemplateItemContents)">
<ZipFile>$(ProjectTemplates2008LayoutPath)%(VS2008TemplateItemContents.TopLevelTemplateFileName).zip</ZipFile>
<WorkingDirectory>$(ProjectTemplates2008LayoutPath)</WorkingDirectory>
</VS2008ProjectTemplateContents>
<!-- Include the template icon for each .zip file. -->
<VS2008ProjectTemplateContents Include="@(TopLevelVS2008ProjectTemplates->'$(ProjectTemplates2008LayoutPath)__TemplateIcon.ico')">
<ZipFile>$(ProjectTemplates2008LayoutPath)%(TopLevelVS2008ProjectTemplates.FileName).zip</ZipFile>
<WorkingDirectory>$(ProjectTemplates2008LayoutPath)</WorkingDirectory>
</VS2008ProjectTemplateContents>
</ItemGroup>
<Zip
Files="@(VS2008ProjectTemplateContents)"
ZipFileName="%(VS2008ProjectTemplateContents.ZipFile)"
WorkingDirectory="%(VS2008ProjectTemplateContents.WorkingDirectory)"
ZipLevel="$(ZipLevel)"
/>
</Target>
<Target Name="Build" DependsOnTargets="Zip;Zip2008" />
<Import Project="$(ProjectRoot)tools\DotNetOpenAuth.automated.targets"/>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))\EnlistmentInfo.targets" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))' != '' " />
</Project>