forked from wixtoolset/web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweb.proj
149 lines (120 loc) · 5.86 KB
/
web.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
<?xml version='1.0' encoding='utf-8'?>
<Project InitialTargets="PackageRestore" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
<UsingTask AssemblyFile="$(AzureStorageBuildTasksPath)FireGiant.BuildTasks.AzureStorage.dll" TaskName="DownloadBlobs" />
<UsingTask AssemblyFile="$(MSBuildCommunityTasksPath)MSBuild.Community.Tasks.dll" TaskName="Unzip" />
<PropertyGroup>
<ProjectFolder>$(MSBuildThisFileDirectory)</ProjectFolder>
<Configuration>Release</Configuration>
<TinySiteExe>$(ProjectFolder)tools\tinysite\tinysite.exe</TinySiteExe>
<NugetPackageFolder>$(ProjectFolder)packages\</NugetPackageFolder>
<BuildFolder>$(OutputFolder)</BuildFolder>
<BuildFolder Condition="'$(BuildFolder)' == '' ">$(ProjectFolder)build\</BuildFolder>
<BuildFolder Condition="'$(BuildFolder)' != '' and !HasTrailingSlash('$(BuildFolder)')">$(BuildFolder)\</BuildFolder>
<DownloadFolder>$(BuildFolder)dl\</DownloadFolder>
<PublishFolder>$(BuildFolder)publish\</PublishFolder>
<WebRootSourceFolder>$(ProjectFolder)root\</WebRootSourceFolder>
<WebRootOutputFolder>$(PublishFolder)</WebRootOutputFolder>
</PropertyGroup>
<Target Name="GetRootInputsOutputs">
<ItemGroup>
<RootInput Include="$(WebRootSourceFolder)**" />
<RootOutput Include="$(WebRootOutputFolder)**" />
<RootOutput Include="$(WebRootOutputFolder)" Condition=" '@(RootOutput)'=='' " />
</ItemGroup>
</Target>
<Target Name="BuildRoot"
Inputs="@(RootInput)"
Outputs="@(RootOutput)"
DependsOnTargets="GetRootInputsOutputs">
<Exec Command='"$(TinySiteExe)" render -out "$(WebRootOutputFolder)."'
WorkingDirectory="$(WebRootSourceFolder)" />
<ItemGroup>
<PublishSource Include="$(WebRootOutputFolder)**" />
</ItemGroup>
</Target>
<Target Name="BuildApi">
<MSBuild Projects="api\api.csproj" Properties="Configuration=$(Configuration)" />
<ItemGroup>
<PublishSource Include="api\bin\$(Configuration)\*.dll">
<RelativeOutputFolder>bin\</RelativeOutputFolder>
</PublishSource>
<PublishSource Include="api\bin\$(Configuration)\*.pdb">
<RelativeOutputFolder>bin\</RelativeOutputFolder>
</PublishSource>
<PublishSource Include="api\web.config" />
<PublishSource Include="api\bin\$(Configuration)\App_Data\*.json">
<RelativeOutputFolder>App_Data\</RelativeOutputFolder>
</PublishSource>
</ItemGroup>
</Target>
<Target Name="CopyToPublishFolder"
Condition=" '@(PublishSource)'!='' ">
<Copy SourceFiles='@(PublishSource)'
DestinationFiles="@(PublishSource->'$(PublishFolder)%(RecursiveDir)%(Filename)%(Extension)' )"
SkipUnchangedFiles='true' UseHardlinksIfPossible='false'
Condition=" '%(PublishSource.RelativeOutputFolder)'=='' " />
<Copy SourceFiles='@(PublishSource)'
DestinationFiles="@(PublishSource->'$(PublishFolder)%(RelativeOutputFolder)%(RecursiveDir)%(Filename)%(Extension)' )"
SkipUnchangedFiles='true' UseHardlinksIfPossible='false'
Condition=" '%(PublishSource.RelativeOutputFolder)'!='' " />
</Target>
<Target Name="Build"
DependsOnTargets="BuildRoot;BuildApi;CopyToPublishFolder;BuildSitemap">
</Target>
<Target Name="Clean">
<RemoveDir Directories="$(BuildFolder)" />
</Target>
<Target Name="Rebuild"
DependsOnTargets="Clean;Build">
</Target>
<!--
================================================================================================
Pull
Downloads stage content from website.
================================================================================================
-->
<Target Name="Pull"
DependsOnTargets="DownloadStagedFiles;GatherDownloadedStagedFiles;UnzipManuals;CopyReleaseMetadata" />
<Target Name="DownloadStagedFiles"
DependsOnTargets="CheckCredentials">
<DownloadBlobs StorageAccount="$(StorageAccount)"
StorageAuthentication="$(StorageAuthentication)"
StorageEmulator="$(StorageUseEmulator)"
Container="staged"
Blobs="@(DownloadBlob)"
Folder="$(DownloadFolder)">
<Output TaskParameter="Downloaded" ItemName="DownloadedBlob" />
</DownloadBlobs>
</Target>
<Target Name="GatherDownloadedStagedFiles">
<ItemGroup>
<ManualZip Include="$(DownloadFolder)**\v3manual.zip">
<OutputFolder>$(WebRootSourceFolder)documents\documentation\manual\v3</OutputFolder>
</ManualZip>
<ManualZip Include="$(DownloadFolder)**\v4manual.zip">
<OutputFolder>$(WebRootSourceFolder)documents\documentation\manual\v4</OutputFolder>
</ManualZip>
<ReleaseMetadataFile Include="$(DownloadFolder)**\*.md">
<OutputFolder>$(WebRootSourceFolder)\documents\releases\</OutputFolder>
</ReleaseMetadataFile>
</ItemGroup>
</Target>
<Target Name="UnzipManuals"
Condition=" '@(ManualZip)'!='' ">
<RemoveDir Directories="%(ManualZip.OutputFolder)" />
<Unzip ZipFileName="@(ManualZip)"
TargetDirectory="%(OutputFolder)"
Quiet="true" />
</Target>
<Target Name="CopyReleaseMetadata">
<Copy SourceFiles='@(ReleaseMetadataFile)'
DestinationFiles="@(ReleaseMetadataFile->'%(OutputFolder)%(RecursiveDir)%(Filename)%(Extension)' )"
SkipUnchangedFiles='true' />
</Target>
<Target Name="CheckCredentials">
<Error Text="Must specify Azure storage account property on the command-line using the -p:StorageAccount= property." Condition=" '$(StorageAccount)'=='' " />
<Error Text="Must specify Azure storage authentication property on the command-line using the -p:StorageAuthentication= property." Condition=" '$(StorageAuthentication)'=='' " />
</Target>
<Import Project="tools\PackageRestore.targets" />
<Import Project="tools\Sitemap.targets" />
</Project>