|
4 | 4 | <TaskTargetFramework>$(SdkTargetFramework)</TaskTargetFramework> |
5 | 5 | <TaskTargetFramework Condition="'$(MSBuildRuntimeType)' != 'Core'">net472</TaskTargetFramework> |
6 | 6 |
|
7 | | - <ToolsetTaskDll>$(ArtifactsDir)tasks\bin\toolset-tasks\$(Configuration)\$(TaskTargetFramework)\toolset-tasks.dll</ToolsetTaskDll> |
| 7 | + <!--<ToolsetTaskDll>$(ArtifactsDir)tasks\bin\toolset-tasks\$(Configuration)\$(TaskTargetFramework)\toolset-tasks.dll</ToolsetTaskDll>--> |
| 8 | + <ToolsetTaskDll>$(ArtifactsDir)bin\toolset-tasks\$(Configuration)\$(TaskTargetFramework)\toolset-tasks.dll</ToolsetTaskDll> |
8 | 9 | <ToolsetTaskProject>$(RepoRoot)src\Layout\toolset-tasks\toolset-tasks.csproj</ToolsetTaskProject> |
9 | 10 | </PropertyGroup> |
10 | | - <Target Name="BuildCoreSdkTasks" BeforeTargets="_CheckForInvalidConfigurationAndPlatform"> |
11 | | - <!-- Use a different ArtifactsDir for this invocation so that the tasks project can be part of the solution |
12 | | - (for easy editing), but we don't hit problems with the tasks DLL being locked when we try to build the solution. --> |
| 11 | + |
| 12 | + <!-- Right now we're using these tasks in all projects, so we build with a ProjectReference. Once https://github.com/dotnet/sdk/pull/17982 |
| 13 | + is merged and flows through to stage 0, we can delete the PatchRuntimeConfig target and go back to the way it was. --> |
| 14 | + <ItemGroup> |
| 15 | + <ProjectReference Include="$(ToolsetTaskProject)" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" SetTargetFramework="TargetFramework=$(TaskTargetFramework)" /> |
| 16 | + </ItemGroup> |
| 17 | + |
| 18 | + <!--<Target Name="BuildCoreSdkTasks" BeforeTargets="_CheckForInvalidConfigurationAndPlatform"> |
| 19 | + --><!-- Use a different ArtifactsDir for this invocation so that the tasks project can be part of the solution |
| 20 | + (for easy editing), but we don't hit problems with the tasks DLL being locked when we try to build the solution. --><!-- |
13 | 21 |
|
14 | 22 | <MSBuild Projects="$(ToolsetTaskProject)" |
15 | 23 | Properties="ArtifactsDir=$(ArtifactsDir)tasks\;Phase=Restore" |
16 | 24 | Targets="Restore"/> |
17 | 25 |
|
18 | 26 | <MSBuild Projects="$(ToolsetTaskProject)" |
19 | 27 | Properties="ArtifactsDir=$(ArtifactsDir)tasks\"/> |
20 | | - </Target> |
| 28 | + </Target>--> |
21 | 29 |
|
22 | 30 | <UsingTask TaskName="ReplaceFileContents" AssemblyFile="$(ToolsetTaskDll)" /> |
23 | 31 | <UsingTask TaskName="Chmod" AssemblyFile="$(ToolsetTaskDll)" /> |
|
26 | 34 | <UsingTask TaskName="GetCurrentRuntimeInformation" AssemblyFile="$(ToolsetTaskDll)"/> |
27 | 35 | <UsingTask TaskName="ZipFileCreateFromDirectory" AssemblyFile="$(ToolsetTaskDll)"/> |
28 | 36 | <UsingTask TaskName="OverrideAndCreateBundledNETCoreAppPackageVersion" AssemblyFile="$(ToolsetTaskDll)"/> |
| 37 | + <UsingTask TaskName="AddBaseFrameworkToRuntimeConfig" AssemblyFile="$(ToolsetTaskDll)"/> |
| 38 | + |
| 39 | + <Target Name="PatchRuntimeConfig" AfterTargets="GenerateBuildRuntimeConfigurationFiles" |
| 40 | + Condition="'$(MSBuildProjectName)' != 'toolset-tasks' And '$(MSBuildProjectName)' != 'HelixTasks' And Exists($(ProjectRuntimeConfigFilePath))"> |
| 41 | + |
| 42 | + <!-- Currently, GenerateRuntimeConfigurationFiles omits the reference to Microsoft.NETCore.App from the runtimeconfig file when there is a different |
| 43 | + shared framework. In this repo, this can cause the tests or tools such as dotnet-watch to use the stage 0 version of Microsoft.NETCore.App |
| 44 | + instead of the version specified in Versions.props. This can cause failures when there are changes to the base framework, as we compile against |
| 45 | + the one specified in Versions.props, but the project runs against an earlier version. |
| 46 | + |
| 47 | + This task works around this by adding Microsoft.NETCore.App back to the list of runtimes in the runtimeconfig file if it's not there already. --> |
| 48 | + |
| 49 | + <AddBaseFrameworkToRuntimeConfig RuntimeConfigPath="$(ProjectRuntimeConfigFilePath)" MicrosoftNetCoreAppVersion="$(VSRedistCommonNetCoreSharedFrameworkx6460PackageVersion)" /> |
| 50 | + |
| 51 | + </Target> |
29 | 52 |
|
30 | 53 | </Project> |
0 commit comments