@@ -6,12 +6,18 @@ parameters:
6
6
javaSdkRoot : $(Agent.ToolsDirectory)\jdk11
7
7
8
8
steps :
9
- # before the build starts, make sure the tooling is as expected
9
+ # before the build starts, make sure the tooling is as expected. Clear the cache on shared agents
10
+ - script : |
11
+ dotnet build-server shutdown
12
+ rm -rf $(Agent.ToolsDirectory)/dotnet
13
+ displayName: Remove dotnet cache
14
+ workingDirectory: $(Pipeline.Workspace)
15
+ condition: eq(variables['Agent.OS'], 'Darwin')
16
+
10
17
- task : UseDotNet@2
11
18
displayName : ' Use dotnet $(dotnetVersion)'
12
19
inputs :
13
20
version : $(dotnetVersion)
14
- performMultiLevelLookup : true
15
21
includePreviewVersions : true
16
22
condition : ne('$(dotnetVersion)', '')
17
23
@@ -20,13 +26,25 @@ steps:
20
26
displayName : ' Use dotnet $(dotnetNextVersion)'
21
27
inputs :
22
28
version : $(dotnetNextVersion)
23
- performMultiLevelLookup : true
24
29
includePreviewVersions : true
25
-
30
+
31
+ - script : dotnet --info
32
+ displayName : Display dotnet info
33
+
26
34
- ${{ each tool in parameters.dotnetTools }} :
27
35
- ${{ each pair in tool }} :
28
- - pwsh : dotnet tool update -g ${{ pair.key }} --version ${{ pair.value }} --verbosity:diagnostic
29
- displayName : ' Install tool: ${{ pair.key }}'
36
+ - powershell : dotnet tool uninstall ${{ pair.key }} -g
37
+ displayName : ' Uninstall tool: ${{ pair.key }}'
38
+ ignoreLASTEXITCODE : true
39
+ - task : DotNetCoreCLI@2
40
+ displayName : ' Install tool: ${{ pair.key }} ${{ pair.value }}'
41
+ inputs :
42
+ command : custom
43
+ custom : tool
44
+ arguments : >-
45
+ update -g ${{ pair.key }} -v:diag
46
+ --version ${{ pair.value }}
47
+ --add-source "https://api.nuget.org/v3/index.json"
30
48
31
49
- ${{ if eq(parameters.runDotnetNextTest, true) }} :
32
50
- pwsh : |
0 commit comments