Skip to content

Commit 7b444e0

Browse files
committed
ensure build profile first and fix couple of scope bugs
1 parent f999881 commit 7b444e0

File tree

3 files changed

+24
-15
lines changed

3 files changed

+24
-15
lines changed

AzurePowershell.Test.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
<AsmXUnitTests Include=".\src\ServiceManagement\RecoveryServices\Commands.RecoveryServices.Test\bin\Debug\Microsoft.Azure.Commands.RecoveryServices.Test.dll"/>
6363
<AsmXUnitTests Include=".\src\ServiceManagement\Network\Commands.Network.Test\bin\Debug\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.dll"/>
6464
</ItemGroup>
65-
<ItemGroup Condition=" '$(scope)' == '' ">
65+
<ItemGroup Condition=" '$(scope)' == 'all' ">
6666
<XUnitTests Include=".\src\ResourceManager\SiteRecovery\Commands.SiteRecovery.Test\bin\Debug\Microsoft.Azure.Commands.SiteRecovery.Test.dll"/>
6767
<XUnitTests Include=".\src\ResourceManager\Sql\Commands.Sql.Test\bin\Debug\Microsoft.Azure.Commands.Sql.Test.dll"/>
6868
<XUnitTests Include=".\src\ResourceManager\Resources\Commands.Resources.Test\bin\Debug\Microsoft.Azure.Commands.Resources.Test.dll"/>
@@ -85,7 +85,7 @@
8585
<ItemGroup Condition=" '$(scope)' == 'ServiceManagement' ">
8686
<XUnitTests Include="@(AsmXUnitTests)"/>
8787
</ItemGroup>
88-
<ItemGroup Condition=" '$(scope)' !='' and '$(scope)' != 'ServiceManagement' ">
88+
<ItemGroup Condition=" '$(scope)' != 'all' and '$(scope)' != 'ServiceManagement' and $(scope)' != 'AzureStorage' ">
8989
<XUnitTests Include="$(MSBuildProjectDirectory)\src\ResourceManager\$(scope)\*\bin\Debug\*.Test.dll"/>
9090
</ItemGroup>
9191

build.proj

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@
4242
<TestOutputDirectory>$(PublishDirectory)\TestResults</TestOutputDirectory>
4343
<BuildInParallel Condition="'$(BuildInParallel)' == ''">true</BuildInParallel>
4444
<NuGetPublishingSource Condition=" '$(NuGetPublishingSource)' == '' ">http://psget/PSGallery/api/v2/</NuGetPublishingSource>
45+
<Scope Condition=" $(Scope) == '' " >all</Scope>
4546
</PropertyGroup>
4647
<ItemGroup>
47-
<CmdletSolutionsToBuild Include=".\src\ResourceManager\**\*.sln;.\src\ServiceManagement\ServiceManagement.sln" Condition=" '$(Scope)' == '' "/>
48-
<CmdletSolutionsToBuild Include=".\src\ResourceManager\$(Scope)\*.sln" Condition=" '$(Scope)' != '' and '$(Scope)' != 'ServiceManagement' "/>
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' "/>
4951
<CmdletSolutionsToBuild Include=".\src\ServiceManagement\ServiceManagement.sln"
50-
Condition=" '$(Scope)' != '' and ('$(Scope)' == 'ServiceManagement' or '$(Scope)' == 'AzureStorage') "/>
52+
Condition=" '$(Scope)' == 'ServiceManagement' or '$(Scope)' == 'AzureStorage' "/>
5153
<SetupSln Include=".\setup\azurepowershell.sln" />
5254
<SetupPowershellGetSln Include=".\setup-powershellget\powershellget.sln" />
5355
</ItemGroup>
@@ -83,7 +85,7 @@
8385
Targets="Clean"
8486
Properties="Configuration=$(Configuration);Platform=Any CPU"
8587
ContinueOnError="false"
86-
Condition=" '$(Scope)' == '' "/>
88+
Condition=" '$(Scope)' == 'all' "/>
8789

8890
<!-- Delete the publish files -->
8991
<Message Importance="high" Text="Cleaning publish files..." ContinueOnError="false" />
@@ -165,17 +167,17 @@
165167
Targets="Build"
166168
Properties="Configuration=$(Configuration);Platform=Any CPU"
167169
ContinueOnError="false"
168-
Condition=" '$(Scope)' == '' "/>
170+
Condition=" '$(Scope)' == 'all' "/>
169171

170172
<MSBuild
171173
Projects="@(SetupSln)"
172174
Targets="Build"
173175
Properties="Configuration=$(Configuration);Platform=Any CPU"
174176
ContinueOnError="false"
175-
Condition=" '$(Scope)' == '' "/>
177+
Condition=" '$(Scope)' == 'all' "/>
176178

177179
<CallTarget Targets="CodeSignInstaller"
178-
Condition=" '$(CodeSign)' == 'true' and '$(Scope)' == ''" />
180+
Condition=" '$(CodeSign)' == 'true' and '$(Scope)' == 'all'" />
179181
</Target>
180182

181183
<!-- Do everything possible -->

tools/PublishModules.ps1

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,20 @@ if ($scope -eq 'AzureRM') {
7777

7878
$resourceManagerRootFolder = "$packageFolder\$buildConfig\ResourceManager\AzureResourceManager"
7979
$resourceManagerModules = Get-ChildItem -Path $resourceManagerRootFolder -Directory
80-
if ($scope -eq 'All') {
81-
# Publish AzureRM modules
80+
if ($scope -eq 'All') {
81+
# Publish AzureRM.Profile first
82+
Write-Host "Publishing profile module"
83+
Publish-Module -Path "$resourceManagerRootFolder\AzureRM.Profile" -NuGetApiKey $apiKey -Repository $repoName
84+
Write-Host "Published profile module"
85+
8286
foreach ($module in $resourceManagerModules) {
83-
$modulePath = $module.FullName
84-
Write-Host "Publishing $module module from $modulePath"
85-
Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName
86-
Write-Host "Published $module module"
87+
# Make sure to filter out AzureRM.Profile
88+
if ($module -ne "AzureRM.Profile") {
89+
$modulePath = $module.FullName
90+
Write-Host "Publishing $module module from $modulePath"
91+
Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName
92+
Write-Host "Published $module module"
93+
}
8794
}
8895
} else {
8996
$modulePath = Join-Path $resourceManagerRootFolder "AzureRM.$scope"

0 commit comments

Comments
 (0)