Skip to content

Commit 181aa0c

Browse files
committed
Abstractions Package - C# project changes (#3626)
- Fixed expansion of split expression in version numbers. - Removed addition of PDBs from <AllowedOutputExtensionsInPackageBuildOutputFolder>. - Removed MDS package ref dependency on Abstractions until pipelines are ready. - Renamed AbstractionsPackage to Abstractions in targets. - Updated BUILDGUIDE based on project ref behaviour. - Added feature branches to CI pipeline triggers. - Added missing/incomplete paths to the trigger. - Added dev/* branches to the CI triggers so PRs that target other dev/ branches can run CI. - Added missing MdsPackageVersion property to signed build pipeline job. - Commented-out failing NuGet tool installer task. - Re-ordered Guardian analysis step _before_ build step to avoid clobbering versioned DLLs. - Added MDS package version to AKV build/package steps. - Restored AKV nuspec ReferenceType property for AKV Official builds. - Explicitly building tooling before analysis. - Fixing validation steps to match XML props files. - Added PR automation triggers, and documented other pipeline sections. - Added ReferenceType throughout the MDS/AKV CI build steps. - Added NuGet.config update to main CI build step for Package reference mode. - Swapped Abstractions download and NuGet.config update to ensure packages/ exists before attempting to re-configure NuGet. - Clean target no longer removes packages/ - Uncommented package refs to Abstractions. - Added separate MDS and AKV project builds to support Package mode. - Added $ReferenceType$ property to MDS .nuspec like it is for AKV.
1 parent c96942d commit 181aa0c

File tree

43 files changed

+1207
-550
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1207
-550
lines changed

build.proj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,6 @@
443443
<RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".", "bin", SearchOption.AllDirectories))' />
444444
<RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".", ".nuget", SearchOption.AllDirectories))' />
445445
<RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".", "obj", SearchOption.AllDirectories))' />
446-
<RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".", "packages", SearchOption.AllDirectories))' />
447446
</Target>
448447

449448
<!-- AKV Targets ========================================================= -->

eng/pipelines/akv-official-pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ extends:
113113
sbom:
114114
enabled: ${{ parameters.runSdlTasks }}
115115
packageName: 'Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider'
116-
packageVersion: ${{ variables.nugetPackageVersion }}
116+
packageVersion: ${{ variables.akvPackageVersion }}
117117

118118
tsa:
119119
# OneBranch publishes all sdl results to TSA. If TSA is disabled all SDL tools will
@@ -131,7 +131,7 @@ extends:
131131
apiScanPdbPath: '${{ variables.apiScanPdbPath }}'
132132
assemblyFileVersion: '${{ variables.assemblyFileVersion }}'
133133
buildConfiguration: '${{ parameters.buildConfiguration }}'
134-
nugetPackageVersion: '${{ variables.nugetPackageVersion }}'
134+
akvPackageVersion: '${{ variables.akvPackageVersion }}'
135135
mdsPackageVersion: '${{ variables.mdsPackageVersion }}'
136136
publishSymbols: '${{ parameters.publishSymbols }}'
137137
signingAppRegistrationClientId: '$(SigningAppRegistrationClientId)'

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

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ jobs:
2727
variables:
2828
- template: ../../../libraries/variables.yml@self
2929
- ${{ if parameters.isPreview }}:
30-
- name: NugetPackageVersion
31-
value: $(PreviewNugetPackageVersion)
30+
- name: abstrationsPackageVersion
31+
value: $(abstractionsPackagePreviewVersion)
32+
- name: mdsPackageVersion
33+
value: $(previewMdsPackageVersion)
3234

3335
steps:
3436
- script: SET
@@ -37,20 +39,43 @@ jobs:
3739
- powershell: |
3840
Write-Host "##vso[task.setvariable variable=CDP_BUILD_TYPE_COPY;isOutput=true]$($env:CDP_BUILD_TYPE)"
3941
name: GetBuildType
40-
41-
- template: ../steps/build-all-configurations-signed-dlls-step.yml@self
42-
42+
43+
# Build our tooling, which is required by the analysis step below, but
44+
# shouldn't be analyzed itself.
45+
- task: MSBuild@1
46+
displayName: 'Build Tooling'
47+
inputs:
48+
solution: '**/build.proj'
49+
configuration: $(Configuration)
50+
msbuildArguments: -t:BuildTools
51+
52+
# GOTCHA: This analysis step must run _before_ the build (below) step because
53+
# it builds DLLs that would otherwise clobber the properly-versioned DLLs from
54+
# the build step!
4355
- template: ../steps/code-analyze-step.yml@self
4456
parameters:
4557
analyzeType: all
4658

