Skip to content

Commit

Permalink
Fix AppHost pack prebuilt usage in source-build (#37672)
Browse files Browse the repository at this point in the history
  • Loading branch information
dagood authored Oct 21, 2021
1 parent 88c720f commit 2984e3b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,18 @@
<!-- The location of the local installation of the .NET Core shared framework. -->
<PropertyGroup>
<LocalDotNetRoot>$(RepoRoot).dotnet\</LocalDotNetRoot>
<!-- Override the SDK default and point to local .dotnet folder. -->
<NetCoreTargetingPackRoot>$(LocalDotNetRoot)packs\</NetCoreTargetingPackRoot>
<!--
Override the SDK default and point to local .dotnet folder. This is done to work around
limitations in the way the .NET SDK finds shared frameworks and targeting packs. It allows
tests to use the shared frameworks and targeting packs that were just built.
However, source-build needs this to not happen while building projects that rely on the
AppHost framework pack. Source-build installs an SDK in a custom location outside this
repository, and setting NetCoreTargetingPackRoot to a different location causes source-build
to restore the AppHost pack as a prebuilt rather than using the one that's present in the SDK.
Source-build doesn't run tests, so the property is simply conditioned out.
-->
<NetCoreTargetingPackRoot Condition="'$(DotNetBuildFromSource)' != 'true'">$(LocalDotNetRoot)packs\</NetCoreTargetingPackRoot>
</PropertyGroup>

<Import Project="eng\tools\RepoTasks\RepoTasks.tasks" Condition="'$(MSBuildProjectName)' != 'RepoTasks' AND '$(DesignTimeBuild)' != 'true'" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<!-- Workaround https://github.com/dotnet/sdk/issues/2910 by copying targeting pack into local installation. -->
<Target Name="_InstallTargetingPackIntoLocalDotNet"
DependsOnTargets="_ResolveTargetingPackContent"
Condition="'$(DotNetBuildFromSource)' != 'true'"
Inputs="@(RefPackContent)"
Outputs="@(RefPackContent->'$(LocalInstallationOutputPath)%(PackagePath)%(RecursiveDir)%(FileName)%(Extension)')">
<RemoveDir Directories="$(LocalInstallationOutputPath)" />
Expand Down

0 comments on commit 2984e3b

Please sign in to comment.