Skip to content

Commit

Permalink
Workaround dotnet CLI/NuGet restore issue
Browse files Browse the repository at this point in the history
Workaround a bug in the NuGet restore logic shipped with the dotnet CLI.
NuGet/Home#8692
  • Loading branch information
mjcheetham committed Nov 7, 2019
1 parent 9325c72 commit ad94ae4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .azure-pipelines/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
release:
configuration: Release
pool:
vmImage: vs2017-win2016
vmImage: windows-2019
steps:
- powershell: $(Build.Repository.LocalPath)/Scripts/CI/Set-Version.ps1 -SourceBranchCounter $(branchCounter)
displayName: "Compute product version"
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
platformFriendlyName: Windows
configuration: Release
pool:
vmImage: vs2017-win2016
vmImage: windows-2019
dependsOn: Windows_Build_and_UnitTests
condition: succeeded()
steps:
Expand Down
9 changes: 4 additions & 5 deletions .azure-pipelines/templates/windows-build-and-unit-test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
steps:

- task: NuGetToolInstaller@0
inputs:
versionSpec: '>=5.1'

- task: UseDotNet@2
displayName: Use .NET Core SDK 3.0.100
inputs:
Expand All @@ -10,11 +14,6 @@ steps:
displayName: Delete previous build outputs
continueOnError: true

- powershell: |
& 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\sn.exe' -Vr *,31bf3856ad364e35
& 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\sn.exe' -Vr *,31bf3856ad364e35
displayName: Disable strong name validation for MS delay-signed assemblies
- script: $(Build.Repository.LocalPath)\Scripts\BuildScalarForWindows.bat $(configuration) $(majorAndMinorVersion).$(revision)
displayName: Build Scalar ($(configuration))

Expand Down
4 changes: 4 additions & 0 deletions .azure-pipelines/templates/windows-functional-test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
steps:

- task: NuGetToolInstaller@0
inputs:
versionSpec: '>=5.1'

- task: UseDotNet@2
displayName: Use .NET Core SDK 3.0.100
inputs:
Expand Down
5 changes: 4 additions & 1 deletion Scripts/BuildScalarForWindows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ CALL %~dp0\InitializeEnvironment.bat || EXIT /b 10
IF "%1"=="" (SET "Configuration=Debug") ELSE (SET "Configuration=%1")
IF "%2"=="" (SET "ScalarVersion=0.2.173.2") ELSE (SET "ScalarVersion=%2")

dotnet publish %SCALAR_SRCDIR%\Scalar.sln -p:ScalarVersion=%ScalarVersion% --configuration %Configuration% --runtime win-x64 || exit /b 1
REM Restore using the NuGet CLI rather than the dotnet CLI to workaround a bug
REM in the version of NuGet included with the dotnet CLI (https://github.com/NuGet/Home/issues/8692)
nuget restore %SCALAR_SRCDIR%\Scalar.sln || exit /b 1
dotnet publish --no-restore %SCALAR_SRCDIR%\Scalar.sln -p:ScalarVersion=%ScalarVersion% --configuration %Configuration% --runtime win-x64 || exit /b 1

ENDLOCAL

0 comments on commit ad94ae4

Please sign in to comment.