Skip to content

Commit

Permalink
Fix the .NET SDK installer script used by MRT Core, and don't run the…
Browse files Browse the repository at this point in the history
… script anymore (#2640)

* Fix the .NET SDK install script.

* Remove .NET SDK version from global.json file.

* Don't run the DownloadDotNetCoreSdk.ps1 script in the pipeline.
  • Loading branch information
jefgen authored Jun 17, 2022
1 parent 8e96a74 commit c3013e1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 20 deletions.
26 changes: 13 additions & 13 deletions build/build-mrt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,19 @@ steps:
# PathtoPublish: '${{ parameters.MRTSourcesDirectory }}\msbuild-install-logs'
# artifactName: 'installlogs'

- task: powershell@2
displayName: 'Installing .NET SDK'
inputs:
targetType: filePath
workingDirectory: ${{ parameters.MRTSourcesDirectory }}\build
filePath: ${{ parameters.MRTSourcesDirectory }}\build\DownloadDotNetCoreSdk.ps1

- task: BatchScript@1
displayName: 'Use .NET SDK'
inputs:
filename: '${{ parameters.MRTSourcesDirectory }}\build\SetDotnetVars.cmd'
arguments: '${{ parameters.MRTSourcesDirectory }}'
modifyEnvironment: true
# - task: powershell@2
# displayName: 'Installing .NET SDK'
# inputs:
# targetType: filePath
# workingDirectory: ${{ parameters.MRTSourcesDirectory }}\build
# filePath: ${{ parameters.MRTSourcesDirectory }}\build\DownloadDotNetCoreSdk.ps1

# - task: BatchScript@1
# displayName: 'Use .NET SDK'
# inputs:
# filename: '${{ parameters.MRTSourcesDirectory }}\build\SetDotnetVars.cmd'
# arguments: '${{ parameters.MRTSourcesDirectory }}'
# modifyEnvironment: true

- task: powershell@2
displayName: 'Create test pfx to sign MSIX test packages (DevCheck)'
Expand Down
5 changes: 2 additions & 3 deletions dev/MRTCore/build/DownloadDotNetCoreSdk.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ param(
$dotnetInstallScript = "$env:TEMP\dotnet-install.ps1"

$repoInstallDir = [System.IO.Path]::GetFullPath("$PSScriptRoot\..\.dotnet")
$versionPropsFilePropertyGroup = ([xml](Get-Content -Raw "$PSScriptRoot\..\..\..\eng\versions.props")).Project.PropertyGroup[0]
$versionPropsFilePropertyGroup = ([xml](Get-Content -Raw "$PSScriptRoot\..\..\..\eng\versions.props")).Project.PropertyGroup
$dotNetSdkVersion = $versionPropsFilePropertyGroup.CsWinRTDependencyDotNetCoreSdkPackageVersion
$dotNetSdkVersionLkg = if (-not $skipLKG) { $versionPropsFilePropertyGroup.CsWinRTDependencyDotNetCoreSdkLkgPackageVersion }

Expand Down Expand Up @@ -108,7 +108,7 @@ $latestAlreadyInstalled = Is-Installed $dotNetSdkVersion
$lkgAlreadyInstalled = $true

# Only try to install the lkg sdk if specified
if (-not [string]::IsNullOrEmpty($dotNetSdkVersionLkg))
if ((-not [string]::IsNullOrEmpty($dotNetSdkVersionLkg)) -and ($dotNetSdkVersionLkg -ine '$(CsWinRTDependencyDotNetCoreSdkPackageVersion)'))
{
$lkgAlreadyInstalled = Is-Installed $dotNetSdkVersionLkg
}
Expand Down Expand Up @@ -161,4 +161,3 @@ if (-not $lkgAlreadyInstalled)
{
Install-SDK -version $dotNetSdkVersionLkg -channel "master"
}

4 changes: 0 additions & 4 deletions dev/MRTCore/global.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"sdk": {
"version": "5.0.404",
"rollForward": "latestMajor"
},
"msbuild-sdks": {
"Microsoft.Build.NoTargets" : "1.0.88"
}
Expand Down

0 comments on commit c3013e1

Please sign in to comment.