Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build warnings observed locally #73593

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions eng/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies.net472" Version="1.0.3" />
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies.net461" Version="1.0.3" />
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies.net451" Version="1.0.3" />
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies.net45" Version="1.0.3" />
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies.net40" Version="1.0.3" />
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies.net20" Version="1.0.3" />
<PackageVersion Include="System.Buffers" Version="4.5.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,10 @@

<MSBuild Projects="@(ProjectToPublish)" Targets="Pack" BuildInParallel="true" />
</Target>

<!--
Make sure the _GetPackageFiles target exists, since it is always expected for design time builds, but only
defined when ImportNuGetBuildTasksPackTargetsFromSdk is true.
-->
<Target Name="_GetPackageFiles" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

<_BuildTaskTfm Condition="'$(MSBuildRuntimeType)' != 'Core'">net472</_BuildTaskTfm>
<_BuildTaskTfm Condition="'$(MSBuildRuntimeType)' == 'Core'">$(NetRoslyn)</_BuildTaskTfm>
<_BuildTaskAssemblyFile>$(ArtifactsBinDir)SemanticSearch.BuildTask\$(Configuration)\$(_BuildTaskTfm)\SemanticSearch.BuildTask.dll</_BuildTaskAssemblyFile>
</PropertyGroup>

<ItemGroup>
Expand All @@ -26,7 +27,7 @@
in subsequent builds because the task assembly can't be written by the
next build.
-->
<UsingTask TaskName="Microsoft.CodeAnalysis.Tools.GenerateFilteredReferenceAssembliesTask" AssemblyFile="$(ArtifactsBinDir)SemanticSearch.BuildTask\$(Configuration)\$(_BuildTaskTfm)\SemanticSearch.BuildTask.dll" TaskFactory="TaskHostFactory" />
<UsingTask TaskName="Microsoft.CodeAnalysis.Tools.GenerateFilteredReferenceAssembliesTask" AssemblyFile="$(_BuildTaskAssemblyFile)" TaskFactory="TaskHostFactory" />

<Target Name="_CalculateFilteredReferenceAssembliesInputsAndOutputs" DependsOnTargets="ResolveAssemblyReferences">
<PropertyGroup>
Expand All @@ -49,7 +50,7 @@
</ItemGroup>
</Target>

<Target Name="GenerateFilteredReferenceAssemblies" BeforeTargets="CoreCompile" DependsOnTargets="_CalculateFilteredReferenceAssembliesInputsAndOutputs" Inputs="@(_InputFile)" Outputs="@(_OutputFile)">
<Target Name="GenerateFilteredReferenceAssemblies" Condition="Exists('$(_BuildTaskAssemblyFile)')" BeforeTargets="CoreCompile" DependsOnTargets="_CalculateFilteredReferenceAssembliesInputsAndOutputs" Inputs="@(_InputFile)" Outputs="@(_OutputFile)">

<MakeDir Directories="$(_OutputDir)" />
<Microsoft.CodeAnalysis.Tools.GenerateFilteredReferenceAssembliesTask References="@(_InputReference)" ApiSets="@(ApiSet)" OutputDir="$(_OutputDir)" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<Project Sdk="Microsoft.Build.Traversal">
<PropertyGroup>
<TargetFrameworks>net472</TargetFrameworks>
<TargetFrameworks>net472</TargetFrameworks>
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net45" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need the net45 reference assemblies and not e.g. the net472 ones?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, but this fixes the issue.

</ItemGroup>

<!--
This build project is used to allow CI to only build the projects required to build and run integration tests.
Everything else (for example other unit test projects) are excluded to speed up the build time.
Expand Down
Loading