Skip to content

Commit c9af2e8

Browse files
wtgodbeSteveSandersonMS
authored andcommitted
Work around dotnet tool restore issue
1 parent e52473e commit c9af2e8

7 files changed

+82
-35
lines changed

eng/Tools.props

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
<PackageReference Include="Yarn.MSBuild" Version="1.22.10" />
1111
</ItemGroup>
1212

13+
<PropertyGroup>
14+
<AspnetTempConfigPath>$([MSBuild]::NormalizePath('$(RepoRoot)', '.tempconfig'))</AspnetTempConfigPath>
15+
</PropertyGroup>
16+
1317
<!-- Update the generated files when we restore projects. Skip in desktop msbuild due to VS 16.8 requirements. -->
1418
<Target Name="GenerateDirectoryBuildFiles"
1519
AfterTargets="Restore"
@@ -22,4 +26,14 @@
2226
RemoveProperties="BaseIntermediateOutputPath;ExcludeRestorePackageImports"
2327
Targets="GenerateDirectoryBuildFiles" />
2428
</Target>
25-
</Project>
29+
30+
<Target Name="RestoreAspnetRepoTools"
31+
Condition="'$(DotNetBuildFromSource)' != 'true' and Exists('$(AspnetTempConfigPath)')"
32+
BeforeTargets="Restore">
33+
34+
<Exec Command='"$(DotNetTool)" tool restore' WorkingDirectory="$([MSBuild]::NormalizePath('$(AspnetTempConfigPath)', 'dotnet-dump'))" />
35+
<Exec Command='"$(DotNetTool)" tool restore' WorkingDirectory="$([MSBuild]::NormalizePath('$(AspnetTempConfigPath)', 'dotnet-serve'))" />
36+
<Exec Command='"$(DotNetTool)" tool restore' WorkingDirectory="$([MSBuild]::NormalizePath('$(AspnetTempConfigPath)', 'dotnet-ef'))" />
37+
<Exec Command='"$(DotNetTool)" tool restore' WorkingDirectory="$([MSBuild]::NormalizePath('$(AspnetTempConfigPath)', 'Microsoft.Playwright.CLI'))" />
38+
</Target>
39+
</Project>

eng/tools/GenerateFiles/GenerateFiles.csproj

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFramework>net5.0</TargetFramework>
55
<ExcludeFromSourceBuild>false</ExcludeFromSourceBuild>
66

7-
<ConfigDirectory>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', '.config'))</ConfigDirectory>
7+
<ConfigDirectory>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', '.tempconfig'))</ConfigDirectory>
88
</PropertyGroup>
99

1010
<ItemGroup>
@@ -43,9 +43,24 @@
4343
Properties="$(_TemplateProperties)"
4444
OutputPath="$(BaseOutputPath)Directory.Build.targets" />
4545

46-
<Message Importance="High" Text="$(MSBuildProjectName) -&gt; $(ConfigDirectory)dotnet-tools.json" />
47-
<GenerateFileFromTemplate TemplateFile="$(MSBuildThisFileDirectory)dotnet-tools.json.in"
46+
<Message Importance="High" Text="$(MSBuildProjectName) -&gt; $(ConfigDirectory)dotnet-tools.dotnet-dump.json.in" />
47+
<GenerateFileFromTemplate TemplateFile="$(MSBuildThisFileDirectory)dotnet-tools.dotnet-dump.json.in"
4848
Properties="$(_TemplateProperties)"
49-
OutputPath="$(ConfigDirectory)dotnet-tools.json" />
49+
OutputPath="$(ConfigDirectory)dotnet-dump/dotnet-tools.json" />
50+
51+
<Message Importance="High" Text="$(MSBuildProjectName) -&gt; $(ConfigDirectory)dotnet-tools.dotnet-serve.json.in" />
52+
<GenerateFileFromTemplate TemplateFile="$(MSBuildThisFileDirectory)dotnet-tools.dotnet-serve.json.in"
53+
Properties="$(_TemplateProperties)"
54+
OutputPath="$(ConfigDirectory)dotnet-serve/dotnet-tools.json" />
55+
56+
<Message Importance="High" Text="$(MSBuildProjectName) -&gt; $(ConfigDirectory)dotnet-tools.dotnet-ef.json.in" />
57+
<GenerateFileFromTemplate TemplateFile="$(MSBuildThisFileDirectory)dotnet-tools.dotnet-ef.json.in"
58+
Properties="$(_TemplateProperties)"
59+
OutputPath="$(ConfigDirectory)dotnet-ef/dotnet-tools.json" />
60+
61+
<Message Importance="High" Text="$(MSBuildProjectName) -&gt; $(ConfigDirectory)dotnet-tools.Microsoft.Playwright.CLI.json.in" />
62+
<GenerateFileFromTemplate TemplateFile="$(MSBuildThisFileDirectory)dotnet-tools.Microsoft.Playwright.CLI.json.in"
63+
Properties="$(_TemplateProperties)"
64+
OutputPath="$(ConfigDirectory)Microsoft.Playwright.CLI/dotnet-tools.json" />
5065
</Target>
5166
</Project>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"Microsoft.Playwright.CLI": {
6+
"version": "${MicrosoftPlaywrightCLIVersion}",
7+
"commands": [
8+
"playwright"
9+
]
10+
}
11+
}
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"dotnet-dump": {
6+
"version": "${DotnetDumpVersion}",
7+
"commands": [
8+
"dotnet-dump"
9+
]
10+
}
11+
}
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"dotnet-ef": {
6+
"version": "${DotnetEfVersion}",
7+
"commands": [
8+
"dotnet-ef"
9+
]
10+
}
11+
}
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"dotnet-serve": {
6+
"version": "${DotnetServeVersion}",
7+
"commands": [
8+
"dotnet-serve"
9+
]
10+
}
11+
}
12+
}

eng/tools/GenerateFiles/dotnet-tools.json.in

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)