Skip to content

Commit d4fed3a

Browse files
authored
Merge pull request #5865 from cormacpayne/sign-job-fix
Fix issue in sign job where multiple required modules are being used
2 parents ec08069 + 5a7eced commit d4fed3a

File tree

4 files changed

+24
-11
lines changed

4 files changed

+24
-11
lines changed

build.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@
254254

255255
<Message Importance="high" Text="Running Static Analyser" />
256256
<CallTarget targets="DependencyAnalysis" ContinueOnError="ErrorAndContinue" />
257-
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\CheckAssemblies.ps1 &quot;" />
257+
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\CheckAssemblies.ps1 -BuildConfig $(Configuration) &quot;" />
258258
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\CleanupBuild.ps1 -BuildConfig $(Configuration) &quot;" />
259259
</Target>
260260

src/ResourceManager/Aks/AzureRM.Aks.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ CLRVersion = '4.0'
5151
# ProcessorArchitecture = ''
5252

5353
# Modules that must be imported into the global environment prior to importing this module
54-
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '4.1.1'; })
54+
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '4.5.0'; })
5555

5656
# Assemblies that must be loaded prior to importing this module
5757
RequiredAssemblies = '.\YamlDotNet.dll',

src/Storage/Azure.Storage.psd1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ CLRVersion = '4.0'
5454
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '4.5.0'; })
5555

5656
# Assemblies that must be loaded prior to importing this module
57-
# RequiredAssemblies = @()
57+
RequiredAssemblies = '.\Microsoft.WindowsAzure.Storage.dll',
58+
'.\Microsoft.WindowsAzure.Storage.DataMovement.dll',
59+
'.\Microsoft.Azure.KeyVault.Core.dll',
60+
'.\Microsoft.WindowsAzure.Management.dll'
5861

5962
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
6063
# ScriptsToProcess = @()

tools/CheckAssemblies.ps1

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,19 @@
1111
# limitations under the License.
1212
# ----------------------------------------------------------------------------------
1313

14+
[CmdletBinding()]
15+
Param
16+
(
17+
[Parameter()]
18+
[string]$BuildConfig
19+
)
20+
1421
$ProjectPaths = @( "$PSScriptRoot\..\src\ResourceManager" )
1522
$DependencyMapPath = "$PSScriptRoot\..\src\Package\DependencyMap.csv"
1623

1724
$DependencyMap = Import-Csv -Path $DependencyMapPath
1825

19-
$ModuleManifestFiles = $ProjectPaths | % { Get-ChildItem -Path $_ -Filter "*.psd1" -Recurse | where { $_.FullName -notlike "*Debug*" -and `
26+
$ModuleManifestFiles = $ProjectPaths | % { Get-ChildItem -Path $_ -Filter "*.psd1" -Recurse | where { $_.FullName -notlike "*$BuildConfig*" -and `
2027
$_.FullName -notlike "*Netcore*" -and `
2128
$_.FullName -notlike "*dll-Help.psd1*" -and `
2229
$_.FullName -notlike "*Stack*" } }
@@ -45,14 +52,17 @@ foreach ($ModuleManifest in $ModuleManifestFiles)
4552
{
4653
continue
4754
}
48-
Import-LocalizedData -BindingVariable ModuleMetadata -BaseDirectory $RequiredModuleManifest.DirectoryName -FileName $RequiredModuleManifest.Name
4955

50-
if ($ModuleMetadata.RequiredAssemblies.Count -gt 0)
51-
{
52-
$LoadedAssemblies += $ModuleMetadata.RequiredAssemblies
53-
}
56+
$RequiredModuleManifest | % {
57+
Import-LocalizedData -BindingVariable ModuleMetadata -BaseDirectory $_.DirectoryName -FileName $_.Name
5458

55-
$LoadedAssemblies += $ModuleMetadata.NestedModules
59+
if ($ModuleMetadata.RequiredAssemblies.Count -gt 0)
60+
{
61+
$LoadedAssemblies += $ModuleMetadata.RequiredAssemblies
62+
}
63+
64+
$LoadedAssemblies += $ModuleMetadata.NestedModules
65+
}
5666
}
5767
}
5868

@@ -73,4 +83,4 @@ foreach ($ModuleManifest in $ModuleManifestFiles)
7383
{
7484
throw
7585
}
76-
}
86+
}

0 commit comments

Comments
 (0)