diff --git a/build.cmd b/build.cmd index 3eadedcf45a..75dc52cafcc 100755 --- a/build.cmd +++ b/build.cmd @@ -9,7 +9,7 @@ set DOTNET_NOLOGO=true @REM Sets the output of GetMSBuildPath.ps1 to the MSBuildPath environment variable. @REM https://stackoverflow.com/a/3417728/294804 -FOR /F "usebackq delims=" %%v IN (`powershell -NonInteractive -NoLogo -NoProfile -ExecutionPolicy Unrestricted -File "%~dp0eng\scripts\GetMSBuildPath.ps1"`) DO set "MSBuildPath=%%~v" +FOR /F "usebackq delims=" %%v IN (`powershell -NonInteractive -NoLogo -NoProfile -ExecutionPolicy Unrestricted -File "%~dp0eng\scripts\GetMSBuildPath.ps1" %VisualStudioMinimumVersion%`) DO set "MSBuildPath=%%~v" if not defined MSBuildPath ( echo Visual Studio must be installed to allow building via MSBuild. diff --git a/eng/pipelines/official.yml b/eng/pipelines/official.yml index 37be3c3680a..e56b1dc1296 100644 --- a/eng/pipelines/official.yml +++ b/eng/pipelines/official.yml @@ -111,7 +111,7 @@ parameters: - name: VisualStudioMinimumVersion displayName: Visual Studio Minimum Version type: string - default: '18' + default: '17' ################################################################################################################################################################### # STAGES diff --git a/eng/pipelines/pull-request.yml b/eng/pipelines/pull-request.yml index d6c01746a7e..72d22ddbb0f 100644 --- a/eng/pipelines/pull-request.yml +++ b/eng/pipelines/pull-request.yml @@ -36,6 +36,8 @@ variables: # Opt out of automatically injecting Codesign Validation into the pipeline. # See: https://aka.ms/gdn-injection runCodesignValidationInjection: false + # Set the minimum visual studio version. This overrides the version in version.json for the build toolset. + MinVisualStudioVersion: '17.0' ################################################################################################################################################################### # STAGES @@ -49,7 +51,9 @@ stages: parameters: BuildConfiguration: Debug ArtifactName: '$(Build.BuildNumber)-Debug' + VisualStudioMinimumVersion: $(MinVisualStudioVersion) - template: templates/build-pull-request.yml parameters: BuildConfiguration: Release ArtifactName: '$(Build.BuildNumber)' + VisualStudioMinimumVersion: $(MinVisualStudioVersion) \ No newline at end of file diff --git a/eng/pipelines/templates/build-official-release.yml b/eng/pipelines/templates/build-official-release.yml index 5b533112bd5..e8d11927481 100644 --- a/eng/pipelines/templates/build-official-release.yml +++ b/eng/pipelines/templates/build-official-release.yml @@ -19,6 +19,8 @@ jobs: displayName: Build Official Release # We make this timeout more than double the normal amount of build time as signing has a highly variable amount of time to complete. timeoutInMinutes: 90 # API Scan can take a long time and fail the build + variables: + VisualStudioMinimumVersion: ${{ parameters.VisualStudioMinimumVersion }} templateContext: mb: signing: @@ -90,7 +92,6 @@ jobs: allowPackageConflicts: true nuGetFeedType: external - steps: ################################################################################################################################################################### @@ -139,6 +140,13 @@ jobs: inputs: forceReinstallCredentialProvider: true + # Sets the VisualStudioMinimumVersion variable for the job. This variable is also used by the APIScan job. + # https://docs.microsoft.com/azure/devops/pipelines/process/set-variables-scripts?view=azure-devops&tabs=powershell#set-variable-properties + - powershell: Write-Host "##vso[task.setvariable variable=VisualStudioMinimumVersion;isoutput=true]$(VisualStudioMinimumVersion)" + displayName: Set VisualStudioMinimumVersion Variable + # Name is required to reference the variables created within this build step in other stages. + name: SetVisualStudioMinimumVersionVariable + # Runs the full build of the projects in the repository. See Build.proj for details. - script: $(Build.SourcesDirectory)/build.cmd /v:normal /p:Configuration=$(BuildConfiguration) /p:CIBuild=true displayName: Build All Projects @@ -172,13 +180,6 @@ jobs: - task: MicroBuildSwixPlugin@4 displayName: Install Swix Plugin - # Sets the VisualStudioMinimumVersion variable for the job. This variable is also used by the APIScan job. - # https://docs.microsoft.com/azure/devops/pipelines/process/set-variables-scripts?view=azure-devops&tabs=powershell#set-variable-properties - - powershell: Write-Host "##vso[task.setvariable variable=VisualStudioMinimumVersion;isoutput=true]$(. '$(Build.SourcesDirectory)/eng/scripts/GetVisualStudioMinimumVersion.ps1')" - displayName: Set VisualStudioMinimumVersion Variable - # Name is required to reference the variables created within this build step in other stages. - name: SetVisualStudioMinimumVersionVariable - # Creates the VS bootstrapper information based on the build's .vsman file. # This bootstrapper information is only used for OptProf currently. # Since this data will be output with rest of our insertion files, we produce this data now and publish it in the build artifacts. diff --git a/eng/pipelines/templates/build-pull-request.yml b/eng/pipelines/templates/build-pull-request.yml index d80022ffe9e..539b0e35e04 100644 --- a/eng/pipelines/templates/build-pull-request.yml +++ b/eng/pipelines/templates/build-pull-request.yml @@ -7,6 +7,7 @@ jobs: variables: BuildConfiguration: ${{ parameters.BuildConfiguration }} ArtifactName: ${{ parameters.ArtifactName }} + VisualStudioMinimumVersion: ${{ parameters.VisualStudioMinimumVersion }} steps: ################################################################################################################################################################### @@ -43,6 +44,13 @@ jobs: - task: NuGetAuthenticate@1 displayName: Authenticate NuGet + # Sets the VisualStudioMinimumVersion variable for the job. + # https://docs.microsoft.com/azure/devops/pipelines/process/set-variables-scripts?view=azure-devops&tabs=powershell#set-variable-properties + - powershell: Write-Host "##vso[task.setvariable variable=VisualStudioMinimumVersion;isoutput=true]$(VisualStudioMinimumVersion)" + displayName: Set VisualStudioMinimumVersion Variable + # Name is required to reference the variables created within this build step in other stages. + name: SetVisualStudioMinimumVersionVariable + # Runs the full build of the projects in the repository. See Build.proj for details. - script: $(Build.SourcesDirectory)/build.cmd /v:normal /p:Configuration=$(BuildConfiguration) /p:CIBuild=true displayName: Build All Projects diff --git a/version.json b/version.json index fa448963747..64cba31d2d1 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json", - "version": "17.14", + "version": "18.1", "cloudBuild": { "setAllVariables": true }