Skip to content

Commit a288823

Browse files
committed
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
2 parents a5b14f2 + 4a788ac commit a288823

File tree

431 files changed

+27568
-17478
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

431 files changed

+27568
-17478
lines changed

AzurePowershell.Test.targets

Lines changed: 43 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -42,52 +42,64 @@
4242
<TestTimeout Condition=" '$(TestTimeout)' == '' ">100000000</TestTimeout>
4343
</PropertyGroup>
4444

45-
<ItemGroup>
46-
<XUnitTests Include=".\src\ResourceManager\AzureBackup\Commands.AzureBackup.Test\bin\Debug\Microsoft.Azure.Commands.AzureBackup.Test.dll"/>
47-
<XUnitTests Include=".\src\ResourceManager\SiteRecovery\Commands.SiteRecovery.Test\bin\Debug\Microsoft.Azure.Commands.SiteRecovery.Test.dll"/>
48-
<XUnitTests Include=".\src\ServiceManagement\Common\Commands.Common.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Common.Test.dll"/>
49-
<XUnitTests Include=".\src\ResourceManager\Sql\Commands.Sql.Test\bin\Debug\Microsoft.Azure.Commands.Sql.Test.dll"/>
50-
<XUnitTests Include=".\src\ServiceManagement\Services\Commands.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Test.dll"/>
51-
<XUnitTests Include=".\src\ServiceManagement\StorSimple\Commands.StorSimple.Test\bin\Debug\Microsoft.WindowsAzure.Commands.StorSimple.Test.dll"/>
52-
<XUnitTests Include=".\src\ResourceManager\Resources\Commands.Resources.Test\bin\Debug\Microsoft.Azure.Commands.Resources.Test.dll"/>
53-
<XUnitTests Include=".\src\ResourceManager\Compute\Commands.Compute.Test\bin\Debug\Microsoft.Azure.Commands.Compute.Test.dll"/>
54-
<XUnitTests Include=".\src\ResourceManager\Network\Commands.Network.Test\bin\Debug\Microsoft.Azure.Commands.Network.Test.dll"/>
55-
<XUnitTests Include=".\src\ResourceManager\DataFactories\Commands.DataFactories.Test\bin\Debug\Microsoft.Azure.Commands.DataFactories.Test.dll"/>
56-
<XUnitTests Include=".\src\ResourceManager\Dns\Commands.Dns.Test\bin\Debug\Microsoft.Azure.Commands.Dns.Test.dll"/>
57-
<XUnitTests Include=".\src\ResourceManager\StreamAnalytics\Commands.StreamAnalytics.Test\bin\Debug\Microsoft.Azure.Commands.StreamAnalytics.Test.dll"/>
58-
<XUnitTests Include=".\src\ResourceManager\OperationalInsights\Commands.OperationalInsights.Test\bin\Debug\Microsoft.Azure.Commands.OperationalInsights.Test.dll"/>
59-
<XUnitTests Include=".\src\ResourceManager\AzureBatch\Commands.Batch.Test\bin\Debug\Microsoft.Azure.Commands.Batch.Test.dll"/>
60-
<XUnitTests Include=".\src\ResourceManager\Websites\Commands.Websites.Test\bin\Debug\Microsoft.Azure.Commands.Websites.Test.dll"/>
61-
<XUnitTests Include=".\src\ResourceManager\KeyVault\Commands.KeyVault.Test\bin\Debug\Microsoft.Azure.Commands.KeyVault.Test.dll"/>
62-
<XUnitTests Include=".\src\ResourceManager\UsageAggregates\Commands.UsageAggregates.Test\bin\Debug\Microsoft.Azure.Commands.UsageAggregates.Test.dll"/>
63-
<XUnitTests Include=".\src\ServiceManagement\ManagedCache\Commands.ManagedCache.Test\bin\Debug\Microsoft.Azure.Commands.ManagedCache.Test.dll"/>
64-
<XUnitTests Include=".\src\ServiceManagement\RemoteApp\Commands.RemoteApp.Test\bin\Debug\Microsoft.Azure.Commands.RemoteApp.Tests.dll"/>
65-
<XUnitTests Include=".\src\ServiceManagement\Common\Commands.ScenarioTest\bin\Debug\Microsoft.WindowsAzure.Commands.ScenarioTest.dll"/>
66-
<XUnitTests Include=".\src\ServiceManagement\RecoveryServices\Commands.RecoveryServices.Test\bin\Debug\Microsoft.Azure.Commands.RecoveryServices.Test.dll"/>
67-
<XUnitTests Include=".\src\ResourceManager\TrafficManager\Commands.TrafficManager2.Test\bin\Debug\Microsoft.Azure.Commands.TrafficManager.Test.ScenarioTests.dll"/>
68-
<XUnitTests Include=".\src\ServiceManagement\Network\Commands.Network.Test\bin\Debug\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.dll"/>
69-
<XUnitTests Include=".\src\ResourceManager\ApiManagement\Commands.ApiManagement.Test\bin\Debug\Microsoft.Azure.Commands.ApiManagement.Test.dll"/>
70-
<XUnitTests Include=".\src\ResourceManager\Profile\Commands.Profile.Test\bin\Debug\Microsoft.Azure.Commands.Profile.Test.dll"/>
71-
</ItemGroup>
72-
45+
7346
<Target Name="InvokeMSTest">
7447
<!--Remove existing test result; otherwise mstest will error-->
7548
<Delete Files="$(_testResult)"/>
7649
<Exec
7750
Command="MSTest.exe /testcontainer:$(_testAssembly) /testsettings:$(_testSettings) /category:$(_testFilter) /resultsfile:$(_testResult)"
7851
ContinueOnError="false" />
7952
</Target>
53+
54+
<Target Name="DeclareXunitTests">
55+
<ItemGroup>
56+
<AsmXUnitTests Include=".\src\ServiceManagement\Common\Commands.Common.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Common.Test.dll"/>
57+
<AsmXUnitTests Include=".\src\ServiceManagement\Services\Commands.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Test.dll"/>
58+
<AsmXUnitTests Include=".\src\ServiceManagement\StorSimple\Commands.StorSimple.Test\bin\Debug\Microsoft.WindowsAzure.Commands.StorSimple.Test.dll"/>
59+
<AsmXUnitTests Include=".\src\ServiceManagement\ManagedCache\Commands.ManagedCache.Test\bin\Debug\Microsoft.Azure.Commands.ManagedCache.Test.dll"/>
60+
<AsmXUnitTests Include=".\src\ServiceManagement\RemoteApp\Commands.RemoteApp.Test\bin\Debug\Microsoft.Azure.Commands.RemoteApp.Tests.dll"/>
61+
<AsmXUnitTests Include=".\src\ServiceManagement\Common\Commands.ScenarioTest\bin\Debug\Microsoft.WindowsAzure.Commands.ScenarioTest.dll"/>
62+
<AsmXUnitTests Include=".\src\ServiceManagement\RecoveryServices\Commands.RecoveryServices.Test\bin\Debug\Microsoft.Azure.Commands.RecoveryServices.Test.dll"/>
63+
<AsmXUnitTests Include=".\src\ServiceManagement\Network\Commands.Network.Test\bin\Debug\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.dll"/>
64+
</ItemGroup>
65+
<ItemGroup Condition=" '$(scope)' == 'all' ">
66+
<XUnitTests Include=".\src\ResourceManager\SiteRecovery\Commands.SiteRecovery.Test\bin\Debug\Microsoft.Azure.Commands.SiteRecovery.Test.dll"/>
67+
<XUnitTests Include=".\src\ResourceManager\Sql\Commands.Sql.Test\bin\Debug\Microsoft.Azure.Commands.Sql.Test.dll"/>
68+
<XUnitTests Include=".\src\ResourceManager\Resources\Commands.Resources.Test\bin\Debug\Microsoft.Azure.Commands.Resources.Test.dll"/>
69+
<XUnitTests Include=".\src\ResourceManager\Compute\Commands.Compute.Test\bin\Debug\Microsoft.Azure.Commands.Compute.Test.dll"/>
70+
<XUnitTests Include=".\src\ResourceManager\Network\Commands.Network.Test\bin\Debug\Microsoft.Azure.Commands.Network.Test.dll"/>
71+
<XUnitTests Include=".\src\ResourceManager\DataFactories\Commands.DataFactories.Test\bin\Debug\Microsoft.Azure.Commands.DataFactories.Test.dll"/>
72+
<XUnitTests Include=".\src\ResourceManager\Dns\Commands.Dns.Test\bin\Debug\Microsoft.Azure.Commands.Dns.Test.dll"/>
73+
<XUnitTests Include=".\src\ResourceManager\StreamAnalytics\Commands.StreamAnalytics.Test\bin\Debug\Microsoft.Azure.Commands.StreamAnalytics.Test.dll"/>
74+
<XUnitTests Include=".\src\ResourceManager\OperationalInsights\Commands.OperationalInsights.Test\bin\Debug\Microsoft.Azure.Commands.OperationalInsights.Test.dll"/>
75+
<XUnitTests Include=".\src\ResourceManager\AzureBatch\Commands.Batch.Test\bin\Debug\Microsoft.Azure.Commands.Batch.Test.dll"/>
76+
<XUnitTests Include=".\src\ResourceManager\Websites\Commands.Websites.Test\bin\Debug\Microsoft.Azure.Commands.Websites.Test.dll"/>
77+
<XUnitTests Include=".\src\ResourceManager\KeyVault\Commands.KeyVault.Test\bin\Debug\Microsoft.Azure.Commands.KeyVault.Test.dll"/>
78+
<XUnitTests Include=".\src\ResourceManager\UsageAggregates\Commands.UsageAggregates.Test\bin\Debug\Microsoft.Azure.Commands.UsageAggregates.Test.dll"/>
79+
<XUnitTests Include=".\src\ResourceManager\TrafficManager\Commands.TrafficManager2.Test\bin\Debug\Microsoft.Azure.Commands.TrafficManager.Test.ScenarioTests.dll"/>
80+
<XUnitTests Include=".\src\ResourceManager\ApiManagement\Commands.ApiManagement.Test\bin\Debug\Microsoft.Azure.Commands.ApiManagement.Test.dll"/>
81+
<XUnitTests Include=".\src\ResourceManager\Profile\Commands.Profile.Test\bin\Debug\Microsoft.Azure.Commands.Profile.Test.dll"/>
82+
<XUnitTests Include=".\src\ResourceManager\AzureBackup\Commands.AzureBackup.Test\bin\Debug\Microsoft.Azure.Commands.AzureBackup.Test.dll"/>
83+
<XUnitTests Include="@(AsmXUnitTests)"/>
84+
</ItemGroup>
85+
<ItemGroup Condition=" '$(scope)' == 'ServiceManagement' ">
86+
<XUnitTests Include="@(AsmXUnitTests)"/>
87+
</ItemGroup>
88+
<ItemGroup Condition=" '$(scope)' != 'all' and '$(scope)' != 'ServiceManagement' and '$(scope)' != 'AzureStorage' ">
89+
<XUnitTests Include="$(MSBuildProjectDirectory)\src\ResourceManager\$(scope)\*\bin\Debug\*.Test.dll"/>
90+
</ItemGroup>
91+
</Target>
8092

