Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ick, I can see how that would be a problem.

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'"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes more sense to me 👍

Inputs="@(RefPackContent)"
Outputs="@(RefPackContent->'$(LocalInstallationOutputPath)%(PackagePath)%(RecursiveDir)%(FileName)%(Extension)')">
<RemoveDir Directories="$(LocalInstallationOutputPath)" />
Expand Down