Skip to content

Commit

Permalink
Fixes and more assemblies on publish exclude list
Browse files Browse the repository at this point in the history
  • Loading branch information
ViktorHofer committed May 19, 2023
1 parent 7ffa8a4 commit 0a855a2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
31 changes: 20 additions & 11 deletions eng/BuildTask.targets
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project>

<PropertyGroup>
<IncludeBuildOutput>false</IncludeBuildOutput>
<IsPackable>true</IsPackable>
Expand Down Expand Up @@ -32,15 +33,11 @@
<PackageReference Update="Microsoft.Build.Framework" Publish="false" />
<PackageReference Update="Microsoft.Build.Tasks.Core" Publish="false" />
<PackageReference Update="Microsoft.Build.Utilities.Core" Publish="false" />
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Publish="false" />
<PackageReference Update="Microsoft.CodeAnalysis.CSharp.Scripting" Publish="false" />
<PackageReference Update="Microsoft.CodeAnalysis" Publish="false" />
<PackageReference Update="Microsoft.CodeAnalysis.Scripting" Publish="false" />
<PackageReference Update="Microsoft.CodeAnalysis.VisualBasic" Publish="false" />
<PackageReference Update="Microsoft.NET.StringTools" Publish="false" />
<PackageReference Update="System.Collections.Immutable" Publish="false" />
</ItemGroup>

<!-- Don't include assemblies that are inbox in the SDK. -->
<!-- Don't include assemblies that are provided by the SDK, next to MSBuild. -->
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<PackageReference Update="Newtonsoft.Json" Publish="false" />
<PackageReference Update="NuGet.Commands" Publish="false" />
Expand All @@ -52,19 +49,30 @@
<PackageReference Update="NuGet.Versioning" Publish="false" />
</ItemGroup>

<!-- Don't include assemblies that are inbox in Desktop MSBuild -->
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<PackageReference Update="System.Buffers" Publish="false" />
<PackageReference Update="System.Memory" Publish="false" />
<PackageReference Update="System.Numerics.Vectors" Publish="false" />
<PackageReference Update="System.Reflection.Metadata" Publish="false" />
<PackageReference Update="System.Reflection.MetadataLoadContext" Publish="false" />
<PackageReference Update="System.Runtime.CompilerServices.Unsafe" Publish="false" />
<PackageReference Update="System.Text.Encodings.Web" Publish="false" />
<PackageReference Update="System.Text.Json" Publish="false" />
<PackageReference Update="System.Threading.Tasks.Dataflow" Publish="false" />
<PackageReference Update="System.Threading.Tasks.Extensions" Publish="false" />
<PackageReference Update="System.ValueTuple" Publish="false" />
</ItemGroup>

<ItemGroup>
<!--
Update all PackageReference and ProjectReference Items to
default Publish to true.
Update all PackageReference items to default Publish to true.
This forces the publish output to contain the dlls.
-->
<PackageReference Update="@(PackageReference)">
<Publish Condition="'%(PackageReference.Publish)' == ''">true</Publish>
<ExcludeAssets Condition="'%(PackageReference.Publish)' == 'false'">runtime</ExcludeAssets>
</PackageReference>
<ProjectReference Update="@(ProjectReference)">
<Publish Condition="'%(ProjectReference.Publish)' == ''">true</Publish>
</ProjectReference>

<!--
Update all Reference items to have Pack="false"
Expand Down Expand Up @@ -92,4 +100,5 @@
<TfmSpecificPackageFile Include="$(OutputPath)**" PackagePath="$(BuildTaskTargetFolder)/$(TargetFramework)/%(RecursiveDir)%(FileName)%(Extension)"/>
</ItemGroup>
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
<PackageReference Include="Microsoft.Signed.Wix" Version="$(MicrosoftSignedWixVersion)" />
</ItemGroup>

<!-- The tests reference the MSBuild task assembly directly and therefore we need to add references that would normally be provided by MSBuild. -->
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<PackageReference Include="NuGet.Packaging" Version="$(NuGetPackagingVersion)" />
</ItemGroup>

<!-- Sample packages -->
<ItemGroup>
<PackageDownload Include="Microsoft.Signed.Wix" Version="[$(MicrosoftSignedWixVersion)]" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
<PackageReference Include="NuGet.Frameworks" Version="$(NuGetFrameworksVersion)" />
</ItemGroup>

<!-- The tests reference the MSBuild task assembly directly and therefore we need to add references that would normally be provided by MSBuild. -->
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<PackageReference Include="NuGet.Packaging" Version="$(NuGetPackagingVersion)" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Microsoft.DotNet.PackageTesting\Microsoft.DotNet.PackageTesting.csproj" />
</ItemGroup>
Expand Down

0 comments on commit 0a855a2

Please sign in to comment.