81-
<Target Name="InvokeXUnit">
93+
<Target Name="InvokeXUnit" DependsOnTargets="DeclareXunitTests">
8294
<Message Importance="high" Text="Running XUnit tests" />
8395
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
8496
<Exec
8597
Command="$(MSBuildProjectDirectory)\packages\xunit.runner.console.2.0.0\tools\xunit.console.x86.exe &quot;%(XUnitTests.Identity)&quot; -parallel none -maxthreads 0 -trait &quot;AcceptanceType=CheckIn&quot; -html &quot;$(TestOutputDirectory)\%(XUnitTests.Filename).html&quot;"
86-
Timeout="$(TestTimeout)" ContinueOnError="false"/>
98+
Timeout="$(TestTimeout)" ContinueOnError="false" Condition=" @(XUnitTests) != '' "/>
8799
<OnError ExecuteTargets="TimeoutErrorHandler"/>
88100
</Target>
89101

90-
<Target Name="InvokeXUnitAll">
102+
<Target Name="InvokeXUnitAll" DependsOnTargets="DeclareXunitTests">
91103
<Message Importance="high" Text="Running XUnit tests" />
92104
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
93105
<Exec
@@ -101,7 +113,6 @@
101113
</Target>
102114

103115
<Target Name="BeforeRunTests">
104-
<Message Importance="high" Text="You are required to have installed a version of Visual Studio with support for MSTest (and MSTest on your path)." />
105116
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
106117
</Target>
107118

