|
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)" />
|
|
27 | 35 | <UsingTask TaskName="ZipFileCreateFromDirectory" AssemblyFile="$(ToolsetTaskDll)"/>
|
28 | 36 | <UsingTask TaskName="OverrideAndCreateBundledNETCoreAppPackageVersion" AssemblyFile="$(ToolsetTaskDll)"/>
|
29 | 37 |
|
| 38 | + <Target Name="PatchRuntimeConfig" AfterTargets="GenerateBuildRuntimeConfigurationFiles" |
| 39 | + Condition="'$(MSBuildProjectName)' != 'toolset-tasks' And '$(MSBuildProjectName)' != 'HelixTasks' And Exists($(ProjectRuntimeConfigFilePath))"> |
| 40 | + |
| 41 | + <!-- Currently, GenerateRuntimeConfigurationFiles omits the reference to Microsoft.NETCore.App from the runtimeconfig file when there is a different |
| 42 | + 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 |
| 43 | + instead of the version specified in Versions.props. This can cause failures when there are changes to the base framework, as we compile against |
| 44 | + the one specified in Versions.props, but the project runs against an earlier version. |
| 45 | + |
| 46 | + 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. --> |
| 47 | + |
| 48 | + <AddBaseFrameworkToRuntimeConfig RuntimeConfigPath="$(ProjectRuntimeConfigFilePath)" MicrosoftNetCoreAppVersion="$(VSRedistCommonNetCoreSharedFrameworkx6460PackageVersion)" /> |
| 49 | + |
| 50 | + </Target> |
| 51 | + |
30 | 52 | </Project>
|
0 commit comments