Skip to content

Commit f999881

Browse files
committed
Merge pull request #997 from yugangw-msft/azurestorage
Add AzureStorage to scope of build.proj
2 parents 052dd56 + 95fc632 commit f999881

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

build.proj

Lines changed: 9 additions & 4 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+
'Azure': 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 -->
@@ -41,7 +46,8 @@
4146
<ItemGroup>
4247
<CmdletSolutionsToBuild Include=".\src\ResourceManager\**\*.sln;.\src\ServiceManagement\ServiceManagement.sln" Condition=" '$(Scope)' == '' "/>
4348
<CmdletSolutionsToBuild Include=".\src\ResourceManager\$(Scope)\*.sln" Condition=" '$(Scope)' != '' and '$(Scope)' != 'ServiceManagement' "/>
44-
<CmdletSolutionsToBuild Include=".\src\ServiceManagement\ServiceManagement.sln" Condition=" '$(Scope)' != '' and '$(Scope)' == 'ServiceManagement' "/>
49+
<CmdletSolutionsToBuild Include=".\src\ServiceManagement\ServiceManagement.sln"
50+
Condition=" '$(Scope)' != '' and ('$(Scope)' == 'ServiceManagement' or '$(Scope)' == 'AzureStorage') "/>
4551
<SetupSln Include=".\setup\azurepowershell.sln" />
4652
<SetupPowershellGetSln Include=".\setup-powershellget\powershellget.sln" />
4753
</ItemGroup>
@@ -292,8 +298,7 @@
292298
<Target Name="Publish" DependsOnTargets="Build">
293299
<Error Condition=" '$(NuGetKey)' == '' " Text="You must provide the NuGetKey parameter to the build: /p:NuGetKey=YOUR_PUBLISHING_KEY" />
294300
<Message Importance="high" Text="Publishing Cmdlets..." />
295-
296-
<Exec Command="$(PowerShellCommand) -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\PublishModules.ps1 $(Configuration) $(Scope) $(NuGetKey) \&quot;$(NuGetPublishingSource)\&quot; &quot;"/>
301+
<Exec Command="$(PowerShellCommand) -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\PublishModules.ps1 $(Configuration) $(Scope) $(NuGetKey) \&quot;$(NuGetPublishingSource)\&quot; &quot;"/>
297302
</Target>
298303

299304
<PropertyGroup>

tools/PublishModules.ps1

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ if ([string]::IsNullOrEmpty($repositoryLocation))
3838
if ([string]::IsNullOrEmpty($scope))
3939
{
4040
Write-Verbose "Default scope to all"
41-
$scope = 'all'
41+
$scope = 'All'
4242
}
4343

4444
Write-Host "Publishing $scope package(s)"
@@ -53,13 +53,20 @@ if ($repo -ne $null) {
5353
Register-PSRepository -Name $repoName -SourceLocation $repositoryLocation -PublishLocation $repositoryLocation/package -InstallationPolicy Trusted
5454
}
5555

56-
if (($scope -eq 'all') -or ($scope -eq 'servicemanagement')) {
56+
if (($scope -eq 'All') -or ($scope -eq 'ServiceManagement')) {
5757
$modulePath = "$packageFolder\$buildConfig\ServiceManagement\Azure"
5858
# Publish Azure module
5959
Write-Host "Publishing Azure module from $modulePath"
6060
Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName
6161
}
6262

63+
if (($scope -eq 'All') -or ($scope -eq 'AzureStorage')) {
64+
$modulePath = "$packageFolder\$buildConfig\ServiceManagement\Azure\Azure.Storage"
65+
# Publish AzureStorage module
66+
Write-Host "Publishing AzureStorage module from $modulePath"
67+
Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName
68+
}
69+
6370
if ($scope -eq 'AzureRM') {
6471
# Publish AzureRM module
6572
$modulePath = "$PSScriptRoot\AzureRM"
@@ -70,7 +77,7 @@ if ($scope -eq 'AzureRM') {
7077

7178
$resourceManagerRootFolder = "$packageFolder\$buildConfig\ResourceManager\AzureResourceManager"
7279
$resourceManagerModules = Get-ChildItem -Path $resourceManagerRootFolder -Directory
73-
if ($scope -eq 'all') {
80+
if ($scope -eq 'All') {
7481
# Publish AzureRM modules
7582
foreach ($module in $resourceManagerModules) {
7683
$modulePath = $module.FullName

0 commit comments

Comments
 (0)