Skip to content

Commit

Permalink
Remove old TFMs from Artifacts SDK (#484)
Browse files Browse the repository at this point in the history
* Remove old TFMs from Artifacts SDK
* Rev major version
  • Loading branch information
AndyGerlicher authored Sep 25, 2023
1 parent 9fd9bb5 commit d69f3bf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 24 deletions.
24 changes: 9 additions & 15 deletions src/Artifacts/Microsoft.Build.Artifacts.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net46;net472;netstandard2.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<BuildOutputTargetFolder>build\</BuildOutputTargetFolder>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>Build logic for staging artifacts from build outputs.</Description>
Expand All @@ -10,10 +10,9 @@
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);GetMyPackageFiles</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CopyOnWrite" GeneratePathProperty="True" PrivateAssets="All" Condition="'$(TargetFramework)' != 'net46'" />
<PackageReference Include="CopyOnWrite" GeneratePathProperty="True" PrivateAssets="All" />
<PackageReference Include="Microsoft.Build.Utilities.Core" ExcludeAssets="Runtime" PrivateAssets="All" />
<PackageReference Include="System.Threading.Tasks.Dataflow" />
</ItemGroup>
Expand All @@ -28,18 +27,6 @@
<FilesToSign Include="$(TargetPath)" Authenticode="Microsoft400" StrongName="StrongName" />
</ItemGroup>
<Target Name="SignNuGetPackage" />
<Target Name="GetMyPackageFiles" DependsOnTargets="ResolveProjectReferences" Condition=" '$(TargetFramework)' != 'net46' ">
<PropertyGroup>
<CoWFramework Condition=" '$(TargetFramework)' == 'net472' or '$(TargetFramework)' == 'netstandard2.0' ">netstandard2.0</CoWFramework>
<CoWFramework Condition=" '$(TargetFramework)' == 'net6.0' ">net6.0</CoWFramework>
</PropertyGroup>

<ItemGroup>
<TfmSpecificPackageFile Include="$(PkgCopyOnWrite)\lib\$(CoWFramework)\CopyOnWrite.dll"
Pack="true"
PackagePath="\build\$(TargetFramework)" />
</ItemGroup>
</Target>
<Target Name="CopyArtifacts"
AfterTargets="Pack"
DependsOnTargets="SignNuGetPackage"
Expand All @@ -53,4 +40,11 @@
SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" />
</Target>

<Target Name="IncludeReferenceCopyLocalPathsInBuildOutputInPackage" BeforeTargets="_GetBuildOutputFilesWithTfm" DependsOnTargets="ResolveReferences;ResolvePackageDependenciesForBuild">
<ItemGroup>
<BuildOutputInPackage Include="@(RuntimeCopyLocalItems-&gt;WithMetadataValue('AssetType', 'runtime'))" TargetPath="%(RuntimeCopyLocalItems.DestinationSubDirectory)%(Filename)%(Extension)" />
<BuildOutputInPackage Include="@(RuntimeCopyLocalItems-&gt;WithMetadataValue('CopyLocal', 'true'))" TargetPath="%(RuntimeCopyLocalItems.DestinationSubDirectory)%(Filename)%(Extension)" />
</ItemGroup>
</Target>
</Project>
9 changes: 1 addition & 8 deletions src/Artifacts/build/Microsoft.Build.Artifacts.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,7 @@
</PropertyGroup>

<UsingTask TaskName="Robocopy"
AssemblyFile="$([MSBuild]::ValueOrDefault('$(ArtifactsTaskAssembly)', '$(MSBuildThisFileDirectory)net46\Microsoft.Build.Artifacts.dll'))"
Condition="'$(MSBuildRuntimeType)' != 'Core' And '$(MSBuildVersion)' &lt; '16.0'" />
<UsingTask TaskName="Robocopy"
AssemblyFile="$([MSBuild]::ValueOrDefault('$(ArtifactsTaskAssembly)', '$(MSBuildThisFileDirectory)net472\Microsoft.Build.Artifacts.dll'))"
Condition="'$(MSBuildRuntimeType)' != 'Core' And '$(MSBuildVersion)' &gt;= '16.0'" />
<UsingTask TaskName="Robocopy"
AssemblyFile="$([MSBuild]::ValueOrDefault('$(ArtifactsTaskAssembly)', '$(MSBuildThisFileDirectory)netstandard2.0\Microsoft.Build.Artifacts.dll'))"
Condition="'$(MSBuildRuntimeType)' == 'Core'" />
AssemblyFile="$([MSBuild]::ValueOrDefault('$(ArtifactsTaskAssembly)', '$(MSBuildThisFileDirectory)netstandard2.0\Microsoft.Build.Artifacts.dll'))" />

<ItemDefinitionGroup>
<Robocopy>
Expand Down
2 changes: 1 addition & 1 deletion src/Artifacts/version.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"inherit": true,
"version": "5.0"
"version": "6.0"
}

0 comments on commit d69f3bf

Please sign in to comment.