Skip to content

Commit feab3b3

Browse files
committed
misc updates to get psget module published correctly
1 parent 7b444e0 commit feab3b3

File tree

4 files changed

+22
-12
lines changed

4 files changed

+22
-12
lines changed

AzurePowershell.Test.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
<ItemGroup Condition=" '$(scope)' == 'ServiceManagement' ">
8686
<XUnitTests Include="@(AsmXUnitTests)"/>
8787
</ItemGroup>
88-
<ItemGroup Condition=" '$(scope)' != 'all' and '$(scope)' != 'ServiceManagement' and $(scope)' != 'AzureStorage' ">
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@
297297
</Target>
298298

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

src/ResourceManager/ApiManagement/ApiManagement.sln

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio 2013
3-
VisualStudioVersion = 12.0.31101.0
3+
VisualStudioVersion = 12.0.40629.0
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{95C16AED-FD57-42A0-86C3-2CF4300A4817}"
66
EndProject
@@ -32,6 +32,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Co
3232
EndProject
3333
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ServiceManagement.Common", "..\..\ServiceManagement\Common\Commands.ServiceManagement.Common\Commands.ServiceManagement.Common.csproj", "{CFF09E81-1E31-444E-B4D4-A21E946C29E2}"
3434
EndProject
35+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Tags", "..\Tags\Commands.Tags\Commands.Tags.csproj", "{2493A8F7-1949-4F29-8D53-9D459046C3B8}"
36+
EndProject
3537
Global
3638
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3739
Debug|Any CPU = Debug|Any CPU
@@ -94,6 +96,10 @@ Global
9496
{CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
9597
{CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
9698
{CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Release|Any CPU.Build.0 = Release|Any CPU
99+
{2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
100+
{2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
101+
{2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
102+
{2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.Build.0 = Release|Any CPU
97103
EndGlobalSection
98104
GlobalSection(SolutionProperties) = preSolution
99105
HideSolutionNode = FALSE

tools/PublishModules.ps1

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,19 @@ if ($repo -ne $null) {
5353
Register-PSRepository -Name $repoName -SourceLocation $repositoryLocation -PublishLocation $repositoryLocation/package -InstallationPolicy Trusted
5454
}
5555

56+
$resourceManagerRootFolder = "$packageFolder\$buildConfig\ResourceManager\AzureResourceManager"
57+
58+
if ($scope -eq 'All') {
59+
# Publish AzureRM.Profile first which is the common dependency
60+
Write-Host "Publishing profile module"
61+
Publish-Module -Path "$resourceManagerRootFolder\AzureRM.Profile" -NuGetApiKey $apiKey -Repository $repoName
62+
Write-Host "Published profile module"
63+
}
64+
5665
if (($scope -eq 'All') -or ($scope -eq 'ServiceManagement')) {
5766
$modulePath = "$packageFolder\$buildConfig\ServiceManagement\Azure"
5867
# Publish Azure module
59-
Write-Host "Publishing Azure module from $modulePath"
68+
Write-Host "Publishing ServiceManagement(aka Azure) module from $modulePath"
6069
Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName
6170
}
6271

@@ -75,17 +84,12 @@ if ($scope -eq 'AzureRM') {
7584
Write-Host "Published Azure module"
7685
}
7786

78-
$resourceManagerRootFolder = "$packageFolder\$buildConfig\ResourceManager\AzureResourceManager"
7987
$resourceManagerModules = Get-ChildItem -Path $resourceManagerRootFolder -Directory
8088
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-
8689
foreach ($module in $resourceManagerModules) {
87-
# Make sure to filter out AzureRM.Profile
88-
if ($module -ne "AzureRM.Profile") {
90+
# filter out AzureRM.Profile which always gets published first
91+
# And "Azure.Storage" which is built out as test dependencies
92+
if (($module.Name -ne "AzureRM.Profile") -and ($module.Name -ne "Azure.Storage")) {
8993
$modulePath = $module.FullName
9094
Write-Host "Publishing $module module from $modulePath"
9195
Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName

0 commit comments

Comments
 (0)