build.proj

Lines changed: 42 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818
1919
/p:CodeSign=True;DelaySign=True
2020
Test the code sign workflow locally.
21-
21+
22+
/p:Scope
23+
'ServiceManagement': service management
24+
'AzureStorage': storage data plane cmdlets
25+
'Subfolder under src\ResourceManager': An individual cmdlet module
26+
By default, it builds all
2227
-->
2328

2429
<!-- Define build properties -->
@@ -36,11 +41,15 @@
3641
<SetupOutputDirectory>$(PublishDirectory)\Setup</SetupOutputDirectory>
3742
<TestOutputDirectory>$(PublishDirectory)\TestResults</TestOutputDirectory>
3843
<BuildInParallel Condition="'$(BuildInParallel)' == ''">true</BuildInParallel>
39-
<NuGetPublishingSource Condition=" '$(NuGetPublishingSource)' != '' ">http://psget/PSGallery/api/v2/</NuGetPublishingSource>
44+
<NuGetPublishingSource Condition=" '$(NuGetPublishingSource)' == '' ">http://psget/PSGallery/api/v2/</NuGetPublishingSource>
45+
<Scope Condition=" $(Scope) == '' " >all</Scope>
4046
</PropertyGroup>
4147
<ItemGroup>
42-
<AzureResourceManagerSln Include=".\src\ResourceManager.sln" />
43-
<AzureServiceManagementSln Include=".\src\ServiceManagement.sln" />
48+
<CmdletSolutionsToBuild Include=".\src\ResourceManager\**\*.sln;.\src\ServiceManagement\ServiceManagement.sln" Condition=" '$(Scope)' == 'all' "/>
49+
<CmdletSolutionsToBuild Include=".\src\ResourceManager\$(Scope)\*.sln"
50+
Condition=" '$(Scope)' != 'all' and '$(Scope)' != 'ServiceManagement' and '$(Scope)' != 'AzureStorage' "/>
51+
<CmdletSolutionsToBuild Include=".\src\ServiceManagement\ServiceManagement.sln"
52+
Condition=" '$(Scope)' == 'ServiceManagement' or '$(Scope)' == 'AzureStorage' "/>
4453
<SetupSln Include=".\setup\azurepowershell.sln" />
4554
<SetupPowershellGetSln Include=".\setup-powershellget\powershellget.sln" />
4655
</ItemGroup>
@@ -64,28 +73,19 @@
6473

