|
100 | 100 | <CmdletSolutionsToBuild Include=".\src\Stack.sln" |
101 | 101 | Condition=" '$(Scope)' == 'All' or '$(Scope)' == 'Stack'"/> |
102 | 102 |
|
| 103 | + <CommonSolution Include="$(LibrarySourceFolder)\Common\Common.sln" /> |
103 | 104 | <StaticAnalysis Include=".\tools\StaticAnalysis\StaticAnalysis.sln" /> |
104 | 105 | <LocalBuildTasks Include="$(LibraryToolsFolder)\BuildPackagesTask\Microsoft.Azure.Build.Tasks.sln" /> |
105 | | - <LocalBuildTasks Include="$(LibraryToolsFolder)\RepoTasks\RepoTasks.sln" Condition="'$(NetCore)' == 'false'"/> |
| 106 | + <LocalBuildTasks Include="$(LibraryToolsFolder)\RepoTasks\RepoTasks.sln" Condition="'$(NetCore)' == 'false'"/> |
106 | 107 | </ItemGroup> |
107 | 108 |
|
108 | 109 | <!-- Tasks --> |
|
209 | 210 | <Exec Command="$(NuGetCommand) sources add -Name LocalFeed -Source "$(LocalFeedFolder)" $(NuGetRestoreConfigSwitch)"/> |
210 | 211 | <Exec Command="$(NuGetCommand) sources add -Name nugetRemote -Source "https://api.nuget.org/v3/index.json" $(NuGetRestoreConfigSwitch)"/> |
211 | 212 | <!-- Restore packages --> |
| 213 | + <Exec Command="$(NuGetCommand) restore %(CommonSolution.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)" |
| 214 | + ContinueOnError="false" /> |
212 | 215 | <Exec Command="$(NuGetCommand) restore %(CmdletSolutionsToBuild.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)" |
213 | 216 | ContinueOnError="false" /> |
214 | 217 | <!-- Restore packages for static analysis--> |
215 | 218 | <Exec Command="$(NuGetCommand) restore %(StaticAnalysis.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)" |
216 | 219 | ContinueOnError="false" /> |
217 | 220 | <!-- Restore packages for local build tasks--> |
218 | | - <Exec Command="$(NuGetCommand) restore %(LocalBuildTasks.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetLocalBuildTaskPackages)" |
| 221 | + <Exec Command="$(NuGetCommand) restore %(LocalBuildTasks.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)" |
219 | 222 | ContinueOnError="false" /> |
220 | 223 | <!-- Restore packages for repo tasks tasks--> |
221 | | - <Exec Command="$(NuGetCommand) restore %(LocalBuildTasks.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRepoTasksPackages)" |
| 224 | + <Exec Command="$(NuGetCommand) restore %(LocalBuildTasks.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)" |
222 | 225 | ContinueOnError="false" /> |
223 | 226 | <Exec Command="$(NuGetCommand) restore %(SetupSln.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)" |
224 | 227 | ContinueOnError="false" /> |
|
264 | 267 | <MakeDir Directories="$(StackPackageFolder)" |
265 | 268 | Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" /> |
266 | 269 |
|
| 270 | + <MSBuild |
| 271 | + Projects="@(CommonSolution)" |
| 272 | + Targets="Build" |
| 273 | + Properties="Configuration=$(Configuration);Platform=Any CPU" |
| 274 | + BuildInParallel="$(BuildInParallel)" |
| 275 | + ContinueOnError="false" /> |
| 276 | + |
267 | 277 | <MSBuild Projects="@(CmdletSolutionsToBuild)" |
268 | 278 | Targets="Build" |
269 | 279 | Properties="Configuration=$(Configuration);Platform=Any CPU" |
|
280 | 290 |
|
281 | 291 | <Exec ContinueOnError="false" |
282 | 292 | Command=""$(PowerShellCommand)" -NonInteractive -NoLogo -NoProfile -Command " . $(LibraryToolsFolder)\NewHelpIndex.ps1 -OutputFile $(PackageDirectory)\index.json -BuildConfig $(Configuration) "" |
283 | | - Condition="'$(Latest)' == 'true' and $(CodeSign) == 'true'"/> |
| 293 | + Condition=" ('$(Scope)' == 'All' or '$(Scope)' == 'Latest') and $(CodeSign) == 'true'"/> |
284 | 294 |
|
285 | 295 | <!-- Copying modules to be signed --> |
286 | 296 |
|
|
314 | 324 | Condition= " '$(Scope)' == 'All' or '$(Scope)' == 'Stack' "/> |
315 | 325 |
|
316 | 326 | <CallTarget Targets="CodeSignBinaries" Condition=" '$(CodeSign)' == 'true' " /> |
| 327 | + |
| 328 | + <Exec ContinueOnError="false" |
| 329 | + Command=""$(PowerShellCommand)" -NonInteractive -NoLogo -NoProfile -Command " . $(LibraryToolsFolder)\NewOutputTypeIndex.ps1 -OutputFile $(PackageDirectory)\outputtypes.json -BuildConfig $(Configuration) "" |
| 330 | + Condition=" ('$(Scope)' == 'All' or '$(Scope)' == 'Latest') and $(CodeSign) == 'true'"/> |
| 331 | + |
317 | 332 | <!-- AzureRM --> |
318 | 333 | <Copy SourceFiles="$(PackageDirectory)\$(Configuration)\AzureRM.psd1" |
319 | 334 | DestinationFolder="$(LibraryToolsFolder)\AzureRM" Condition= " '$(Scope)' == 'All' or '$(Scope)' == 'Latest' "/> |
|
582 | 597 |
|
583 | 598 | <Message Importance="high" Text="Running dependency analysis..." /> |
584 | 599 |
|
585 | | - <Exec Command="$(MSBuildProjectDirectory)\src\Package\StaticAnalysis.exe $(MSBuildProjectDirectory)\src\Package\$(Configuration) $(MSBuildProjectDirectory)\src\Package true $(SkipHelp)" |
586 | | - Condition="'$(Scope)' != 'Stack'" |
587 | | - ContinueOnError="True"/> |
| 600 | + <Exec Command="$(MSBuildProjectDirectory)\src\Package\StaticAnalysis.exe $(MSBuildProjectDirectory)\src\Package\$(Configuration) $(MSBuildProjectDirectory)\src\Package true $(SkipHelp) @(ModulesChanged)" |
| 601 | + Condition="'$(Scope)' != 'Stack'"/> |
588 | 602 |
|
589 | 603 | <Exec Command="$(PackageDirectory)\StaticAnalysis.exe $(StackPackageFolder)\$(Configuration) $(StackPackageFolder)" |
590 | 604 | Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" |
|
601 | 615 | <Target Name="ChangeLogCheck"> |
602 | 616 | <Exec Command=""$(PowerShellCommand)" -NonInteractive -NoLogo -NoProfile -Command ". $(LibraryToolsFolder)\CheckChangeLog.ps1 -FilesChanged '@(FilesChanged)' "" |
603 | 617 | ContinueOnError="false" |
604 | | - Condition="'$(Latest)' == 'true'"/> |
| 618 | + Condition=" '$(Scope)' == 'All' or '$(Scope)' == 'Latest' "/> |
605 | 619 | <OnError ExecuteTargets="ChangeLogErrorMessage"/> |
606 | 620 | </Target> |
607 | 621 |
|
|
638 | 652 | <Target Name="Test" DependsOnTargets="BeforeRunTests"> |
639 | 653 | <Message Importance="high" Text="Running check in tests..." /> |
640 | 654 |
|
| 655 | + <CallTarget Targets="BinScopeCheck" /> |
| 656 | + |
| 657 | + <CallTarget Targets="RunPoliCheck" /> |
| 658 | + |
641 | 659 | <Exec Command=""$(PowerShellCommand)" -NonInteractive -NoLogo -NoProfile -Command "$(MSBuildProjectDirectory)\tools\Modules\Run-UnitTests.ps1 -BuildConfig $(Configuration) -Scope $(Scope) "" |
642 | 660 | ContinueOnError="ErrorAndContinue"/> |
643 | 661 |
|
644 | 662 | <!-- Azure / Stack --> |
645 | | - <CallTarget Targets="InvokeXUnit" Condition="false"/> |
| 663 | + <MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" /> |
| 664 | + <MakeDir Directories="$(TestOutputDirectory)/PassingTests" ContinueOnError="false" /> |
| 665 | + <MakeDir Directories="$(TestOutputDirectory)/FailingTests" ContinueOnError="false" /> |
| 666 | + <MSBuild Projects="build.proj" |
| 667 | + Targets="InvokeXUnit" |
| 668 | + Properties="XUnitTests=%(XUnitTests.Identity);TestOutputDirectory=$(TestOutputDirectory)" |
| 669 | + ContinueOnError="false" /> |
| 670 | + |
| 671 | + <CallTarget Targets="TestFailureCheck" /> |
| 672 | + </Target> |
| 673 | + |
| 674 | + <Target Name="BinScopeCheck"> |
| 675 | + <Exec Command=""$(PowerShellCommand)" -NonInteractive -NoLogo -NoProfile -Command "$(MSBuildProjectDirectory)\tools\CheckBinScope.ps1 -BuildConfig $(Configuration) -CIToolsPath $(CIToolsPath) "" |
| 676 | + ContinueOnError="False"/> |
| 677 | + <OnError ExecuteTargets="BinScopeErrorMessage"/> |
| 678 | + </Target> |
| 679 | + |
| 680 | + <Target Name="BinScopeErrorMessage"> |
| 681 | + <Error Text="Binscope failed, please check the files in src/Package/BinScope"/> |
| 682 | + </Target> |
| 683 | + |
| 684 | + <Target Name="TestFailureCheck"> |
| 685 | + <Exec Command=""$(PowerShellCommand)" -NonInteractive -NoLogo -NoProfile -Command "if ((Get-ChildItem $(TestOutputDirectory)/FailingTests).Count -ge 1) { throw "Failing tests, please check files in src/TestResults/FailingTests" } "" |
| 686 | + ContinueOnError="False"/> |
| 687 | + <OnError ExecuteTargets="TestFailureErrorMessage"/> |
| 688 | + </Target> |
| 689 | + |
| 690 | + <Target Name="TestFailureErrorMessage"> |
| 691 | + <Error Text="Test failures occured, check the files in src/TestResults/FailingTests."/> |
646 | 692 | </Target> |
647 | 693 |
|
648 | 694 | <!-- Run Full switch with scenario tests --> |
|
661 | 707 | <CallTarget Targets="LiveTests"/> |
662 | 708 | </Target> |
663 | 709 |
|
| 710 | + <Target Name="RunPoliCheck"> |
| 711 | + <Exec Command=""$(PowerShellCommand)" -NonInteractive -NoLogo -NoProfile -Command "$(MSBuildProjectDirectory)\tools\CheckPoliCheck.ps1 -BuildConfig $(Configuration) -CIToolsPath $(CIToolsPath) "" |
| 712 | + ContinueOnError="False"/> |
| 713 | + <OnError ExecuteTargets="PoliCheckErrorMessage"/> |
| 714 | + </Target> |
| 715 | + |
| 716 | + <Target Name="PoliCheckErrorMessage"> |
| 717 | + <Error Text="PoliCheck failed with a Severity 1 issue, please check the report at in src/Package/PoliCheck-Scan.html"/> |
| 718 | + </Target> |
| 719 | + |
664 | 720 | </Project> |
0 commit comments