59+
- template: ../steps/build-all-configurations-signed-dlls-step.yml@self
60+
parameters:
61+
# These values are sourced from common-variables.yml.
62+
configuration: $(Configuration)
63+
abstractionsPackageVersion: $(abstractionsPackageVersion)
64+
abstractionsAssemblyFileVersion: $(abstractionsAssemblyFileVersion)
65+
mdsPackageVersion: $(mdsPackageVersion)
66+
mdsAssemblyFileVersion: $(mdsAssemblyFileVersion)
67+
4768
- template: ../steps/esrp-code-signing-step.yml@self
4869
parameters:
4970
artifactType: dll
5071

5172
- template: ../steps/generate-nuget-package-step.yml@self
5273
parameters:
53-
OutputDirectory: $(artifactDirectory)
74+
nuspecPath: $(nuspecPath)
75+
packageVersion: $(mdsPackageVersion)
76+
outputDirectory: $(artifactDirectory)
77+
displayName: 'Create MDS NuGet Package'
78+
referenceType: Package
5479
properties: 'AbstractionsPackageVersion=$(abstractionsPackageVersion)'
5580

5681
- template: ../steps/esrp-code-signing-step.yml@self
@@ -65,4 +90,4 @@ jobs:
6590
- template: ../steps/publish-symbols-step.yml@self
6691
parameters:
6792
publishSymbols: ${{ parameters['PublishSymbols'] }}
68-
symbolsArtifactName: mds_symbols_$(System.TeamProject)_$(Build.Repository.Name)_$(Build.SourceBranchName)_$(NuGetPackageVersion)_$(System.TimelineId)
93+
symbolsArtifactName: mds_symbols_$(System.TeamProject)_$(Build.Repository.Name)_$(Build.SourceBranchName)_$(mdsPackageVersion)_$(System.TimelineId)

eng/pipelines/common/templates/jobs/ci-build-nugets-job.yml

Lines changed: 67 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44
# See the LICENSE file in the project root for more information. #
55
#################################################################################
66
parameters:
7+
8+
- name: 'debug'
9+
type: boolean
10+
default: false
11+
12+
- name: referenceType
13+
type: string
14+
values:
15+
- Package
16+
- Project
17+
718
- name: poolName
819
type: string
920
default: $(ci_var_defaultPoolName)
@@ -12,9 +23,13 @@ parameters:
1223
type: string
1324
default: ADO-MMS22-SQL19
1425

15-
- name: artifactName
26+
- name: abstractionsArtifactName
1627
type: string
17-
default: Artifacts
28+
default: Abstractions.Artifact
29+
30+
- name: mdsArtifactName
31+
type: string
32+
default: MDS.Artifact
1833

1934
- name: platform
2035
type: string
@@ -28,8 +43,15 @@ parameters:
2843
type: stepList
2944
default: []
3045

46+
- name: abstractionsPackageVersion
47+
type: string
48+
49+
- name: mdsPackageVersion
50+
type: string
51+
3152
jobs:
32-
- job: build_nugets
53+
- job: build_mds_akv_packages_job
54+
displayName: Build MDS & AKV Packages
3355

3456
pool:
3557
name: ${{parameters.poolName }}
@@ -44,36 +66,65 @@ jobs:
4466
- ${{ if ne(parameters.prebuildSteps, '') }}:
4567
- ${{ parameters.prebuildSteps }} # extra steps to run before the build like downloading sni and the required configuration
4668