6574
<!-- Clean the build in all configurations -->
6675
<Target Name="Clean">
67-
<!-- Clean the solutions -->
6876
<Message Importance="high" Text="Cleaning Cmdlets..." ContinueOnError="false" />
6977
<MSBuild
70-
Projects="@(AzureResourceManagerSln)"
71-
Targets="Clean"
72-
Properties="Configuration=$(Configuration);Platform=Any CPU"
73-
ContinueOnError="false" />
74-
<MSBuild
75-
Projects="@(AzureServiceManagementSln)"
76-
Targets="Clean"
77-
Properties="Configuration=$(Configuration);Platform=Any CPU"
78-
ContinueOnError="false" />
79-
<MSBuild
80-
Projects="@(SetupSln)"
78+
Projects="@(CmdletSolutionsToBuild)"
8179
Targets="Clean"
8280
Properties="Configuration=$(Configuration);Platform=Any CPU"
8381
ContinueOnError="false" />
82+
8483
<MSBuild
8584
Projects="@(SetupPowershellGetSln)"
8685
Targets="Clean"
8786
Properties="Configuration=$(Configuration);Platform=Any CPU"
88-
ContinueOnError="false" />
87+
ContinueOnError="false"
88+
Condition=" '$(Scope)' == 'all' "/>
8989

