forked from illreceived/azure-webjobs-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WebJobs.proj
250 lines (217 loc) · 11.1 KB
/
WebJobs.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
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="UnitTest" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildInParallel Condition=" '$(BuildInParallel)' == ''">true</BuildInParallel>
<NuGetExe>tools\NuGet.exe</NuGetExe>
<SkipStrongNamesExe>packages\Microsoft.Web.SkipStrongNames.1.0.0\tools\SkipStrongNames.exe</SkipStrongNamesExe>
<SkipStrongNamesXml>tools\SkipStrongNames.xml</SkipStrongNamesXml>
<PublishPath Condition=" '$(PublishPath)' == '' ">bin</PublishPath>
<SetConfiguration Condition=" '$(Configuration)' != '' ">Configuration=$(Configuration)</SetConfiguration>
<SetPlatform Condition=" '$(Platform)' != '' ">Platform=$(Platform)</SetPlatform>
</PropertyGroup>
<ItemGroup>
<!-- The Assembly items below MUST be kept in dependency order. -->
<Build Include="src\Microsoft.Azure.WebJobs\WebJobs.csproj">
<PublishType>Assembly</PublishType>
<PublishPath>$(PublishPath)\Binaries</PublishPath>
</Build>
<Build Include="src\Microsoft.Azure.WebJobs.Storage\WebJobs.Storage.csproj">
<PublishType>Assembly</PublishType>
<PublishPath>$(PublishPath)\Binaries</PublishPath>
</Build>
<Build Include="src\Microsoft.Azure.WebJobs.Protocols\WebJobs.Protocols.csproj">
<PublishType>Assembly</PublishType>
<PublishPath>$(PublishPath)\Binaries</PublishPath>
</Build>
<Build Include="src\Microsoft.Azure.WebJobs.Host\WebJobs.Host.csproj">
<PublishType>Assembly</PublishType>
<PublishPath>$(PublishPath)\Binaries</PublishPath>
</Build>
<Build Include="src\Microsoft.Azure.WebJobs.ServiceBus\WebJobs.ServiceBus.csproj">
<PublishType>Assembly</PublishType>
<PublishPath>$(PublishPath)\Binaries</PublishPath>
</Build>
<Build Include="src\Microsoft.Azure.WebJobs.Logging\WebJobs.Logging.csproj">
<PublishType>Assembly</PublishType>
<PublishPath>$(PublishPath)\Binaries</PublishPath>
</Build>
<Build Include="src\Dashboard\Dashboard.csproj">
<PublishType>Assembly</PublishType>
<PublishPath>$(PublishPath)\Binaries</PublishPath>
</Build>
<Build Include="src\AzureJobs\AzureJobs.proj">
<PublishType>File</PublishType>
<PublishPath>$(PublishPath)\SiteExtensions</PublishPath>
</Build>
<Build Include="src\AzureJobs.Directory\AzureJobs.Directory.proj">
<PublishType>Directory</PublishType>
<PublishPath>$(PublishPath)\SiteExtensionsUnzipped\AzureJobs</PublishPath>
</Build>
<Build Include="src\Microsoft.Azure.WebJobs.Core.NuGet\WebJobs.Core.nuproj">
<PublishType>File</PublishType>
<PublishPath>$(PublishPath)\Packages</PublishPath>
</Build>
<Build Include="src\Microsoft.Azure.WebJobs.NuGet\WebJobs.nuproj">
<PublishType>File</PublishType>
<PublishPath>$(PublishPath)\Packages</PublishPath>
</Build>
<Build Include="src\Microsoft.Azure.WebJobs.ServiceBus.NuGet\WebJobs.ServiceBus.nuproj">
<PublishType>File</PublishType>
<PublishPath>$(PublishPath)\Packages</PublishPath>
</Build>
<Build Include="src\Microsoft.Azure.WebJobs.Logging.NuGet\WebJobs.Logging.nuproj">
<PublishType>File</PublishType>
<PublishPath>$(PublishPath)\Packages</PublishPath>
</Build>
</ItemGroup>
<UsingTask TaskName="SkipStrongNames.CheckSkipStrongNamesStatus" AssemblyFile="$(SkipStrongNamesExe)" />
<Target Name="DownloadNuGet">
<DownloadNuGet OutputFileName="$(NuGetExe)" MinimumVersion="2.7.0" />
</Target>
<Target Name="RestoreSkipStrongNames" DependsOnTargets="DownloadNuGet">
<Exec Command='"$(NuGetExe)" restore .nuget\packages.config -PackagesDirectory packages -NonInteractive -Verbosity quiet -ConfigFile .nuget\NuGet.Config' />
</Target>
<Target Name="CheckSkipStrongNames" DependsOnTargets="RestoreSkipStrongNames">
<CheckSkipStrongNamesStatus AssembliesFile="$(SkipStrongNamesXml)">
<Output TaskParameter="Status" PropertyName="Status" />
</CheckSkipStrongNamesStatus>
<Error Text="Unit tests will not run correctly unless SkipStrongNames is Enabled. Current status: $(Status). Run the EnableSkipStrongNames target to fix this problem." Condition="'$(Status)' != 'Enabled'" />
</Target>
<Target Name="EnableSkipStrongNames" DependsOnTargets="RestoreSkipStrongNames">
<Exec Command='"$(SkipStrongNamesExe)" -e "$(SkipStrongNamesXml)"' />
<CheckSkipStrongNamesStatus AssembliesFile="$(SkipStrongNamesXml)">
<Output TaskParameter="Status" PropertyName="Status" />
</CheckSkipStrongNamesStatus>
<Message Text="SkipStrongNames: $(Status)" Importance="High" />
</Target>
<Target Name="DisableSkipStrongNames" DependsOnTargets="RestoreSkipStrongNames">
<Exec Command='"$(SkipStrongNamesExe)" -d "$(SkipStrongNamesXml)"' />
<CheckSkipStrongNamesStatus AssembliesFile="$(SkipStrongNamesXml)">
<Output TaskParameter="Status" PropertyName="Status" />
</CheckSkipStrongNamesStatus>
<Message Text="SkipStrongNames: $(Status)" Importance="High" />
</Target>
<Target Name="RestorePackages" DependsOnTargets="DownloadNuGet">
<Message Text="Restoring NuGet packages..." Importance="High" />
<Exec Command='"$(NuGetExe)" restore WebJobs.sln -PackagesDirectory packages -NonInteractive -Verbosity quiet -ConfigFile .nuget\NuGet.Config' />
</Target>
<Target Name="GetBinplace">
<PropertyGroup>
<NestedBuildProperties Condition=" '$(SetConfiguration)' != '' or '$(SetPlatform)' != ''">$(SetConfiguration); $(SetPlatform)</NestedBuildProperties>
</PropertyGroup>
<ItemGroup>
<Binplace Include="tools\Binplace\%(Build.PublishType).proj">
<Properties>ProjectFile=%(FullPath); BinplaceOutputPath=$([System.IO.Path]::GetFullPath('%(PublishPath)')); Properties=$(NestedBuildProperties)</Properties>
</Binplace>
</ItemGroup>
</Target>
<Target Name="Build" DependsOnTargets="RestorePackages;GetBinplace">
<MSBuild Projects="@(Binplace)"
BuildInParallel="$(BuildInParallel)"/>
</Target>
<UsingTask TaskName="Xunit.Runner.MSBuild.xunit" AssemblyFile="packages\xunit.MSBuild.2.0.0.0\tools\xunit.runner.msbuild.dll"/>
<Target Name="UnitTest" DependsOnTargets="CheckSkipStrongNames;Build">
<ItemGroup>
<UnitTestProjects Include="test\Microsoft.Azure.WebJobs.Host.UnitTests\WebJobs.Host.UnitTests.csproj"/>
<UnitTestProjects Include="test\Microsoft.Azure.WebJobs.Host.FunctionalTests\WebJobs.Host.FunctionalTests.csproj"/>
<UnitTestProjects Include="test\Microsoft.Azure.WebJobs.ServiceBus.UnitTests\WebJobs.ServiceBus.UnitTests.csproj"/>
<UnitTestProjects Include="test\Dashboard.UnitTests\Dashboard.UnitTests.csproj"/>
</ItemGroup>
<MSBuild Projects="@(UnitTestProjects)"
Properties="$(SetConfiguration); $(SetPlatform)"
BuildInParallel="$(BuildInParallel)">
<Output TaskParameter="TargetOutputs" ItemName="UnitTestAssemblies"/>
</MSBuild>
<xunit Assemblies="@(UnitTestAssemblies)"/>
</Target>
<Target Name="FunctionalTest" DependsOnTargets="UnitTest">
<ItemGroup>
<FunctionalTestProjects Include="test\Microsoft.Azure.WebJobs.Host.EndToEndTests\WebJobs.Host.EndToEndTests.csproj"/>
</ItemGroup>
<MSBuild Projects="@(FunctionalTestProjects)"
Properties="$(SetConfiguration); $(SetPlatform)"
BuildInParallel="$(BuildInParallel)">
<Output TaskParameter="TargetOutputs" ItemName="FunctionalTestAssemblies"/>
</MSBuild>
<xunit Assemblies="@(FunctionalTestAssemblies)"/>
</Target>
<Target Name="Clean" DependsOnTargets="GetBinplace">
<MSBuild Projects="@(Binplace)"
Targets="Clean"
BuildInParallel="$(BuildInParallel)"/>
</Target>
<Target Name="Rebuild" DependsOnTargets="Clean;Build"/>
<Target Name="GetOfficialProjects" Returns="@(OfficialProjects)">
<ItemGroup>
<OfficialProjects Include="%(Build.FullPath)">
<PublishType>%(Build.PublishType)</PublishType>
<PublishPath>$([System.IO.Path]::GetFullPath('%(Build.PublishPath)'))</PublishPath>
</OfficialProjects>
</ItemGroup>
</Target>
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll">
<ParameterGroup>
<OutputFileName ParameterType="System.String" Required="true" />
<MinimumVersion ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Using Namespace="System.Diagnostics" />
<Using Namespace="System.Net" />
<Code Type="Fragment" Language="cs">
<![CDATA[
Version minimumRequiredVersion;
if (!Version.TryParse(MinimumVersion, out minimumRequiredVersion))
{
Log.LogError("MinimumVersion '{0}' is not a valid Version.", MinimumVersion);
}
try
{
OutputFileName = Path.GetFullPath(OutputFileName);
if (File.Exists(OutputFileName))
{
// If NuGet.exe exists but is less than the minimum required version, delete it so that the
// latest version will be downloaded.
FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(OutputFileName);
string toParse;
if (versionInfo != null && versionInfo.ProductVersion != null)
{
toParse = versionInfo.ProductVersion;
}
else
{
toParse = null;
}
Version current;
Version parsed;
if (toParse != null && Version.TryParse(toParse, out parsed))
{
current = parsed;
}
else
{
// Treat a missing or invalid version like V0.0 (which will trigger a delete and download).
current = new Version(0, 0);
}
if (current < minimumRequiredVersion)
{
File.Delete(OutputFileName);
}
}
if (!File.Exists(OutputFileName))
{
Log.LogMessage("Downloading latest version of NuGet.exe...");
WebClient webClient = new WebClient();
webClient.DownloadFile("https://nuget.org/nuget.exe", OutputFileName);
}
return true;
}
catch (Exception ex)
{
Log.LogErrorFromException(ex);
return false;
}
]]>
</Code>
</Task>
</UsingTask>
</Project>