12
12
13
13
/t:Test
14
14
Runs tests
15
+
16
+ /t:Publish
17
+ Creates local nuget packages and MSI
15
18
16
19
/p:CodeSign=True
17
20
Code sign binaries, mainly for official release. Default is false.
18
21
19
22
/p:CodeSign=True;DelaySign=True
20
- Test the code sign workflow locally.
23
+ Test the code sign workflow locally.
21
24
22
25
/p:Scope
23
26
'ServiceManagement': service management
26
29
By default, it builds all
27
30
28
31
/p:SkipHelp=True
29
- Skips help generation and installer creation , mainly for local builds to save time.
32
+ Skips help generation, mainly for local builds to save time.
30
33
-->
31
34
32
35
<!-- Define build properties -->
42
45
<DelaySign Condition =" '$(DelaySign)' == '' " >false</DelaySign >
43
46
<SignedOutputRootDir >$(LibraryRoot)signed</SignedOutputRootDir >
44
47
<BuildOutputDirectory >$(PublishDirectory)\Build</BuildOutputDirectory >
45
- <SetupOutputDirectory >$(PublishDirectory)\Setup</SetupOutputDirectory >
46
48
<TestOutputDirectory >$(PublishDirectory)\TestResults</TestOutputDirectory >
47
49
<BuildInParallel Condition =" '$(BuildInParallel)' == ''" >true</BuildInParallel >
48
50
<NuGetPublishingSource Condition =" '$(NuGetPublishingSource)' == '' " >http://psget/PSGallery/api/v2/</NuGetPublishingSource >
67
69
<CmdletSolutionsToBuild Include =" .\src\Stack.sln"
68
70
Condition =" '$(Stack)' == 'true' " />
69
71
70
- <SetupSln Include =" .\setup\azurepowershell.sln" />
71
72
<StaticAnalysis Include =" .\tools\StaticAnalysis\StaticAnalysis.sln" />
72
73
<LocalBuildTasks Include =" $(LibraryToolsFolder)\BuildPackagesTask\Microsoft.Azure.Build.Tasks.sln" />
73
74
</ItemGroup >
181
182
<!-- Restore packages for local build tasks-->
182
183
<Exec Command =" $(NuGetCommand) restore %(LocalBuildTasks.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetLocalBuildTaskPackages)"
183
184
ContinueOnError =" false" />
184
- <Exec Command =" $(NuGetCommand) restore %(SetupSln.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)"
185
- ContinueOnError =" false" />
186
185
187
186
<!-- Restore the xunit runner needed to run unit tests-->
188
187
<Exec Command =" $(NuGetCommand) restore $(MSBuildProjectDirectory)\packages.config -PackagesDirectory $(MSBuildProjectDirectory)\packages" />
208
207
<Exec Command =" " $(PowerShellCommand)" -NonInteractive -NoLogo -NoProfile -Command " $ProgressPreference = 'SilentlyContinue';. $(LibraryToolsFolder)\GenerateHelp.ps1 -ValidateMarkdownHelp -GenerateMamlHelp -BuildConfig $(Configuration) " "
209
208
ContinueOnError =" false"
210
209
Condition =" '$(SkipHelp)' == 'false' and '$(Latest)' == 'true'" />
211
- <CallTarget Targets =" BuildSetupTest" />
212
210
<!-- moved copy tasks -->
213
211
214
212
<Exec Command =" " $(PowerShellCommand)" -NonInteractive -NoLogo -NoProfile -Command " . $(LibraryToolsFolder)\UpdateModules.ps1 $(Configuration) $(Scope) -Profile Latest " " Condition =" '$(Latest)' == 'true' and '$(CodeSign)' == 'false'" />
228
226
<Copy SourceFiles =" $(LibrarySourceFolder)\StackAdmin\AzureStack\AzureStack.psm1"
229
227
DestinationFolder =" $(LibrarySourceFolder)\Stack\$(Configuration)" Condition = " '$(NetCore)' == 'false' and '$(Stack)' == 'true' and '$(CodeSign)' == 'false'" />
230
228
231
- <Copy SourceFiles =" $(LibraryRoot)setup\Setup\RemoveGalleryModules.ps1"
232
- DestinationFolder =" $(LibrarySourceFolder)\Package\$(Configuration)"
233
- Condition =" '$(CodeSign)' == 'true' " />
234
- <Copy SourceFiles =" $(LibraryRoot)setup\Setup\SetExecutionPolicy.ps1"
235
- DestinationFolder =" $(LibrarySourceFolder)\Package\$(Configuration)"
236
- Condition =" '$(CodeSign)' == 'true' " />
237
-
238
229
<CallTarget Targets =" CodeSignBinaries" Condition =" '$(CodeSign)' == 'true' " />
239
230
240
231
252
243
DestinationFolder =" $(LibrarySourceFolder)\StackAdmin\AzureStack" Condition = " '$(NetCore)' == 'false' and '$(Stack)' == 'true' " />
253
244
<!-- moved copy tasks -->
254
245
255
- <CallTarget Targets =" BuildSetup" Condition =" '$(SkipHelp)' == 'false' " />
256
- <CallTarget Targets =" CodeSignInstaller"
257
- Condition =" '$(CodeSign)' == 'true' and '$(Scope)' == 'all'" />
258
246
<Message Importance =" high" Text =" Running Static Analyser" />
259
247
<CallTarget targets =" DependencyAnalysis" ContinueOnError =" ErrorAndContinue" />
260
248
<Exec Command =" " $(PowerShellCommand)" -NonInteractive -NoLogo -NoProfile -Command " . $(LibraryToolsFolder)\CleanupBuild.ps1 -BuildConfig $(Configuration) " " />
266
254
267
255
<!-- Build and create package content -->
268
256
<Exec Command =" dotnet --version" />
269
- <Exec Command =" dotnet restore Azure.PowerShell.Netcore.sln" />
270
- <Exec Command =" dotnet build Azure.PowerShell.Netcore.sln -c $(Configuration)" />
271
257
<Exec Command =" dotnet publish Azure.PowerShell.Netcore.sln -c $(Configuration)" />
272
258
273
259
<!-- Delete powershell runtime files -->
312
298
<Delete Files =" @(ExtraPsdFiles->'%(FullPath)')" />
313
299
314
300
<!-- Update module manifests. -->
315
- <Exec Command =" " $(PowerShellCoreCommand)" -NonInteractive -NoLogo -NoProfile -Command " . $(LibraryToolsFolder)\UpdateModules.ps1 $(Configuration) AzureRM.Netcore -Profile Latest " " Condition =" '$(Latest)' == 'true' and '$(CodeSign)' == 'false'" />
301
+ <Exec Command =" " $(PowerShellCoreCommand)" -NonInteractive -NoLogo -NoProfile -Command " . $(LibraryToolsFolder)\UpdateModules.ps1 $(Configuration) AzureRM.Netcore -Profile Latest " " Condition =" '$(Latest)' == 'true' and '$(CodeSign)' == 'false'" ContinueOnError = " false " />
316
302
317
- <!-- Generate the help. -->
303
+ <!-- Generate the help. -->
318
304
<Exec Command =" " $(PowerShellCoreCommand)" -NonInteractive -NoLogo -NoProfile -Command " Set-Variable -Name ProgressPreference -Value 'SilentlyContinue';. $(LibraryToolsFolder)\GenerateHelp.ps1 -GenerateMamlHelp -BuildConfig $(Configuration) " " ContinueOnError =" true" Condition =" '$(SkipHelp)' == 'false' and '$(Latest)' == 'true'" />
319
305
320
306
<!-- Cleanup extraneous files. -->
327
313
<Target
328
314
Name =" Full"
329
315
DependsOnTargets =" Clean;Build;Test" />
330
-
331
- <Target Name =" BuildSetupTest" Condition =" '$(Scope)' == 'all' " >
332
- <MSBuild
333
- Projects =" .\setup\PowerShellSetup.Test\PowerShellSetup.Test.csproj"
334
- Targets =" Build"
335
- Properties =" Configuration=$(Configuration);Platform=AnyCPU"
336
- ContinueOnError =" false"
337
- Condition =" '$(Scope)' == 'all' " />
338
-
339
- <Copy SourceFiles =" $(LibraryRoot)\setup\PowerShellSetup.Test\bin\$(Configuration)\PowerShellSetup.Test.dll"
340
- DestinationFolder =" $(LibrarySourceFolder)\Package\$(Configuration)" Condition =" Exists('$(LibraryRoot)\setup\PowerShellSetup.Test\bin\$(Configuration)\PowerShellSetup.Test.dll')" />
341
- </Target >
342
-
343
- <Target Name =" BuildSetup" Condition =" '$(Scope)' == 'all' " >
344
- <!-- Copying shortcut to be signed -->
345
- <Copy SourceFiles =" $(LibrarySourceFolder)\Package\$(Configuration)\RemoveGalleryModules.ps1;$(LibrarySourceFolder)\Package\$(Configuration)\SetExecutionPolicy.ps1"
346
- DestinationFolder =" $(LibraryRoot)setup\Setup\"
347
- Condition =" '$(CodeSign)' == 'true' " />
348
-
349
- <MSBuild
350
- Projects =" @(SetupSln)"
351
- Targets =" Build"
352
- Properties =" Configuration=$(Configuration);Platform=Any CPU"
353
- ContinueOnError =" false"
354
- Condition =" '$(Scope)' == 'all' " />
355
- </Target >
356
316
357
317
<Target Name =" BuildMsBuildTask" DependsOnTargets =" RestoreNugetPackages" >
358
318
<MSBuild Projects =" @(LocalBuildTasks)"
376
336
<DelaySignedAssembliesToSign Include =" $(LibrarySourceFolder)\Package\$(Configuration)\**\Microsoft*Azure*Commands*.dll" Condition =" '$(Latest)' == 'true' " />
377
337
<DelaySignedAssembliesToSign Include =" $(LibrarySourceFolder)\Package\$(Configuration)\**\Microsoft.Azure.Common.Extensions.dll" Condition =" '$(Latest)' == 'true' " />
378
338
<DelaySignedAssembliesToSign Include =" $(LibrarySourceFolder)\Package\$(Configuration)\**\Microsoft.Azure.Management.Sql.Legacy.dll" Condition =" '$(Latest)' == 'true' " />
379
- <DelaySignedAssembliesToSign Include =" $(LibrarySourceFolder)\Package\$(Configuration)\PowerShellSetup.Test.dll" Condition = " '$(Latest)' == 'true' and '$(NetCore)' == 'false' " />
380
339
381
340
<DelaySignedAssembliesToSign Include =" $(LibrarySourceFolder)\Stack\$(Configuration)\**\Microsoft*Azure*Commands*.dll" Condition =" '$(Stack)' == 'true' " />
382
341
<DelaySignedAssembliesToSign Include =" $(LibrarySourceFolder)\Stack\$(Configuration)\**\Microsoft.Azure.Common.Extensions.dll" Condition =" '$(Stack)' == 'true' " />
429
388
<ScriptsToSign Include =" $(LibrarySourceFolder)\Package\$(Configuration)\**\*.psm1" Condition =" '$(Latest)' == 'true' " />
430
389
<ScriptsToSign Include =" $(LibrarySourceFolder)\Package\$(Configuration)\**\*.ps1xml" Condition =" '$(Latest)' == 'true' " />
431
390
<ScriptsToSign Include =" $(LibrarySourceFolder)\Package\$(Configuration)\**\*.js" Condition =" '$(Latest)' == 'true' " />
432
- <ScriptsToSign Include =" $(LibraryRoot)setup\Setup\*.ps1" Condition =" '$(Latest)' == 'true' " />
433
391
434
392
<ScriptsToSign Include =" $(LibrarySourceFolder)\Stack\$(Configuration)\**\*.ps1" Condition =" '$(Stack)' == 'true' " />
435
393
<ScriptsToSign Include =" $(LibrarySourceFolder)\Stack\$(Configuration)\**\*.psm1" Condition =" '$(Stack)' == 'true' " />
436
394
<ScriptsToSign Include =" $(LibrarySourceFolder)\Stack\$(Configuration)\**\*.ps1xml" Condition =" '$(Stack)' == 'true' " />
437
395
<ScriptsToSign Include =" $(LibrarySourceFolder)\Stack\$(Configuration)\**\*.js" Condition =" '$(Stack)' == 'true' " />
438
- <!-- <ScriptsToSign Include="$(LibraryRoot)stacksetup\Setup\*.ps1" Condition="'$(Stack)' == 'true' " /> -->
439
396
</ItemGroup >
440
397
441
398
<CodeSigningTask
449
406
ToolsPath =" $(CIToolsPath)"
450
407
Condition =" !$(DelaySign) and '@(ScriptsToSign)' != ''" />
451
408
452
- <!-- We cannot verify .js files using Get-AuthenticodeSignature -->
453
- <VerifyAuthenticodeSignatureTask ProbingDirectory =" $(PackageDirectory)\$(Configuration)"
454
- FileFilterPattern =" microsoft.*.dll;system.*.dll;*.ps1;*.psm1;*.ps1xml;PowerShellSetup.Test.dll" Condition =" '$(Latest)' == 'true'" >
455
- <Output TaskParameter =" AuthCodeSignTaskErrorsDetected" PropertyName =" AuthTaskFailed" />
456
- </VerifyAuthenticodeSignatureTask >
457
- <VerifyAuthenticodeSignatureTask ProbingDirectory =" $(LibrarySourceFolder)\Stack\$(Configuration)"
458
- FileFilterPattern =" microsoft.*.dll;system.*.dll;*.ps1;*.psm1;*.ps1xml;PowerShellSetup.Test.dll" Condition =" '$(Latest)' == 'true'" >
459
- <Output TaskParameter =" AuthCodeSignTaskErrorsDetected" PropertyName =" AuthTaskFailed" />
460
- </VerifyAuthenticodeSignatureTask >
461
-
462
409
<Exec Command =" " $(PowerShellCommand)" -NonInteractive -NoLogo -NoProfile -Command " . $(LibraryToolsFolder)\CheckSignature.ps1 -CustomPath $(LibrarySourceFolder)\Package\$(Configuration) " "
463
410
ContinueOnError =" ErrorAndContinue" />
464
411
467
414
DestinationFolder =" $(LibraryRoot)tools\AzureRM.NetCore" Condition = " '$(NetCore)' == 'true' " />
468
415
</Target >
469
416
417
+ <Target Name =" BuildInstaller" >
418
+ <Exec Command =" " $(PowerShellCommand)" -NonInteractive -NoLogo -NoProfile -Command " . Register-PSRepository -Name MSIcreationrepository -SourceLocation $(PackageDirectory) -InstallationPolicy Trusted " " Condition =" '$(Scope)' == 'all'" />
419
+ <Exec Command =" " $(PowerShellCommand)" -NonInteractive -NoLogo -NoProfile -Command " . $(LibraryRoot)\setup\generate.ps1 -repository MSIcreationrepository " " Condition =" '$(Scope)' == 'all'" />
420
+ <Exec Command =" " $(PowerShellCommand)" -NonInteractive -NoLogo -NoProfile -Command " . Unregister-PSRepository -Name MSIcreationrepository " " Condition =" '$(Scope)' == 'all'" />
421
+ <CallTarget Targets =" CodeSignInstaller"
422
+ Condition =" '$(CodeSign)' == 'true' and '$(Scope)' == 'all'" />
423
+ </Target >
424
+
470
425
<Target Name =" CodeSignInstaller" >
471
426
<PropertyGroup >
472
427
<!-- public token associated with MSSharedLibKey.snk-->
477
432
</GetFrameworkSdkPath >
478
433
479
434
<ItemGroup >
480
- <InstallersToSign Include =" $(LibraryRoot)\setup*\build\** \*.msi" />
435
+ <InstallersToSign Include =" $(LibraryRoot)\setup\*.msi" />
481
436
</ItemGroup >
482
437
483
438
<Message Importance =" high" Text =" $(LibraryRoot)\setup does not contains any installers to sign. Code sign will skip."
523
478
<Exec Command =" " $(PowerShellCommand)" -NonInteractive -NoLogo -NoProfile -Command " . $(LibraryToolsFolder)\PublishModules.ps1 $(NetCore) $(Configuration) $(Scope) $(NuGetKey) \" $(NuGetPublishingSource)\" -Profile Latest " $(NuGetCommand)" Condition =" '$(Latest)' == 'true' " />
524
479
<Message Importance =" high" Text =" Publishing Cmdlets using Stack profile" Condition =" '$(Stack)' == 'true' " />
525
480
<Exec Command =" " $(PowerShellCommand)" -NonInteractive -NoLogo -NoProfile -Command " . $(LibraryToolsFolder)\PublishModules.ps1 $(NetCore) $(Configuration) $(Scope) $(NuGetKey) \" $(StackPublishingSource)\" -Profile Stack " $(NuGetCommand)" Condition =" '$(Stack)' == 'true' " />
526
- </Target >
481
+
482
+ <CallTarget Targets =" BuildInstaller" />
483
+ </Target >
527
484
528
485
<PropertyGroup >
529
486
<RunTestLive Condition =" '$(RunTestLive)' == ''" >false</RunTestLive >
556
513
<Message Importance =" high" Text =" Running live tests..." />
557
514
<CallTarget Targets =" LiveTests" />
558
515
</Target >
559
- </Project >
516
+ </Project >
0 commit comments