9090
<!-- Delete the publish files -->
9191
<Message Importance="high" Text="Cleaning publish files..." ContinueOnError="false" />
@@ -113,7 +113,7 @@
113113
</Target>
114114

115115
<PropertyGroup>
116-
<NuGetCommand>$(MSBuildProjectDirectory)\src\.nuget\NuGet.exe</NuGetCommand>
116+
<NuGetCommand>$(MSBuildProjectDirectory)\tools\NuGet.exe</NuGetCommand>
117117
<NuGetRestoreConfigFile>$(MSBuildProjectDirectory)\restore.config</NuGetRestoreConfigFile>
118118
<NuGetRestoreConfigSwitch>-ConfigFile &quot;$(NuGetRestoreConfigFile)&quot;</NuGetRestoreConfigSwitch>
119119
<PowerShellCommand>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe</PowerShellCommand>
@@ -140,9 +140,9 @@
140140
<Exec Command="$(NuGetCommand) sources add -Name LocalFeed -Source &quot;$(MSBuildProjectDirectory)\tools\LocalFeed&quot; $(NuGetRestoreConfigSwitch)"/>
141141

142142
<!-- Restore packages -->
143-
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\src\ResourceManager.sln $(NuGetRestoreConfigSwitch)" ContinueOnError="false" />
144-
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\src\ServiceManagement.sln $(NuGetRestoreConfigSwitch)" ContinueOnError="false" />
145-
143+
<Exec Command="$(NuGetCommand) restore %(CmdletSolutionsToBuild.FullPath) $(NuGetRestoreConfigSwitch)"
144+
ContinueOnError="false" />
145+
146146
<!--Restore the xunit runner needed to run unit tests-->
147147
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\packages.config -PackagesDirectory $(MSBuildProjectDirectory)\packages" />
148148

@@ -153,15 +153,11 @@
153153
<Target Name="Build" DependsOnTargets="RestoreNugetPackages;BuildMsBuildTask">
154154
<Message Importance="high" Text="Building Cmdlets..." />
155155
<MSBuild
156-
Projects="@(AzureResourceManagerSln)"
156+
Projects="@(CmdletSolutionsToBuild)"
157157
Targets="Build"
158158
Properties="Configuration=$(Configuration);Platform=Any CPU"
159-
BuildInParallel="$(BuildInParallel)" ContinueOnError="false" />
160-
<MSBuild
161-
Projects="@(AzureServiceManagementSln)"
162-
Targets="Build"
163-
Properties="Configuration=$(Configuration);Platform=Any CPU"
164-
BuildInParallel="$(BuildInParallel)" ContinueOnError="false" />
159+
BuildInParallel="$(BuildInParallel)"
160+
ContinueOnError="false" />
165161

166162
<CallTarget Targets="CodeSignBinaries" Condition=" '$(CodeSign)' == 'true' " />
167163

