Skip to content

Commit

Permalink
Ensure contentFiles are unobtrusive in code editors
Browse files Browse the repository at this point in the history
This ensures the instrumentation scripts are not visible users projects when they reference `OpenTelemetry.AutoInstrumentation`.

This makes the manual installation route slightly less unobtrusive as we don't clutter anyones editor with instrumentation.sh and instrumentation.cmd.

These files will still be published to output and publish directories.

The props file is only necessary until NuGet/Home#4856 gets resolved.

See: https://learn.microsoft.com/en-us/nuget/concepts/msbuild-props-and-targets for more background on how $PROJECT.props file affect nuget installations.
  • Loading branch information
Mpdreamz committed Jul 25, 2024
1 parent 6e9ef3c commit 707858b
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Hide the shipped content files VS project tree.
Can be removed once https://github.com/NuGet/Home/issues/4856 is resolved -->
<ItemGroup>
<Content Update="@(Content)">
<Visible Condition="'%(NuGetItemType)' == 'Content' and '%(NuGetPackageId)' == 'opentelemetry.autoinstrumentation'">False</Visible>
<CopyToOutputDirectory Condition="'%(NuGetItemType)' == 'Content' and '%(NuGetPackageId)' == 'opentelemetry.autoinstrumentation'">Always</CopyToOutputDirectory>
<CopyToPublishDirectory Condition="'%(NuGetItemType)' == 'Content' and '%(NuGetPackageId)' == 'opentelemetry.autoinstrumentation'">Always</CopyToPublishDirectory>
</Content>
</ItemGroup>
</Project>

0 comments on commit 707858b

Please sign in to comment.