forked from Coevery/Coevery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Coevery.proj
415 lines (337 loc) · 18.4 KB
/
Coevery.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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Initialization -->
<PropertyGroup>
<LibFolder>$(MSBuildProjectDirectory)\lib</LibFolder>
<SrcFolder>$(MSBuildProjectDirectory)\src</SrcFolder>
<BuildFolder>$(MSBuildProjectDirectory)\build</BuildFolder>
<MsBuildTasksFolder>$(MSBuildProjectDirectory)\buildtasks</MsBuildTasksFolder>
<ArtifactsFolder>$(MSBuildProjectDirectory)\artifacts</ArtifactsFolder>
<SqlCeFolder>$(MSBuildProjectDirectory)\lib\sqlce</SqlCeFolder>
<SourceArtifactFolder>$(ArtifactsFolder)\Source</SourceArtifactFolder>
<MsDeployArtifactFolder>$(ArtifactsFolder)\MsDeploy</MsDeployArtifactFolder>
<GalleryArtifactFolder>$(ArtifactsFolder)\Gallery</GalleryArtifactFolder>
<ModulesSrcFolder>$(MSBuildProjectDirectory)\src\Coevery.Web\Modules</ModulesSrcFolder>
<CoeveryCoreSrcFolder>$(MSBuildProjectDirectory)\src\Coevery.Web\Core</CoeveryCoreSrcFolder>
<ThemesSrcFolder>$(MSBuildProjectDirectory)\src\Coevery.Web\Themes</ThemesSrcFolder>
<CompileFolder>$(BuildFolder)\Compile</CompileFolder>
<WebSitesFolder>$(CompileFolder)\_PublishedWebsites</WebSitesFolder>
<StageFolder>$(BuildFolder)\Stage</StageFolder>
<MsDeployFolder>$(BuildFolder)\MsDeploy</MsDeployFolder>
<PrecompiledFolder>$(BuildFolder)\Precompiled</PrecompiledFolder>
<ProfilingFolder>$(BuildFolder)\Profiling</ProfilingFolder>
<GalleryFolder>$(BuildFolder)\Gallery</GalleryFolder>
<BuildPlatform Condition="$(ProgramW6432) != ''">x64</BuildPlatform>
<BuildPlatform Condition="$(BuildPlatform) == ''">x86</BuildPlatform>
<!-- TeamCity build number -->
<Version>$(BUILD_NUMBER)</Version>
</PropertyGroup>
<Import Project="$(LibFolder)\msbuild\MSBuild.Community.Tasks.Targets"/>
<!-- Coordinating Targets -->
<Target Name ="Build">
<CallTarget Targets="Clean"/>
<CallTarget Targets="Compile"/>
<CallTarget Targets="Test"/>
<CallTarget Targets="Package"/>
</Target>
<Target Name="FastBuild">
<CallTarget Targets="Clean"/>
<CallTarget Targets="Compile"/>
<CallTarget Targets="Package"/>
</Target>
<Target Name="FullBuild">
<CallTarget Targets="Clean"/>
<CallTarget Targets="Compile"/>
<CallTarget Targets="Test"/>
<CallTarget Targets="Package"/>
<CallTarget Targets="Spec"/>
<CallTarget Targets="Gallery"/>
</Target>
<Target Name="FastPackage">
<CallTarget Targets="Clean"/>
<CallTarget Targets="Compile"/>
<CallTarget Targets="Package"/>
<CallTarget Targets="Gallery"/>
</Target>
<Target Name="Package">
<CallTarget Targets="Package-Stage"/>
<CallTarget Targets="Package-MsDeploy"/>
<CallTarget Targets="Package-Zip"/>
</Target>
<Target Name="Precompiled">
<CallTarget Targets="Clean"/>
<CallTarget Targets="Compile"/>
<CallTarget Targets="Package-Stage"/>
<CallTarget Targets="Package-Precompiled"/>
</Target>
<Target Name="Profiling">
<CallTarget Targets="Clean"/>
<CallTarget Targets="Compile"/>
<CallTarget Targets="Package-Stage"/>
<CallTarget Targets="Profiling-Stage"/>
<CallTarget Targets="Profiling-Setup"/>
</Target>
<Target Name="Gallery">
<CallTarget Targets="Gallery-Stage"/>
<CallTarget Targets="Gallery-Setup"/>
</Target>
<Target Name="AzureBuild">
<MSBuild Projects="AzurePackage.proj" Targets="Build">
</MSBuild>
</Target>
<Target Name="AzureCIBuild">
<MSBuild Projects="AzurePackage.proj" Targets="CIBuild">
</MSBuild>
</Target>
<!-- Building -->
<Target Name="Clean">
<MSBuild Projects="$(SrcFolder)\Coevery.sln" Targets="Clean" />
<RemoveDir Directories="$(BuildFolder)" ContinueOnError="true"/>
<RemoveDir Directories="$(ArtifactsFolder)" />
</Target>
<Target Name ="Compile">
<!-- Compile to "OutputFolder" -->
<MSBuild
Projects="$(SrcFolder)\Coevery.sln"
Targets="Build"
Properties="Configuration=Release;OutputPath=$(CompileFolder)" />
<!-- Compile to "regular" output folder for devs using VS locally -->
<MSBuild
Projects="$(SrcFolder)\Coevery.sln"
Targets="Build"/>
</Target>
<Target Name ="CompileMsBuildTasks">
<MSBuild
Projects="$(SrcFolder)\Tools\MSBuild.Coevery.Tasks\MSBuild.Coevery.Tasks.csproj"
Targets="Build"
Properties="Configuration=Release;OutputPath=$(MsBuildTasksFolder)" />
</Target>
<!-- Testing -->
<Target Name ="Test">
<!-- TeamCity support -->
<ItemGroup>
<NUnitAddinFiles Include="$(teamcity_dotnet_nunitaddin)-2.5.2.*" />
</ItemGroup>
<Copy SourceFiles="@(NUnitAddinFiles)" DestinationFolder="$(LibFolder)\nunit\addins" />
<!-- Run unit test assemblies -->
<CreateItem Include="$(CompileFolder)\*.Tests.*dll">
<Output TaskParameter="Include" ItemName="TestAssemblies" />
</CreateItem>
<NUnit Assemblies="@(TestAssemblies)" ToolPath="$(LibFolder)\nunit" WorkingDirectory="$(CompileFolder)" OutputXmlFile="$(BuildFolder)\Coevery.Tests.xml" />
</Target>
<Target Name ="Spec" DependsOnTargets="Package-Stage">
<!-- TeamCity support -->
<ItemGroup>
<NUnitAddinFiles Include="$(teamcity_dotnet_nunitaddin)-2.5.2.*" />
</ItemGroup>
<Copy SourceFiles="@(NUnitAddinFiles)" DestinationFolder="$(LibFolder)\nunit\addins" />
<CreateItem Include="$(CompileFolder)\*.Specs.dll">
<Output TaskParameter="Include" ItemName="SpecAssemblies" />
</CreateItem>
<NUnit Assemblies="@(SpecAssemblies)" ToolPath="$(LibFolder)\nunit" />
</Target>
<!-- Packaging (Stage) -->
<UsingTask AssemblyFile="$(LibFolder)\slowcheetah\SlowCheetah.Xdt.dll" TaskName="SlowCheetah.Xdt.TransformXml" />
<UsingTask AssemblyFile="$(MsBuildTasksFolder)\MSBuild.Coevery.Tasks.dll" TaskName="MSBuild.Coevery.Tasks.FilterModuleBinaries" />
<UsingTask AssemblyFile="$(MsBuildTasksFolder)\MSBuild.Coevery.Tasks.dll" TaskName="MSBuild.Coevery.Tasks.FileUpdateLines" />
<UsingTask AssemblyFile="$(MsBuildTasksFolder)\MSBuild.Coevery.Tasks.dll" TaskName="MSBuild.Coevery.Tasks.ValidateExtensionProjectFiles" />
<UsingTask AssemblyFile="$(MsBuildTasksFolder)\MSBuild.Coevery.Tasks.dll" TaskName="MSBuild.Coevery.Tasks.XmlDelete" />
<Target Name="Package-Stage" DependsOnTargets="Compile">
<CallTarget Targets="CompileMsBuildTasks"/>
<CallTarget Targets="ValidateProjectFiles"/>
<ItemGroup>
<SqlCe-Native-Binaries-x86 Include="$(SqlCeFolder)\x86\**\*"/>
<SqlCe-Native-Binaries-amd64 Include="$(SqlCeFolder)\amd64\**\*"/>
<Stage-Coevery-Web-Bins Include="$(WebSitesFolder)\Coevery.Web\bin\*"/>
<Stage-Bin-Exclude Include="$(WebSitesFolder)\**\bin\**\*" />
<Stage-Web Include="$(WebSitesFolder)\Coevery.Web\**\*;$(SrcFolder)\Coevery.Web\*.csproj;" Exclude="$(SrcFolder)\Coevery.Web\Coevery.Web.csproj;$(SrcFolder)\Coevery.Web\**\*.Release.config;$(SrcFolder)\Coevery.Web\**\*.Debug.config"/>
<Stage-Web-Config Include="$(SrcFolder)\Coevery.Web\**\*.config" Exclude="$(SrcFolder)\Coevery.Web\**\*.Release.config;$(SrcFolder)\Coevery.Web\**\*.Debug.config"/>
<Stage-Media Include="$(SrcFolder)\Coevery.Web\Media\CoeveryLogo.png" />
<Stage-PoFiles Include="$(SrcFolder)\Coevery.Web\**\*.po" />
<Stage-Core Include="$(WebSitesFolder)\Coevery.Core\**\*" Exclude="$(WebSitesFolder)\Coevery.Core\**\bin\**\*" />
<Stage-Themes Include="$(ThemesSrcFolder)\**\*" Exclude="@(Stage-Bin-Exclude);$(ThemesSrcFolder)\*.*;$(ThemesSrcFolder)\*.*;$(ThemesSrcFolder)\bin\**;$(ThemesSrcFolder)\obj\**;$(ThemesSrcFolder)\*.*;$(ThemesSrcFolder)\Properties\**" />
<Stage-Themes-Binaries Include="$(ThemesSrcFolder)\*\**\bin\*" />
<Stage-Module-Exclude Include="@(Stage-Web);@(Stage-Core);@(Stage-Themes);$(WebSitesFolder)\Themes\**\*;$(WebSitesFolder)\PackageIndexReferenceImplementation\**\*"/>
<Stage-Modules Include="$(WebSitesFolder)\**\*" Exclude="@(Stage-Bin-Exclude);@(Stage-Module-Exclude)" />
<Stage-Modules-Binaries Include="$(WebSitesFolder)\**\bin\**\*" Exclude="@(Stage-Module-Exclude)"/>
<Stage-Modules-Sources Include="$(ModulesSrcFolder)\**\*.csproj;$(ModulesSrcFolder)\**\*.cs"/>
<Stage-License Include="$(MSBuildProjectDirectory)\*.txt" />
<Stage-Build Include="$(MSBuildProjectDirectory)\*.proj;$(MSBuildProjectDirectory)\*.cmd" />
</ItemGroup>
<!-- Copying module binaries is somewhat tricky: From a module "bin" directory, we
only want to include the files that are _not_ already present in
the "Coevery.Web\Bin" folder. -->
<FilterModuleBinaries
ModulesBinaries="@(Stage-Modules-Binaries)"
CoeveryWebBinaries="@(Stage-Coevery-Web-Bins)">
<Output TaskParameter="ExcludedBinaries" ItemName="FilterModuleBinaries-ExcludedBinaries"/>
</FilterModuleBinaries>
<FilterModuleBinaries
ModulesBinaries="@(Stage-Themes-Binaries)"
CoeveryWebBinaries="@(Stage-Coevery-Web-Bins)">
<Output TaskParameter="ExcludedBinaries" ItemName="FilterThemeBinaries-ExcludedBinariesFromThemes"/>
</FilterModuleBinaries>
<ItemGroup>
<Stage-Modules-Binaries-Unique Include="@(Stage-Modules-Binaries)" Exclude="@(FilterModuleBinaries-ExcludedBinaries)"/>
<Stage-Themes-Binaries-Unique Include="@(Stage-Themes-Binaries)" Exclude="@(FilterThemeBinaries-ExcludedBinariesFromThemes)"/>
</ItemGroup>
<Copy SourceFiles="@(Stage-Web);@(Stage-Web-Config);@(Stage-License)" DestinationFolder="$(StageFolder)\%(RecursiveDir)"/>
<Copy SourceFiles="@(Stage-Media)" DestinationFolder="$(StageFolder)\Media"/>
<Copy SourceFiles="@(Stage-PoFiles)" DestinationFolder="$(StageFolder)\%(RecursiveDir)"/>
<Copy SourceFiles="@(SqlCe-Native-Binaries-x86)" DestinationFolder="$(StageFolder)\bin\x86\%(RecursiveDir)"/>
<Copy SourceFiles="@(SqlCe-Native-Binaries-amd64)" DestinationFolder="$(StageFolder)\bin\amd64\%(RecursiveDir)"/>
<Copy SourceFiles="@(Stage-Core)" DestinationFolder="$(StageFolder)\Core\%(RecursiveDir)"/>
<Copy SourceFiles="@(Stage-Modules)" DestinationFolder="$(StageFolder)\Modules\%(RecursiveDir)"/>
<Copy SourceFiles="@(Stage-Modules-Sources)" DestinationFolder="$(StageFolder)\Modules\%(RecursiveDir)"/>
<Copy SourceFiles="@(Stage-Modules-Binaries-Unique)" DestinationFolder="$(StageFolder)\Modules\%(RecursiveDir)"/>
<Copy SourceFiles="@(Stage-Themes)" DestinationFolder="$(StageFolder)\Themes\%(RecursiveDir)"/>
<Copy SourceFiles="@(Stage-Themes-Binaries-Unique)" DestinationFolder="$(StageFolder)\Themes\%(RecursiveDir)"/>
<MakeDir Directories="$(StageFolder)\App_Data"/>
<WriteLinesToFile File="$(StageFolder)\App_Data\_marker.txt" Lines="some_text" Overwrite="true"/>
<!-- extra processing of the staged config files -->
<TransformXml
Source="$(StageFolder)\Web.Config"
Transform="$(SrcFolder)\Coevery.Web\Web.Release.Config"
Destination="$(StageFolder)\Web.Config"
/>
<TransformXml
Source="$(StageFolder)\Config\HostComponents.Config"
Transform="$(SrcFolder)\Coevery.Web\Config\HostComponents.Release.Config"
Destination="$(StageFolder)\Config\HostComponents.Config"
/>
<TransformXml
Source="$(StageFolder)\Config\log4net.Config"
Transform="$(SrcFolder)\Coevery.Web\Config\log4net.Release.Config"
Destination="$(StageFolder)\Config\log4net.Config"
/>
<!-- move over extra non-content files the csproj referenced -->
<Copy SourceFiles="@(StageProjectAlteration-ExtraFiles->'$(SrcFolder)\Coevery.Web\%(Identity)')"
DestinationFolder="$(StageFolder)\%(RecursiveDir)"/>
</Target>
<!-- Packaging (MsDeploy) -->
<Target Name="Package-MsDeploy">
<ItemGroup>
<!--<MsDeploy-Folder-Input Include="$(StageFolder)\**\*" Exclude="$(StageFolder)\**\bin\**\*.pdb;$(StageFolder)\**\bin\**\*.xml" />-->
<MsDeploy-Exclude-Modules Include="
$(StageFolder)\**\Modules\Coevery.Lists\**;
$(StageFolder)\**\Modules\Coevery.Media\**;
$(StageFolder)\**\Modules\Coevery.MediaPicker\**;
$(StageFolder)\**\Modules\Coevery.Rules\**;
" />
<MsDeploy-Folder-Input Include="$(StageFolder)\**\*" Exclude="$(StageFolder)\**\bin\**\*.xml;$(StageFolder)\**\obj\**\*;@(MsDeploy-Exclude-Modules)" />
<MsDeploy-Parameters Include="$(LibFolder)\msdeploy\*.xml;$(LibFolder)\msdeploy\*.sql"/>
</ItemGroup>
<Copy SourceFiles="@(MsDeploy-Folder-Input)"
DestinationFolder="$(MsDeployFolder)\Coevery\%(RecursiveDir)"/>
<Copy SourceFiles="@(MsDeploy-Parameters)"
DestinationFolder="$(MsDeployFolder)"/>
<MakeDir Directories="$(MsDeployFolder)\Coevery\bin\HostRestart"/>
</Target>
<!-- Packaging (Precompiled) -->
<Target Name="Package-Precompiled">
<ItemGroup>
<Precompiled-Exclude-Source Include="$(StageFolder)\**\*.cs;$(StageFolder)\**\*.csproj" />
<Precompiled-Folder-Input Include="$(StageFolder)\**\*" Exclude="$(StageFolder)\**\bin\**\*.xml;$(StageFolder)\Modules\**\Tests\**;$(StageFolder)\Modules\**\Specs\**;$(StageFolder)\**\obj\**\*;@(Precompiled-Exclude-Source)" />
</ItemGroup>
<Copy SourceFiles="@(Precompiled-Folder-Input)"
DestinationFolder="$(PrecompiledFolder)\%(RecursiveDir)"/>
<MakeDir Directories="$(PrecompiledFolder)\bin\HostRestart"/>
</Target>
<Target Name="Package-Zip">
<ItemGroup>
<Zip-Exclude Include="
$(MSBuildProjectDirectory)\src\**\bin\**\*;
$(MSBuildProjectDirectory)\src\**\obj\**\*;
$(MSBuildProjectDirectory)\**\App_Data\**\*;
$(MSBuildProjectDirectory)\**\_ReSharper*\**\*;
$(MSBuildProjectDirectory)\**\*.sln.cache;
$(MSBuildProjectDirectory)\**\*.suo;
$(MSBuildProjectDirectory)\**\*.user;
$(MSBuildProjectDirectory)\**\*.patch;
$(MSBuildProjectDirectory)\**\*.hgignore;
$(MSBuildProjectDirectory)\**\*.hg*\**\*;
$(LibFolder)\nunit\addins\**\*;
" Exclude="$(MSBuildProjectDirectory)\src\Coevery.Azure\Coevery.Azure.CloudService\*Content\**\*" />
<Zip-Stage Include="$(StageFolder)\**\*" />
<Zip-MsDeploy Include="$(MsDeployFolder)\**\*" />
<Zip-Source Include="
$(MSBuildProjectDirectory)\lib\**\*;
$(MSBuildProjectDirectory)\src\**\*;
$(MSBuildProjectDirectory)\*.txt;
$(MSBuildProjectDirectory)\*.proj;
$(MSBuildProjectDirectory)\*.cmd;
" Exclude="@(Zip-Exclude)" />
</ItemGroup>
<MakeDir Directories="$(MsDeployArtifactFolder);$(SourceArtifactFolder)"/>
<PropertyGroup>
<ZipVersionFileSuffix Condition="$(Version) != ''">.$(Version)</ZipVersionFileSuffix>
<ZipVersionFileSuffix Condition="$(Version) == ''"></ZipVersionFileSuffix>
</PropertyGroup>
<Zip Files="@(Zip-MsDeploy)" WorkingDirectory="$(MsDeployFolder)" ZipFileName="$(MsDeployArtifactFolder)\Coevery.Web$(ZipVersionFileSuffix).zip" />
<Zip Files="@(Zip-Source)" WorkingDirectory="$(MSBuildProjectDirectory)" ZipFileName="$(SourceArtifactFolder)\Coevery.Source$(ZipVersionFileSuffix).zip" />
</Target>
<!-- Profiling -->
<Target Name="Profiling-Stage">
<ItemGroup>
<Profiling-Web Include="$(StageFolder)\**\*" />
</ItemGroup>
<Copy SourceFiles="@(Profiling-Web)" DestinationFolder="$(ProfilingFolder)\%(RecursiveDir)"/>
<XmlUpdate XmlFileName="$(ProfilingFolder)\web.config"
XPath="/configuration/system.web/trust/@level"
Value="Full" />
</Target>
<Target Name="Profiling-Setup">
<ReadLinesFromFile File="$(SrcFolder)\Coevery.Profile\profiling-setup-commands.txt">
<Output TaskParameter="Lines" ItemName="ProfilingSetupCommands"/>
</ReadLinesFromFile>
<Exec Command="$(ProfilingFolder)\bin\Coevery.exe %(ProfilingSetupCommands.Identity)" WorkingDirectory="$(ProfilingFolder)"/>
</Target>
<!-- Gallery Packaging -->
<Target Name="Gallery-Stage">
<ItemGroup>
<Gallery-Web Include="$(StageFolder)\**\*" />
</ItemGroup>
<Copy SourceFiles="@(Gallery-Web)" DestinationFolder="$(GalleryFolder)\%(RecursiveDir)"/>
</Target>
<Target Name="Gallery-Setup">
<Exec Command=""$(GalleryFolder)\bin\Coevery.exe" setup /SiteName:Gallery /AdminUsername:admin /AdminPassword:gallery-secret /DatabaseProvider:SqlCe" WorkingDirectory="$(GalleryFolder)"/>
<Exec Command=""$(GalleryFolder)\bin\Coevery.exe" feature enable Coevery.Packaging" WorkingDirectory="$(GalleryFolder)"/>
<Exec Command=""$(GalleryFolder)\bin\Coevery.exe" package create Coevery.Lists "$(GalleryArtifactFolder)"" WorkingDirectory="$(GalleryFolder)"/>
<Exec Command=""$(GalleryFolder)\bin\Coevery.exe" package create Coevery.Media "$(GalleryArtifactFolder)"" WorkingDirectory="$(GalleryFolder)"/>
<Exec Command=""$(GalleryFolder)\bin\Coevery.exe" package create Coevery.MediaPicker "$(GalleryArtifactFolder)"" WorkingDirectory="$(GalleryFolder)"/>
<Exec Command=""$(GalleryFolder)\bin\Coevery.exe" package create Coevery.Rules "$(GalleryArtifactFolder)"" WorkingDirectory="$(GalleryFolder)"/>
</Target>
<!-- ValidateProjectFiles-->
<Target Name="ValidateProjectFiles">
<CallTarget Targets="CompileMsBuildTasks"/>
<ItemGroup>
<Validate-ProjectFiles
Include="$(ModulesSrcFolder)\**\*.csproj;$(ThemesSrcFolder)\**\*.csproj;$(CoeveryCoreSrcFolder)\Coevery.Core.csproj"
Exclude="$(ModulesSrcFolder)\**\*.Specs.csproj"
/>
</ItemGroup>
<ValidateExtensionProjectFiles Files="@(Validate-ProjectFiles)"/>
</Target>
<!-- SetVersion -->
<!-- Update all AssemblyInfo.cs and module.txt files to contain $(Version) -->
<Target Name="SetVersion" Condition="$(Version) != ''">
<CallTarget Targets="CompileMsBuildTasks"/>
<ItemGroup>
<Version-AssemblyInfos Include="$(SrcFolder)\**\AssemblyInfo.cs" />
<Version-Modules Include="$(SrcFolder)\**\Module.txt" />
<Version-Themes Include="$(SrcFolder)\**\Theme.txt" />
</ItemGroup>
<FileUpdateLines Files="@(Version-Modules)"
Regex="^(coeveryversion|version)(\s*):(\s*)(.*)"
ReplacementText="${1}${2}:${3}$(Version)"
IgnoreCase="True"/>
<FileUpdateLines Files="@(Version-Themes)"
Regex="^(coeveryversion|version)(\s*):(\s*)(.*)"
ReplacementText="${1}${2}:${3}$(Version)"
IgnoreCase="True"/>
<FileUpdateLines Files="@(Version-AssemblyInfos)"
Regex="^\[assembly:(\s)*(AssemblyVersion|AssemblyFileVersion)(\s)*\("(.*)"\)(\s)*\]"
ReplacementText="[assembly:${1}${2}${3}("$(Version)")${5}]"
IgnoreCase="True"/>
</Target>
</Project>