@@ -170,14 +166,18 @@
170166
Projects="@(SetupPowershellGetSln)"
171167
Targets="Build"
172168
Properties="Configuration=$(Configuration);Platform=Any CPU"
173-
ContinueOnError="false" />
169+
ContinueOnError="false"
170+
Condition=" '$(Scope)' == 'all' "/>
171+
174172
<MSBuild
175173
Projects="@(SetupSln)"
176174
Targets="Build"
177175
Properties="Configuration=$(Configuration);Platform=Any CPU"
178-
ContinueOnError="false" />
176+
ContinueOnError="false"
177+
Condition=" '$(Scope)' == 'all' "/>
179178

180-
<CallTarget Targets="CodeSignInstaller" Condition=" '$(CodeSign)' == 'true' " />
179+
<CallTarget Targets="CodeSignInstaller"
180+
Condition=" '$(CodeSign)' == 'true' and '$(Scope)' == 'all'" />
181181
</Target>
182182

183183
<!-- Do everything possible -->
@@ -205,6 +205,10 @@
205205
<!-- Copying shortcut to be signed -->
206206
<Copy SourceFiles="$(LibraryRoot)setup-powershellget\Setup\ShortcutStartup.ps1"
207207
DestinationFolder="$(LibrarySourceFolder)\Package\$(Configuration)" />
208+
<Copy SourceFiles="$(LibraryRoot)tools\AzureRM\AzureRM.psd1"
209+
DestinationFolder="$(LibrarySourceFolder)\Package\$(Configuration)" />
210+
<Copy SourceFiles="$(LibraryRoot)tools\AzureRM\AzureRM.psm1"
211+
DestinationFolder="$(LibrarySourceFolder)\Package\$(Configuration)" />
208212

209213
<ItemGroup>
210214
<DelaySignedAssembliesToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\Microsoft*Azure*Commands*.dll" />
@@ -256,6 +260,10 @@
256260
<!-- Copying signed shortcut back -->
257261
<Copy SourceFiles="$(LibrarySourceFolder)\Package\$(Configuration)\ShortcutStartup.ps1"
258262
DestinationFolder="$(LibraryRoot)setup-powershellget\Setup" />
263+
<Copy SourceFiles="$(LibrarySourceFolder)\Package\$(Configuration)\AzureRM.psd1"
264+
DestinationFolder="$(LibraryRoot)tools\AzureRM" />
265+
<Copy SourceFiles="$(LibrarySourceFolder)\Package\$(Configuration)\AzureRM.psm1"
266+
DestinationFolder="$(LibraryRoot)tools\AzureRM" />
259267
</Target>
260268

261269
<Target Name="CodeSignInstaller">
@@ -289,11 +297,10 @@
289297
</Target>
290298

291299
<!-- Publish all packages -->
292-
<Target Name="Publish" DependsOnTargets="Build">
300+
<Target Name="Publish">
293301
<Error Condition=" '$(NuGetKey)' == '' " Text="You must provide the NuGetKey parameter to the build: /p:NuGetKey=YOUR_PUBLISHING_KEY" />
294302
<Message Importance="high" Text="Publishing Cmdlets..." />
295-
296-
<Exec Command="$(PowerShellCommand) -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\PublishModules.ps1 $(Configuration) $(NuGetKey) \&quot;$(NuGetPublishingSource)\&quot;&quot;"/>
303+
<Exec Command="$(PowerShellCommand) -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\PublishModules.ps1 $(Configuration) $(Scope) $(NuGetKey) \&quot;$(NuGetPublishingSource)\&quot; &quot;"/>
297304
</Target>
298305

299306
<PropertyGroup>
@@ -305,7 +312,7 @@
305312
<Import Project="$(MSBuildThisFileDirectory)AzurePowershell.test.targets"/>
306313

307314
<!-- Run checkin tests for each pull request -->
308-
<Target Name="Test" DependsOnTargets="Build;BeforeRunTests">
315+
<Target Name="Test" DependsOnTargets="BeforeRunTests">
309316
<Message Importance="high" Text="Running check in tests..." />
310317
<CallTarget Targets="InvokeXUnit"/>
311318
</Target>

0 commit comments

Comments
 (0)