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) " " />
325
313
<Target
326
314
Name =" Full"
327
315
DependsOnTargets =" Clean;Build;Test" />
328
-
329
- <Target Name =" BuildSetupTest" Condition =" '$(Scope)' == 'all' " >
330
- <MSBuild
331
- Projects =" .\setup\PowerShellSetup.Test\PowerShellSetup.Test.csproj"
332
- Targets =" Build"
333
- Properties =" Configuration=$(Configuration);Platform=AnyCPU"
334
- ContinueOnError =" false"
335
- Condition =" '$(Scope)' == 'all' " />
336
-
337
- <Copy SourceFiles =" $(LibraryRoot)\setup\PowerShellSetup.Test\bin\$(Configuration)\PowerShellSetup.Test.dll"
338
- DestinationFolder =" $(LibrarySourceFolder)\Package\$(Configuration)" Condition =" Exists('$(LibraryRoot)\setup\PowerShellSetup.Test\bin\$(Configuration)\PowerShellSetup.Test.dll')" />
339
- </Target >
340
-
341
- <Target Name =" BuildSetup" Condition =" '$(Scope)' == 'all' " >
342
- <!-- Copying shortcut to be signed -->
343
- <Copy SourceFiles =" $(LibrarySourceFolder)\Package\$(Configuration)\RemoveGalleryModules.ps1;$(LibrarySourceFolder)\Package\$(Configuration)\SetExecutionPolicy.ps1"
344
- DestinationFolder =" $(LibraryRoot)setup\Setup\"
345
- Condition =" '$(CodeSign)' == 'true' " />
346
-
347
- <MSBuild
348
- Projects =" @(SetupSln)"
349
- Targets =" Build"
350
- Properties =" Configuration=$(Configuration);Platform=Any CPU"
351
- ContinueOnError =" false"
352
- Condition =" '$(Scope)' == 'all' " />
353
- </Target >
354
316
355
317
<Target Name =" BuildMsBuildTask" DependsOnTargets =" RestoreNugetPackages" >
356
318
<MSBuild Projects =" @(LocalBuildTasks)"
374
336
<DelaySignedAssembliesToSign Include =" $(LibrarySourceFolder)\Package\$(Configuration)\**\Microsoft*Azure*Commands*.dll" Condition =" '$(Latest)' == 'true' " />
375
337
<DelaySignedAssembliesToSign Include =" $(LibrarySourceFolder)\Package\$(Configuration)\**\Microsoft.Azure.Common.Extensions.dll" Condition =" '$(Latest)' == 'true' " />
376
338
<DelaySignedAssembliesToSign Include =" $(LibrarySourceFolder)\Package\$(Configuration)\**\Microsoft.Azure.Management.Sql.Legacy.dll" Condition =" '$(Latest)' == 'true' " />
377
- <DelaySignedAssembliesToSign Include =" $(LibrarySourceFolder)\Package\$(Configuration)\PowerShellSetup.Test.dll" Condition = " '$(Latest)' == 'true' and '$(NetCore)' == 'false' " />
378
339
379
340
<DelaySignedAssembliesToSign Include =" $(LibrarySourceFolder)\Stack\$(Configuration)\**\Microsoft*Azure*Commands*.dll" Condition =" '$(Stack)' == 'true' " />
380
341
<DelaySignedAssembliesToSign Include =" $(LibrarySourceFolder)\Stack\$(Configuration)\**\Microsoft.Azure.Common.Extensions.dll" Condition =" '$(Stack)' == 'true' " />
427
388
<ScriptsToSign Include =" $(LibrarySourceFolder)\Package\$(Configuration)\**\*.psm1" Condition =" '$(Latest)' == 'true' " />
428
389
<ScriptsToSign Include =" $(LibrarySourceFolder)\Package\$(Configuration)\**\*.ps1xml" Condition =" '$(Latest)' == 'true' " />
429
390
<ScriptsToSign Include =" $(LibrarySourceFolder)\Package\$(Configuration)\**\*.js" Condition =" '$(Latest)' == 'true' " />
430
- <ScriptsToSign Include =" $(LibraryRoot)setup\Setup\*.ps1" Condition =" '$(Latest)' == 'true' " />
431
391
432
392
<ScriptsToSign Include =" $(LibrarySourceFolder)\Stack\$(Configuration)\**\*.ps1" Condition =" '$(Stack)' == 'true' " />
433
393
<ScriptsToSign Include =" $(LibrarySourceFolder)\Stack\$(Configuration)\**\*.psm1" Condition =" '$(Stack)' == 'true' " />
434
394
<ScriptsToSign Include =" $(LibrarySourceFolder)\Stack\$(Configuration)\**\*.ps1xml" Condition =" '$(Stack)' == 'true' " />
435
395
<ScriptsToSign Include =" $(LibrarySourceFolder)\Stack\$(Configuration)\**\*.js" Condition =" '$(Stack)' == 'true' " />
436
- <!-- <ScriptsToSign Include="$(LibraryRoot)stacksetup\Setup\*.ps1" Condition="'$(Stack)' == 'true' " /> -->
437
396
</ItemGroup >
438
397
439
398
<CodeSigningTask
447
406
ToolsPath =" $(CIToolsPath)"
448
407
Condition =" !$(DelaySign) and '@(ScriptsToSign)' != ''" />
449
408
450
- <!-- We cannot verify .js files using Get-AuthenticodeSignature -->
451
- <VerifyAuthenticodeSignatureTask ProbingDirectory =" $(PackageDirectory)\$(Configuration)"
452
- FileFilterPattern =" microsoft.*.dll;system.*.dll;*.ps1;*.psm1;*.ps1xml;PowerShellSetup.Test.dll" Condition =" '$(Latest)' == 'true'" >
453
- <Output TaskParameter =" AuthCodeSignTaskErrorsDetected" PropertyName =" AuthTaskFailed" />
454
- </VerifyAuthenticodeSignatureTask >
455
- <VerifyAuthenticodeSignatureTask ProbingDirectory =" $(LibrarySourceFolder)\Stack\$(Configuration)"
456
- FileFilterPattern =" microsoft.*.dll;system.*.dll;*.ps1;*.psm1;*.ps1xml;PowerShellSetup.Test.dll" Condition =" '$(Latest)' == 'true'" >
457
- <Output TaskParameter =" AuthCodeSignTaskErrorsDetected" PropertyName =" AuthTaskFailed" />
458
- </VerifyAuthenticodeSignatureTask >
459
-
460
409
<Exec Command =" " $(PowerShellCommand)" -NonInteractive -NoLogo -NoProfile -Command " . $(LibraryToolsFolder)\CheckSignature.ps1 -CustomPath $(LibrarySourceFolder)\Package\$(Configuration) " "
461
410
ContinueOnError =" ErrorAndContinue" />
462
411
465
414
DestinationFolder =" $(LibraryRoot)tools\AzureRM.NetCore" Condition = " '$(NetCore)' == 'true' " />
466
415
</Target >
467
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
+
468
425
<Target Name =" CodeSignInstaller" >
469
426
<PropertyGroup >
470
427
<!-- public token associated with MSSharedLibKey.snk-->
475
432
</GetFrameworkSdkPath >
476
433
477
434
<ItemGroup >
478
- <InstallersToSign Include =" $(LibraryRoot)\setup*\build\** \*.msi" />
435
+ <InstallersToSign Include =" $(LibraryRoot)\setup\*.msi" />
479
436
</ItemGroup >
480
437
481
438
<Message Importance =" high" Text =" $(LibraryRoot)\setup does not contains any installers to sign. Code sign will skip."
521
478
<Exec Command =" " $(PowerShellCommand)" -NonInteractive -NoLogo -NoProfile -Command " . $(LibraryToolsFolder)\PublishModules.ps1 $(NetCore) $(Configuration) $(Scope) $(NuGetKey) \" $(NuGetPublishingSource)\" -Profile Latest " $(NuGetCommand)" Condition =" '$(Latest)' == 'true' " />
522
479
<Message Importance =" high" Text =" Publishing Cmdlets using Stack profile" Condition =" '$(Stack)' == 'true' " />
523
480
<Exec Command =" " $(PowerShellCommand)" -NonInteractive -NoLogo -NoProfile -Command " . $(LibraryToolsFolder)\PublishModules.ps1 $(NetCore) $(Configuration) $(Scope) $(NuGetKey) \" $(StackPublishingSource)\" -Profile Stack " $(NuGetCommand)" Condition =" '$(Stack)' == 'true' " />
524
- </Target >
481
+
482
+ <CallTarget Targets =" BuildInstaller" />
483
+ </Target >
525
484
526
485
<PropertyGroup >
527
486
<RunTestLive Condition =" '$(RunTestLive)' == ''" >false</RunTestLive >
554
513
<Message Importance =" high" Text =" Running live tests..." />
555
514
<CallTarget Targets =" LiveTests" />
556
515
</Target >
557
- </Project >
516
+ </Project >
0 commit comments