Skip to content

Commit e847568

Browse files
committed
Fixed MDS assembly file version value.
1 parent 182be50 commit e847568

2 files changed

Lines changed: 23 additions & 34 deletions

File tree

eng/pipelines/common/templates/jobs/validate-signed-package-job.yml

Lines changed: 22 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ jobs:
3838
isCustom: true
3939
name: ADO-1ES-Pool
4040
vmImage: 'ADO-MMS22-SQL19'
41-
41+
4242
variables: # More settings at https://aka.ms/obpipelines/yaml/jobs
4343
- template: /eng/pipelines/libraries/mds-validation-variables.yml@self
44-
44+
4545
- name: pathToDownloadedNuget # path to the downloaded nuget files
4646
value: $(Pipeline.Workspace)\${{parameters.packageFolderName }}
47-
47+
4848
- name: BuildType
4949
value: $[ stageDependencies.buildMDS.build_signed_package.outputs['GetBuildType.CDP_BUILD_TYPE_COPY'] ]
5050

@@ -61,21 +61,10 @@ jobs:
6161
- task: NuGetToolInstaller@1
6262
displayName: 'Use NuGet'
6363

64-
- powershell: |
65-
# Sets the pipeline ASSEMBLY_VERSION variable.
66-
67-
[Xml] $versionprops = Get-Content -Path ".\tools\props\Versions.props"
68-
Write-Host $versionprops.Project.PropertyGroup[0].AssemblyFileVersion
69-
70-
$AssemblyVersion = $versionprops.Project.PropertyGroup[0].AssemblyVersion
71-
72-
Write-Host "##vso[task.setvariable variable=ASSEMBLY_VERSION;]$AssemblyVersion"
73-
displayName: 'Update assembly version property'
74-
7564
- powershell: |
7665
# Displays the paths of all the local cache directories
7766
nuget locals all -List
78-
67+
7968
#Clears all files from all local cache directories
8069
nuget locals all -Clear
8170
displayName: 'Clear local cache'
@@ -99,7 +88,7 @@ jobs:
9988
Write-Host "--------------------------------------------------"
10089
Write-Host "This will verify the artifact signature" -ForegroundColor Green
10190
Write-Host "--------------------------------------------------"
102-
91+
10392
if ($packageType -eq 'dll' -or $packageType -eq 'both')
10493
{
10594
nuget verify -All $(pathToDownloadedNuget)\*.nupkg
@@ -111,15 +100,15 @@ jobs:
111100
displayName: 'Verify nuget signature'
112101
113102
- powershell: |
114-
$buildType = [string]"$(BuildType)"
103+
$buildType = [string]"$(BuildType)"
115104
116105
if($buildType -eq 'Official')
117106
{
118107
# Recursively find all .dll files in TempFolder (installed nuget folder)
119108
# Microsoft.Data.SqlClient.dll and Microsoft.Data.SqlClient.resources.dll (in localized folders) should have strong name
120109
$dllFiles = Get-ChildItem -Path $(TempFolderName) -Recurse -Filter *.dll
121110
$badDlls = @()
122-
foreach ($file in $dllFiles)
111+
foreach ($file in $dllFiles)
123112
{
124113
# Run sn.k to verify the strong name on each dll
125114
$result = & "C:\Program Files (x86)\Microsoft SDKs\Windows\*\bin\NETFX 4.8.1 Tools\sn.exe" -vf $file.FullName
@@ -137,7 +126,7 @@ jobs:
137126
foreach($dll in $badDlls)
138127
{
139128
Write-Output $dll
140-
}
129+
}
141130
Exit -1
142131
}
143132
Write-Host "Strong name has been verified for all dlls"
@@ -179,7 +168,7 @@ jobs:
179168
}
180169
}
181170
}
182-
171+
183172
elseif ($_.Name -eq 'runtimes'){
184173
Get-ChildItem -Depth 3 -Path $_.FullName -Exclude $excludNamesFromRuntimeFolder -Directory | foreach{
185174
if('$(expectedDotnetVersions)'.Contains($_.Name)){
@@ -211,15 +200,15 @@ jobs:
211200
212201
- powershell: |
213202
# list all the child items of created temp folder
214-
203+
215204
#Verify all DLLs unzipped match "expected" hierarchy
216-
205+
217206
foreach( $folderName in (Get-ChildItem -Path $(extractedNugetPath) -Directory).Name)
218207
{
219208
# List all Childerns of the Path
220-
Get-ChildItem -Path $(extractedNugetPath)\$folderName -Recurse -File
221-
$subFiles = Get-ChildItem -Path $(extractedNugetPath)\$folderName -Recurse -File
222-
209+
Get-ChildItem -Path $(extractedNugetPath)\$folderName -Recurse -File
210+
$subFiles = Get-ChildItem -Path $(extractedNugetPath)\$folderName -Recurse -File
211+
223212
foreach($file in $subFiles)
224213
{
225214
if($subFiles[0].Name -like "*.dll" )
@@ -238,7 +227,7 @@ jobs:
238227
Write-Host "Expected file pattern for localization did not match to *.dll" -ForegroundColor Red
239228
Exit -1
240229
}
241-
}
230+
}
242231
}
243232
else
244233
{
@@ -252,7 +241,7 @@ jobs:
252241
displayName: 'Verify all DLLs unzipped match "expected" hierarchy'
253242
- powershell: |
254243
# Verify all dlls status are Valid
255-
244+
256245
$dlls = Get-ChildItem -Path $(extractedNugetPath) -Recurse -Include *.dll
257246
foreach ($status in $dlls | Get-AuthenticodeSignature)
258247
{
@@ -274,18 +263,18 @@ jobs:
274263
# expected values.
275264
$failed = 0
276265
277-
foreach ( $pVersion in Get-ChildItem *.dll -Path $(extractedNugetPath) -Recurse | ForEach-Object versioninfo )
266+
foreach ( $pVersion in Get-ChildItem *.dll -Path $(extractedNugetPath) -Recurse | ForEach-Object versioninfo )
278267
{
279268
if ($pVersion.ProductVersion -Like '$(mdsPackageVersion)*')
280269
{
281270
Write-Host -ForegroundColor Green "Correct ProductVersion detected for $($pVersion.FileName): $($pVersion.ProductVersion)"
282271
}
283272
else
284-
{
273+
{
285274
Write-Host -ForegroundColor Red "Wrong ProductVersion detected for $($pVersion.FileName); expected: $(mdsPackageVersion); found: $($pVersion.ProductVersion)"
286275
$failed = 1
287276
}
288-
277+
289278
if ($pVersion.FileVersion -eq '$(mdsAssemblyFileVersion)')
290279
{
291280
Write-Host -ForegroundColor Green "Correct FileVersion detected for $($pVersion.FileName): $($pVersion.FileVersion)"
@@ -296,7 +285,7 @@ jobs:
296285
$failed = 1
297286
}
298287
}
299-
288+
300289
if ($failed -ne 0)
301290
{
302291
Exit -1
@@ -314,10 +303,10 @@ jobs:
314303
# TODO: This also isn't checking the versions of the actual assemblies in
315304
# the package, so it isn't terribly useful.
316305
317-
[Xml] $versionprops = Get-Content -Path "tools/props/Versions.props"
306+
[Xml] $versionprops = Get-Content -Path "tools/props/Versions.props"
318307
$AssemblyFileVersion = $versionprops.Project.PropertyGroup[2].AssemblyFileVersion
319308
$AssemblyVersion = $versionprops.Project.PropertyGroup[2].AssemblyVersion
320-
309+
321310
if($AssemblyFileVersion -eq $AssemblyVersion)
322311
{
323312
Write-Host AssemblyFileVersion: $AssemblyFileVersion should not be equal to: $AssemblyVersion

eng/pipelines/common/templates/steps/build-all-configurations-signed-dlls-step.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ steps:
4343
-p:ReferenceType=${{ parameters.referenceType }}
4444
-p:GenerateNuget=false
4545
-p:SigningKeyPath=$(Agent.TempDirectory)\netfxKeypair.snk
46-
-p:MdsAssemblyFileVersion=${{ parameters.mdsAssemblyFileVersion }}
46+
-p:AssemblyFileVersion=${{ parameters.mdsAssemblyFileVersion }}
4747
-p:MdsPackageVersion=${{ parameters.mdsPackageVersion }}

0 commit comments

Comments
 (0)