|
1 | 1 | <?xml version="1.0" encoding="utf-8"?>
|
2 | 2 | <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
3 |
| - |
| 3 | + |
4 | 4 | <!--
|
5 | 5 | Available Targets:
|
6 | 6 |
|
7 | 7 | /t:Clean
|
8 | 8 | Removes temporary build outputs.
|
9 |
| - |
| 9 | +
|
10 | 10 | /t:Build
|
11 | 11 | Builds assemblies.
|
12 | 12 |
|
|
17 | 17 | Code sign binaries, mainly for official release. Default is false.
|
18 | 18 |
|
19 | 19 | /p:CodeSign=True;DelaySign=True
|
20 |
| - Test the code sign workflow locally. |
| 20 | + Test the code sign workflow locally. |
21 | 21 |
|
22 | 22 | /p:Scope
|
23 | 23 | 'ServiceManagement': service management
|
24 | 24 | 'AzureStorage': storage data plane cmdlets
|
25 | 25 | 'Subfolder under src\ResourceManager': An individual cmdlet module
|
26 | 26 | By default, it builds all
|
27 |
| - --> |
| 27 | + --> |
28 | 28 |
|
29 | 29 | <!-- Define build properties -->
|
30 | 30 | <PropertyGroup>
|
|
47 | 47 | </PropertyGroup>
|
48 | 48 | <ItemGroup>
|
49 | 49 | <CmdletSolutionsToBuild Include=".\src\CLU.sln" Condition=" '$(Scope)' == 'all' "/>
|
50 |
| - <CmdletSolutionsToBuild Include=".\src\ResourceManager\$(Scope)\*.sln" |
| 50 | + <CmdletSolutionsToBuild Include=".\src\ResourceManager\$(Scope)\*.sln" |
51 | 51 | Condition=" '$(Scope)' != 'all' and '$(Scope)' != 'ServiceManagement' and '$(Scope)' != 'AzureStorage' "/>
|
52 | 52 | <CmdletSolutionsToBuild Include=".\src\ServiceManagement\ServiceManagement.sln"
|
53 | 53 | Condition=" '$(Scope)' == 'ServiceManagement' or '$(Scope)' == 'AzureStorage' "/>
|
54 | 54 | <SetupSln Include=".\setup\azurepowershell.sln" />
|
55 | 55 | </ItemGroup>
|
56 |
| - |
| 56 | + |
57 | 57 | <!--
|
58 | 58 | CI build related
|
59 | 59 | -->
|
|
67 | 67 | <UsingTask Condition=" $(OnPremiseBuild) " TaskName="CorporateValidation" AssemblyFile="$(CIToolsPath)\Microsoft.WindowsAzure.Tools.Build.Tasks.OnPremise.dll" />
|
68 | 68 | <Import Condition=" $(OnPremiseBuild) " Project="$(CIToolsPath)\Microsoft.WindowsAzure.Build.OnPremise.msbuild" />
|
69 | 69 |
|
70 |
| - <UsingTask |
| 70 | + <UsingTask |
71 | 71 | AssemblyFile="$(MSBuildProjectDirectory)\src\packages\xunit.MSBuild.2.0.0.0\tools\xunit.runner.msbuild.dll"
|
72 | 72 | TaskName="Xunit.Runner.MSBuild.xunit" />
|
73 |
| - |
| 73 | + |
74 | 74 | <!-- Clean the build in all configurations -->
|
75 | 75 | <Target Name="Clean">
|
76 | 76 | <Message Importance="high" Text="Cleaning Cmdlets..." ContinueOnError="false" />
|
|
79 | 79 | Targets="Clean"
|
80 | 80 | Properties="Configuration=$(Configuration);Platform=Any CPU"
|
81 | 81 | ContinueOnError="false" />
|
82 |
| - |
| 82 | + |
83 | 83 | <!-- Delete the publish files -->
|
84 | 84 | <Message Importance="high" Text="Cleaning publish files..." ContinueOnError="false" />
|
85 | 85 | <ItemGroup>
|
|
104 | 104 | Directories="$(PackageDirectory)"
|
105 | 105 | ContinueOnError="false" />
|
106 | 106 | </Target>
|
107 |
| - |
| 107 | + |
108 | 108 | <PropertyGroup>
|
109 | 109 | <NuGetCommand>$(MSBuildProjectDirectory)\tools\NuGet.exe</NuGetCommand>
|
110 | 110 | <NuGetRestoreConfigFile>$(MSBuildProjectDirectory)\restore.config</NuGetRestoreConfigFile>
|
111 | 111 | <NuGetRestoreConfigSwitch>-ConfigFile "$(NuGetRestoreConfigFile)"</NuGetRestoreConfigSwitch>
|
112 | 112 | <PowerShellCommand>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe</PowerShellCommand>
|
113 | 113 | </PropertyGroup>
|
114 |
| - |
| 114 | + |
115 | 115 | <!--
|
116 | 116 | Force nuget package restore so that packages that include .targets files
|
117 | 117 | don't need to be checked into source control.
|
|
122 | 122 | <NuGetCache Include="$(LOCALAPPDATA)\NuGet\Cache\*.nupkg"/>
|
123 | 123 | </ItemGroup>
|
124 | 124 | <Delete Files="@(NuGetCache)" />-->
|
125 |
| - |
| 125 | + |
126 | 126 | <Delete Files="$(NuGetRestoreConfigFile)" />
|
127 | 127 | <WriteLinesToFile
|
128 | 128 | File="$(NuGetRestoreConfigFile)"
|
|
133 | 133 | <Exec Command="$(NuGetCommand) sources add -Name LocalFeed -Source "$(MSBuildProjectDirectory)\tools\LocalFeed" $(NuGetRestoreConfigSwitch)"/>
|
134 | 134 |
|
135 | 135 | <!-- Restore packages -->
|
136 |
| - <Exec Command="$(NuGetCommand) restore %(CmdletSolutionsToBuild.FullPath) $(NuGetRestoreConfigSwitch)" |
| 136 | + <Exec Command="$(NuGetCommand) restore %(CmdletSolutionsToBuild.FullPath) $(NuGetRestoreConfigSwitch)" |
137 | 137 | ContinueOnError="false" />
|
138 | 138 |
|
139 | 139 | <!--Restore the xunit runner needed to run unit tests-->
|
140 | 140 | <Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\packages.config -PackagesDirectory $(MSBuildProjectDirectory)\packages" />
|
141 |
| - |
| 141 | + |
142 | 142 | <Delete Files="$(NuGetRestoreConfigFile)" />
|
143 | 143 | </Target>
|
144 | 144 |
|
|
153 | 153 | <_CLUProjects Include="$(CLURootDir)\**\project.json"
|
154 | 154 | Exclude="$(CLURootDir)\*.Test\project.json"></_CLUProjects>
|
155 | 155 | </ItemGroup>
|
156 |
| - <Exec Command="dnu build" WorkingDirectory="%(_CLUProjects.RootDir)%(_CLUProjects.Directory)" /> |
157 |
| - |
| 156 | + <Exec Command="dnu build" WorkingDirectory="%(_CLUProjects.RootDir)%(_CLUProjects.Directory)" /> |
| 157 | + |
158 | 158 | <!--<Message Importance="high" Text="Building Cmdlets..." />
|
159 | 159 | <MSBuild
|
160 | 160 | Projects="@(CmdletSolutionsToBuild)"
|
161 | 161 | Targets="Build"
|
162 | 162 | Properties="Configuration=$(Configuration);Platform=Any CPU"
|
163 |
| - BuildInParallel="$(BuildInParallel)" |
| 163 | + BuildInParallel="$(BuildInParallel)" |
164 | 164 | ContinueOnError="false" />
|
165 |
| - |
| 165 | +
|
166 | 166 | <CallTarget Targets="CodeSignBinaries" Condition=" '$(CodeSign)' == 'true' " />
|
167 |
| - |
| 167 | +
|
168 | 168 | <Message Importance="high" Text="Building Setup..." />-->
|
169 |
| - |
| 169 | + |
170 | 170 | <!--<MSBuild
|
171 | 171 | Projects="@(SetupSln)"
|
172 | 172 | Targets="Build"
|
173 | 173 | Properties="Configuration=$(Configuration);Platform=Any CPU"
|
174 |
| - ContinueOnError="false" |
| 174 | + ContinueOnError="false" |
175 | 175 | Condition=" '$(Scope)' == 'all' "/>
|
176 |
| - |
177 |
| - <CallTarget Targets="CodeSignInstaller" |
| 176 | +
|
| 177 | + <CallTarget Targets="CodeSignInstaller" |
178 | 178 | Condition=" '$(CodeSign)' == 'true' and '$(Scope)' == 'all'" /> -->
|
179 | 179 | </Target>
|
180 |
| - |
181 |
| - <!--TODO: once CLU stablizes, see whether we need invoke 'clean' target. |
| 180 | + |
| 181 | + <!--TODO: once CLU stablizes, see whether we need invoke 'clean' target. |
182 | 182 | Dnx uses dynamic compilation, 'clean' is unnecessary -->
|
183 | 183 | <Target
|
184 | 184 | Name="Full"
|
185 | 185 | DependsOnTargets="Build;Test" />
|
186 |
| - |
| 186 | + |
187 | 187 | <Target Name="BuildMsBuildTask" DependsOnTargets="RestoreNugetPackages">
|
188 | 188 | <MSBuild Projects="$(LibraryToolsFolder)\BuildPackagesTask\Microsoft.Azure.Build.Tasks.csproj"
|
189 | 189 | Targets="Build" Properties="Configuration=Debug;Platform=AnyCPU" />
|
190 | 190 | </Target>
|
191 |
| - |
| 191 | + |
192 | 192 | <UsingTask TaskName="ValidateStrongNameSignatureTask" AssemblyFile="$(LibraryToolsFolder)\Microsoft.Azure.Build.Tasks.dll" />
|
193 |
| - <UsingTask TaskName="FilterOutAutoRestLibraries" AssemblyFile="$(LibraryToolsFolder)\Microsoft.Azure.Build.Tasks.dll" /> |
194 |
| - |
| 193 | + <UsingTask TaskName="FilterOutAutoRestLibraries" AssemblyFile="$(LibraryToolsFolder)\Microsoft.Azure.Build.Tasks.dll" /> |
| 194 | + |
195 | 195 | <Target Name="CodeSignBinaries">
|
196 | 196 | <PropertyGroup>
|
197 | 197 | <!--public token associated with MSSharedLibKey.snk-->
|
|
202 | 202 | </GetFrameworkSdkPath>
|
203 | 203 |
|
204 | 204 | <!-- Copying shortcut to be signed -->
|
205 |
| - <Copy SourceFiles="$(LibraryRoot)tools\AzureRM\AzureRM.psd1" |
| 205 | + <Copy SourceFiles="$(LibraryRoot)tools\AzureRM\AzureRM.psd1" |
206 | 206 | DestinationFolder="$(LibrarySourceFolder)\Package\$(Configuration)" />
|
207 |
| - <Copy SourceFiles="$(LibraryRoot)tools\AzureRM\AzureRM.psm1" |
| 207 | + <Copy SourceFiles="$(LibraryRoot)tools\AzureRM\AzureRM.psm1" |
208 | 208 | DestinationFolder="$(LibrarySourceFolder)\Package\$(Configuration)" />
|
209 |
| - |
| 209 | + |
210 | 210 | <ItemGroup>
|
211 | 211 | <DelaySignedAssembliesToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\Microsoft*Azure*Commands*.dll" />
|
212 | 212 | <DelaySignedAssembliesToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\Microsoft.Azure.Common.Extensions.dll" />
|
213 | 213 | <ScriptsToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\*.ps1" />
|
214 | 214 | <ScriptsToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\*.psm1" />
|
215 | 215 | <ScriptsToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\*.ps1xml" />
|
216 | 216 | </ItemGroup>
|
217 |
| - |
218 |
| - <Message Importance="high" Text="$(LibrarySourceFolder)\Package\$(Configuration) does not contains any files to sign. Code sign will skip." |
| 217 | + |
| 218 | + <Message Importance="high" Text="$(LibrarySourceFolder)\Package\$(Configuration) does not contains any files to sign. Code sign will skip." |
219 | 219 | Condition="'@(DelaySignedAssembliesToSign)' == ''" />
|
220 |
| - |
| 220 | + |
221 | 221 | <ValidateStrongNameSignatureTask
|
222 | 222 | WindowsSdkPath="$(WindowsSdkPath)"
|
223 | 223 | Assembly="%(DelaySignedAssembliesToSign.Identity)"
|
224 | 224 | ExpectedTokenSignature="$(StrongNameToken)"
|
225 | 225 | ExpectedDelaySigned="true"
|
226 |
| - ContinueOnError="false" |
| 226 | + ContinueOnError="false" |
227 | 227 | Condition="'@(DelaySignedAssembliesToSign)' != ''"/>
|
228 | 228 |
|
229 | 229 | <CodeSigningTask
|
|
236 | 236 | SigningLogPath="$(LibraryRoot)\signing.log"
|
237 | 237 | ToolsPath="$(CIToolsPath)"
|
238 | 238 | Condition="!$(DelaySign) and '@(DelaySignedAssembliesToSign)' != ''"/>
|
239 |
| - |
| 239 | + |
240 | 240 | <CodeSigningTask
|
241 | 241 | Description="Microsoft Azure PowerShell"
|
242 | 242 | Keywords="Microsoft Azure PowerShell"
|
|
246 | 246 | Certificates="10006"
|
247 | 247 | SigningLogPath="$(LibraryRoot)\signing-scripts.log"
|
248 | 248 | ToolsPath="$(CIToolsPath)"
|
249 |
| - Condition="!$(DelaySign) and '@(ScriptsToSign)' != ''"/> |
| 249 | + Condition="!$(DelaySign) and '@(ScriptsToSign)' != ''"/> |
250 | 250 |
|
251 | 251 | <ValidateStrongNameSignatureTask
|
252 | 252 | WindowsSdkPath="$(WindowsSdkPath)"
|
253 | 253 | Assembly="%(DelaySignedAssembliesToSign.Identity)"
|
254 | 254 | ExpectedTokenSignature="$(StrongNameToken)"
|
255 | 255 | ExpectedDelaySigned="false"
|
256 |
| - ContinueOnError="false" |
| 256 | + ContinueOnError="false" |
257 | 257 | Condition="!$(DelaySign) and '@(DelaySignedAssembliesToSign)' != ''"/>
|
258 |
| - |
| 258 | + |
259 | 259 | <!-- Copying signed shortcut back -->
|
260 |
| - <Copy SourceFiles="$(LibrarySourceFolder)\Package\$(Configuration)\AzureRM.psd1" |
| 260 | + <Copy SourceFiles="$(LibrarySourceFolder)\Package\$(Configuration)\AzureRM.psd1" |
261 | 261 | DestinationFolder="$(LibraryRoot)tools\AzureRM" />
|
262 |
| - <Copy SourceFiles="$(LibrarySourceFolder)\Package\$(Configuration)\AzureRM.psm1" |
| 262 | + <Copy SourceFiles="$(LibrarySourceFolder)\Package\$(Configuration)\AzureRM.psm1" |
263 | 263 | DestinationFolder="$(LibraryRoot)tools\AzureRM" />
|
264 | 264 | </Target>
|
265 |
| - |
| 265 | + |
266 | 266 | <Target Name="CodeSignInstaller">
|
267 | 267 | <PropertyGroup>
|
268 | 268 | <!--public token associated with MSSharedLibKey.snk-->
|
|
275 | 275 | <ItemGroup>
|
276 | 276 | <InstallersToSign Include="$(LibraryRoot)\setup*\build\**\*.msi" />
|
277 | 277 | </ItemGroup>
|
278 |
| - |
279 |
| - <Message Importance="high" Text="$(LibraryRoot)\setup does not contains any installers to sign. Code sign will skip." |
| 278 | + |
| 279 | + <Message Importance="high" Text="$(LibraryRoot)\setup does not contains any installers to sign. Code sign will skip." |
280 | 280 | Condition="'@(InstallersToSign)' == ''" />
|
281 | 281 |
|
282 | 282 | <CodeSigningTask
|
|
287 | 287 | SigningLogPath="$(LibraryRoot)\msi-signing.log"
|
288 | 288 | Certificates="10006"
|
289 | 289 | ToolsPath="$(CIToolsPath)"
|
290 |
| - Condition="!$(DelaySign) and '@(InstallersToSign)' != ''"/> |
291 |
| - |
| 290 | + Condition="!$(DelaySign) and '@(InstallersToSign)' != ''"/> |
| 291 | + |
292 | 292 | <!--If we are testing locally then we copy the binaries and do not submit to the code sign server-->
|
293 | 293 | <Copy SourceFiles="@(InstallersToSign)" DestinationFolder="signed" Condition="$(DelaySign)" />
|
294 | 294 | </Target>
|
295 |
| - |
| 295 | + |
296 | 296 | <!-- Publish all packages -->
|
297 | 297 | <Target Name="Publish">
|
298 | 298 | <Error Condition=" '$(NuGetKey)' == '' " Text="You must provide the NuGetKey parameter to the build: /p:NuGetKey=YOUR_PUBLISHING_KEY" />
|
|
304 | 304 | <RunTestLive Condition="'$(RunTestLive)' == ''">false</RunTestLive>
|
305 | 305 | <XUnitIncludedTrait Condition="!$(RunTestLive)">AcceptanceType=CheckIn</XUnitIncludedTrait>
|
306 | 306 | </PropertyGroup>
|
307 |
| - |
| 307 | + |
308 | 308 | <!-- Note: all testing related target should go to 'AzurePowershell.test.targets' file except the one used by CI run -->
|
309 | 309 | <Import Project="$(MSBuildThisFileDirectory)AzurePowershell.test.targets"/>
|
310 |
| - |
| 310 | + |
311 | 311 | <!-- Run checkin tests for each pull request -->
|
312 | 312 | <Target Name="Test" DependsOnTargets="BeforeRunTests">
|
313 | 313 | <Message Importance="high" Text="Running check in tests..." />
|
314 | 314 | <ItemGroup>
|
315 | 315 | <!--Exclude 1 test projects still in progress with build failures-->
|
316 |
| - <_CLUTestProjects Include="$(CLURootDir)\*.Test\project.json" |
317 |
| - Exclude="$(CLURootDir)\Microsoft.Azure.Commands.Resources.Test\project.json"> |
| 316 | + <_CLUTestProjects Include="$(CLURootDir)\*.Test\project.json"> |
318 | 317 | </_CLUTestProjects>
|
319 | 318 | </ItemGroup>
|
320 | 319 | <Exec Command="dnu build" WorkingDirectory="%(_CLUTestProjects.RootDir)%(_CLUTestProjects.Directory)" />
|
321 | 320 | <Exec Command="dnx test" WorkingDirectory="%(_CLUTestProjects.RootDir)%(_CLUTestProjects.Directory)" />
|
322 | 321 | <!--<CallTarget Targets="InvokeXUnit"/>-->
|
323 | 322 | </Target>
|
324 |
| - |
| 323 | + |
325 | 324 | <!-- Run Full switch with scenario tests -->
|
326 | 325 | <Target
|
327 | 326 | Name="FullWithScenarioTests"
|
328 | 327 | DependsOnTargets="Clean;Build;Test;RunOneSDKCIT" />
|
329 |
| - |
| 328 | + |
330 | 329 | <!-- Run live tests and record mocks -->
|
331 | 330 | <Target
|
332 | 331 | Name="RunLiveTests"
|
|
0 commit comments