69+
# If we're testing in Package mode, download the Abstractions package artifacts into packages/,
70+
# and then setup the top-level NuGet.config to look in packages/ for local
71+
# NuGet dependencies.
72+
- ${{ if eq(parameters.referenceType, 'Package') }}:
73+
- task: DownloadPipelineArtifact@2
74+
displayName: Download Abstractions Package Artifact
75+
inputs:
76+
artifactName: ${{ parameters.abstractionsArtifactName }}
77+
targetPath: $(packagePath)
78+
# Note that packages/ will have been created by the above step, which is a
79+
# pre-requisite for configuring NuGet.
80+
- template: ../steps/ci-prebuild-step.yml@self
81+
parameters:
82+
debug: ${{ parameters.debug }}
83+
referenceType: ${{ parameters.referenceType }}
84+
4785
- template: ../steps/ci-project-build-step.yml@self
4886
parameters:
4987
platform: ${{ parameters.platform }}
5088
configuration: ${{ parameters.configuration }}
89+
referenceType: ${{ parameters.referenceType }}
5190
operatingSystem: Windows
52-
build: all
91+
build: MDS
92+
abstractionsPackageVersion: ${{parameters.abstractionsPackageVersion}}
5393

5494
- template: ../steps/generate-nuget-package-step.yml@self
5595
parameters:
56-
NugetPackageVersion: $(NugetPackageVersion)
96+
packageVersion: ${{ parameters.mdsPackageVersion }}
5797
configuration: $(Configuration)
5898
nuspecPath: 'tools/specs/Microsoft.Data.SqlClient.nuspec'
59-
OutputDirectory: $(packagePath)
99+
outputDirectory: $(packagePath)
60100
generateSymbolsPackage: false
61-
properties: 'AbstractionsPackageVersion=$(abstractionsPackageVersion)'
62-
displayName: 'Generate NuGet package M.D.SqlClient'
101+
referenceType: ${{ parameters.referenceType }}
102+
properties: 'AbstractionsPackageVersion=${{ parameters.abstractionsPackageVersion }}'
103+
displayName: 'Create MDS NuGet Package'
104+
105+
- template: ../steps/ci-project-build-step.yml@self
106+
parameters:
107+
platform: ${{ parameters.platform }}
108+
configuration: ${{ parameters.configuration }}
109+
referenceType: ${{ parameters.referenceType }}
110+
operatingSystem: Windows
111+
build: AKV
112+
mdsPackageVersion: ${{parameters.mdsPackageVersion}}
63113

64114
- template: ../steps/generate-nuget-package-step.yml@self
65115
parameters:
66-
NugetPackageVersion: $(NugetPackageVersion)
116+
packageVersion: $(akvPackageVersion)
67117
configuration: $(Configuration)
68118
nuspecPath: 'tools/specs/add-ons/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.nuspec'
69-
OutputDirectory: $(packagePath)
119+
outputDirectory: $(packagePath)
70120
generateSymbolsPackage: false
71-
properties: 'MdsPackageVersion=$(mdsPackageVersion)'
121+
referenceType: ${{ parameters.referenceType }}
122+
properties: 'MdsPackageVersion=${{ parameters.mdsPackageVersion }}'
72123
installNuget: false
73-
displayName: 'Generate NuGet package AKV Provider'
124+
displayName: 'Create AKV NuGet Package'
74125

75-
- task: PublishBuildArtifacts@1
76-
displayName: 'Publish Artifact: Artifacts'
126+
- task: PublishPipelineArtifact@1
127+
displayName: 'Publish Pipeline Artifact'
77128
inputs:
78-
PathtoPublish: $(packagePath)
79-
ArtifactName: ${{ parameters.artifactName }}
129+
targetPath: $(packagePath)
130+
artifactName: ${{ parameters.mdsArtifactName }}

0 commit comments

Comments
 (0)