Skip to content
代码片段 群组 项目
未验证 提交 78647716 编辑于 作者: Doug Bunting's avatar Doug Bunting 提交者: GitHub
浏览文件

[release/6.0] Clear layout directories before copies (#37119)

- backport of #36719

Clear layout directories before copies (#36719)

  - `<Copy />` task (well, most tasks though not `tar` commands) will create directories
  - avoid leftover files from a previous build
  - avoid confusing SDK with an empty targeting pack directory
    - prevented ASP.NET targeting pack download when not building it (see #36718)
上级 24981d7d
No related branches found
No related tags found
无相关合并请求
...@@ -204,21 +204,19 @@ This package is an internal implementation of the .NET Core SDK and is not meant ...@@ -204,21 +204,19 @@ This package is an internal implementation of the .NET Core SDK and is not meant
DependsOnTargets="_ResolveTargetingPackContent" DependsOnTargets="_ResolveTargetingPackContent"
Inputs="@(RefPackContent)" Inputs="@(RefPackContent)"
Outputs="@(RefPackContent->'$(LayoutTargetDir)%(PackagePath)%(RecursiveDir)%(FileName)%(Extension)')"> Outputs="@(RefPackContent->'$(LayoutTargetDir)%(PackagePath)%(RecursiveDir)%(FileName)%(Extension)')">
<RemoveDir Directories="$(TargetingPackLayoutRoot)" />
<Copy SourceFiles="@(RefPackContent)" <Copy SourceFiles="@(RefPackContent)"
DestinationFiles="@(RefPackContent->'$(LayoutTargetDir)%(PackagePath)%(RecursiveDir)%(FileName)%(Extension)')" DestinationFiles="@(RefPackContent->'$(LayoutTargetDir)%(PackagePath)%(RecursiveDir)%(FileName)%(Extension)')"
UseHardlinksIfPossible="true" /> UseHardlinksIfPossible="true" />
<Message Importance="High" Text="$(MSBuildProjectName) -> $(LayoutTargetDir)" /> <Message Importance="High" Text="$(MSBuildProjectName) -> $(LayoutTargetDir)" />
</Target> </Target>
<ItemGroup>
<CreateDirectory Include="$(LocalInstallationOutputPath)" />
</ItemGroup>
<!-- Workaround https://github.com/dotnet/sdk/issues/2910 by copying targeting pack into local installation. --> <!-- Workaround https://github.com/dotnet/sdk/issues/2910 by copying targeting pack into local installation. -->
<Target Name="_InstallTargetingPackIntoLocalDotNet" <Target Name="_InstallTargetingPackIntoLocalDotNet"
DependsOnTargets="_ResolveTargetingPackContent" DependsOnTargets="_ResolveTargetingPackContent"
Inputs="@(RefPackContent)" Inputs="@(RefPackContent)"
Outputs="@(RefPackContent->'$(LocalInstallationOutputPath)%(PackagePath)%(RecursiveDir)%(FileName)%(Extension)')"> Outputs="@(RefPackContent->'$(LocalInstallationOutputPath)%(PackagePath)%(RecursiveDir)%(FileName)%(Extension)')">
<RemoveDir Directories="$(LocalInstallationOutputPath)" />
<Copy SourceFiles="@(RefPackContent)" <Copy SourceFiles="@(RefPackContent)"
DestinationFiles="@(RefPackContent->'$(LocalInstallationOutputPath)%(PackagePath)%(RecursiveDir)%(FileName)%(Extension)')" DestinationFiles="@(RefPackContent->'$(LocalInstallationOutputPath)%(PackagePath)%(RecursiveDir)%(FileName)%(Extension)')"
UseHardlinksIfPossible="true" /> UseHardlinksIfPossible="true" />
......
...@@ -341,14 +341,6 @@ This package is an internal implementation of the .NET Core SDK and is not meant ...@@ -341,14 +341,6 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<CrossgenPlatformAssembliesDir>$(IntermediateOutputPath)platformAssemblies\</CrossgenPlatformAssembliesDir> <CrossgenPlatformAssembliesDir>$(IntermediateOutputPath)platformAssemblies\</CrossgenPlatformAssembliesDir>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<CreateDirectory Include="$(CrossgenToolDir)" />
<CreateDirectory Include="$(CrossgenPlatformAssembliesDir)" />
<CreateDirectory Include="$(SharedFxLayoutTargetDir)" />
<CreateDirectory Include="$(RedistLayoutTargetDir)" />
<CreateDirectory Include="$(LocalInstallationOutputPath)" />
</ItemGroup>
<Target Name="Crossgen" DependsOnTargets="$(CrossgenDependsOn)" /> <Target Name="Crossgen" DependsOnTargets="$(CrossgenDependsOn)" />
<Target Name="_ExpandRuntimePackageRoot"> <Target Name="_ExpandRuntimePackageRoot">
...@@ -378,6 +370,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant ...@@ -378,6 +370,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
Condition="'$(CrossgenOutput)' == 'true'" Condition="'$(CrossgenOutput)' == 'true'"
DependsOnTargets="_ExpandRuntimePackageRoot"> DependsOnTargets="_ExpandRuntimePackageRoot">
<!-- The output directories of assemblies built in this repo contain a mix of ref and impl assemblies. Copy impl assemblies to a separate directory. --> <!-- The output directories of assemblies built in this repo contain a mix of ref and impl assemblies. Copy impl assemblies to a separate directory. -->
<RemoveDir Directories="$(CrossgenPlatformAssembliesDir)" />
<Copy SourceFiles="@(ReferenceCopyLocalPaths)" DestinationFolder="$(CrossgenPlatformAssembliesDir)" Condition="'%(ReferenceCopyLocalPaths.ProjectPath)' != ''"/> <Copy SourceFiles="@(ReferenceCopyLocalPaths)" DestinationFolder="$(CrossgenPlatformAssembliesDir)" Condition="'%(ReferenceCopyLocalPaths.ProjectPath)' != ''"/>
<!-- Resolve list of assemblies to crossgen2 --> <!-- Resolve list of assemblies to crossgen2 -->
...@@ -410,6 +403,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant ...@@ -410,6 +403,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<CrossgenSymbolsTargetDir Condition="HasTrailingSlash($(CrossgenSymbolsTargetDir)) AND '$(OS)' == 'Windows_NT'">$(TargetDir)\</CrossgenSymbolsTargetDir> <CrossgenSymbolsTargetDir Condition="HasTrailingSlash($(CrossgenSymbolsTargetDir)) AND '$(OS)' == 'Windows_NT'">$(TargetDir)\</CrossgenSymbolsTargetDir>
</PropertyGroup> </PropertyGroup>
<RemoveDir Directories="$(CrossgenToolDir)" />
<WriteLinesToFile <WriteLinesToFile
Lines="@(Crossgen2PlatformAssemblyPaths)" Lines="@(Crossgen2PlatformAssemblyPaths)"
File="$(CrossgenToolDir)PlatformAssembliesPathsCrossgen2.rsp" File="$(CrossgenToolDir)PlatformAssembliesPathsCrossgen2.rsp"
...@@ -466,6 +460,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant ...@@ -466,6 +460,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant
PrivateUri="$(DotNetRuntimePrivateDownloadUrl)" PrivateUri="$(DotNetRuntimePrivateDownloadUrl)"
PrivateUriSuffix="$(DotNetAssetRootAccessTokenSuffix)" PrivateUriSuffix="$(DotNetAssetRootAccessTokenSuffix)"
DestinationPath="$(DotNetRuntimeArchive)" /> DestinationPath="$(DotNetRuntimeArchive)" />
<RemoveDir Directories="$(RedistSharedFrameworkLayoutRoot)" />
<MakeDir Directories="$(RedistSharedFrameworkLayoutRoot)" />
<!-- Extract the dotnet-runtime archive --> <!-- Extract the dotnet-runtime archive -->
<Exec Condition="'$(ArchiveExtension)' == '.tar.gz'" <Exec Condition="'$(ArchiveExtension)' == '.tar.gz'"
...@@ -492,7 +488,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant ...@@ -492,7 +488,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
DependsOnTargets="_ResolveSharedFrameworkContent" DependsOnTargets="_ResolveSharedFrameworkContent"
Inputs="@(SharedFxContent)" Inputs="@(SharedFxContent)"
Outputs="@(SharedFxContent->'$(SharedFxLayoutTargetDir)%(FileName)%(Extension)')"> Outputs="@(SharedFxContent->'$(SharedFxLayoutTargetDir)%(FileName)%(Extension)')">
<RemoveDir Directories="$(SharedFrameworkLayoutRoot)" />
<Copy SourceFiles="@(SharedFxContent)" <Copy SourceFiles="@(SharedFxContent)"
DestinationFiles="@(SharedFxContent->'$(SharedFxLayoutTargetDir)%(FileName)%(Extension)')" DestinationFiles="@(SharedFxContent->'$(SharedFxLayoutTargetDir)%(FileName)%(Extension)')"
UseHardlinksIfPossible="true" /> UseHardlinksIfPossible="true" />
...@@ -504,7 +500,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant ...@@ -504,7 +500,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
DependsOnTargets="_ResolveSharedFrameworkContent" DependsOnTargets="_ResolveSharedFrameworkContent"
Inputs="@(SharedFxContent)" Inputs="@(SharedFxContent)"
Outputs="@(SharedFxContent->'$(RedistLayoutTargetDir)%(FileName)%(Extension)')"> Outputs="@(SharedFxContent->'$(RedistLayoutTargetDir)%(FileName)%(Extension)')">
<RemoveDir Directories="$(RedistLayoutTargetDir)" />
<Copy SourceFiles="@(SharedFxContent)" <Copy SourceFiles="@(SharedFxContent)"
DestinationFiles="@(SharedFxContent->'$(RedistLayoutTargetDir)%(FileName)%(Extension)')" DestinationFiles="@(SharedFxContent->'$(RedistLayoutTargetDir)%(FileName)%(Extension)')"
UseHardlinksIfPossible="true" /> UseHardlinksIfPossible="true" />
...@@ -518,7 +514,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant ...@@ -518,7 +514,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
Condition="'$(DotNetBuildFromSource)' != 'true'" Condition="'$(DotNetBuildFromSource)' != 'true'"
Inputs="@(SharedFxContent)" Inputs="@(SharedFxContent)"
Outputs="@(SharedFxContent->'$(LocalInstallationOutputPath)%(FileName)%(Extension)')"> Outputs="@(SharedFxContent->'$(LocalInstallationOutputPath)%(FileName)%(Extension)')">
<RemoveDir Directories="$(LocalInstallationOutputPath)" />
<Copy SourceFiles="@(SharedFxContent)" <Copy SourceFiles="@(SharedFxContent)"
DestinationFiles="@(SharedFxContent->'$(LocalInstallationOutputPath)%(FileName)%(Extension)')" DestinationFiles="@(SharedFxContent->'$(LocalInstallationOutputPath)%(FileName)%(Extension)')"
UseHardlinksIfPossible="true" /> UseHardlinksIfPossible="true" />
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册