Skip to content

Commit b78a369

Browse files
authored
[repo] Make InternalsVisibleTo consistent across stable & unstable builds (#5521)
1 parent 562f453 commit b78a369

File tree

8 files changed

+7
-50
lines changed

8 files changed

+7
-50
lines changed

build/Common.prod.props

-4
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@
7272
<DefineConstants>$(DefineConstants);EXPOSE_EXPERIMENTAL_FEATURES</DefineConstants>
7373
</PropertyGroup>
7474

75-
<ItemGroup Condition="'$(ExposeExperimentalFeatures)' != 'true'">
76-
<Compile Remove="@(Compile)" Condition="'%(Compile.RequiresExposedExperimentalFeatures)' == 'true'" />
77-
</ItemGroup>
78-
7975
<!-- Note: This selects the correct PublicApiAnalyzers files based on $(ExposeExperimentalFeatures) -->
8076
<ItemGroup>
8177
<AdditionalFiles Include=".publicApi\Stable\PublicAPI.*.txt" />

src/OpenTelemetry.Api.ProviderBuilderExtensions/AssemblyInfo.cs

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@
44
using System.Runtime.CompilerServices;
55

66
[assembly: InternalsVisibleTo("OpenTelemetry" + AssemblyInfo.PublicKey)]
7-
[assembly: InternalsVisibleTo("OpenTelemetry.Tests" + AssemblyInfo.PublicKey)]
87
[assembly: InternalsVisibleTo("OpenTelemetry.Api.ProviderBuilderExtensions.Tests" + AssemblyInfo.PublicKey)]
9-
10-
#if !EXPOSE_EXPERIMENTAL_FEATURES
118
[assembly: InternalsVisibleTo("OpenTelemetry.Exporter.Console" + AssemblyInfo.PublicKey)]
129
[assembly: InternalsVisibleTo("OpenTelemetry.Exporter.OpenTelemetryProtocol" + AssemblyInfo.PublicKey)]
1310
[assembly: InternalsVisibleTo("OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests" + AssemblyInfo.PublicKey)]
1411
[assembly: InternalsVisibleTo("OpenTelemetry.Extensions.Hosting" + AssemblyInfo.PublicKey)]
15-
#endif
12+
[assembly: InternalsVisibleTo("OpenTelemetry.Tests" + AssemblyInfo.PublicKey)]
1613

1714
#if SIGNED
1815
file static class AssemblyInfo

src/OpenTelemetry.Api/AssemblyInfo.cs

+3-6
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,16 @@
55

66
[assembly: InternalsVisibleTo("OpenTelemetry" + AssemblyInfo.PublicKey)]
77
[assembly: InternalsVisibleTo("OpenTelemetry.Api.ProviderBuilderExtensions" + AssemblyInfo.PublicKey)]
8-
[assembly: InternalsVisibleTo("OpenTelemetry.Api.Tests" + AssemblyInfo.PublicKey)]
9-
[assembly: InternalsVisibleTo("OpenTelemetry.Shims.OpenTracing.Tests" + AssemblyInfo.PublicKey)]
10-
[assembly: InternalsVisibleTo("OpenTelemetry.Tests" + AssemblyInfo.PublicKey)]
11-
12-
#if !EXPOSE_EXPERIMENTAL_FEATURES
138
[assembly: InternalsVisibleTo("OpenTelemetry.Api.ProviderBuilderExtensions.Tests" + AssemblyInfo.PublicKey)]
9+
[assembly: InternalsVisibleTo("OpenTelemetry.Api.Tests" + AssemblyInfo.PublicKey)]
1410
[assembly: InternalsVisibleTo("OpenTelemetry.Exporter.Console" + AssemblyInfo.PublicKey)]
1511
[assembly: InternalsVisibleTo("OpenTelemetry.Exporter.InMemory" + AssemblyInfo.PublicKey)]
1612
[assembly: InternalsVisibleTo("OpenTelemetry.Exporter.OpenTelemetryProtocol" + AssemblyInfo.PublicKey)]
1713
[assembly: InternalsVisibleTo("OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests" + AssemblyInfo.PublicKey)]
1814
[assembly: InternalsVisibleTo("OpenTelemetry.Extensions.Hosting" + AssemblyInfo.PublicKey)]
1915
[assembly: InternalsVisibleTo("OpenTelemetry.Extensions.Hosting.Tests" + AssemblyInfo.PublicKey)]
20-
#endif
16+
[assembly: InternalsVisibleTo("OpenTelemetry.Shims.OpenTracing.Tests" + AssemblyInfo.PublicKey)]
17+
[assembly: InternalsVisibleTo("OpenTelemetry.Tests" + AssemblyInfo.PublicKey)]
2118

2219
#if SIGNED
2320
file static class AssemblyInfo

src/OpenTelemetry.Exporter.Console/OpenTelemetry.Exporter.Console.csproj

-8
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,6 @@
2828
<Compile Include="$(RepoRoot)\src\Shared\PeriodicExportingMetricReaderHelper.cs" Link="Includes\PeriodicExportingMetricReaderHelper.cs" />
2929
<Compile Include="$(RepoRoot)\src\Shared\TagTransformer.cs" Link="Includes\TagTransformer.cs" />
3030
<Compile Include="$(RepoRoot)\src\Shared\TagTransformerJsonHelper.cs" Link="Includes\TagTransformerJsonHelper.cs" />
31-
32-
<!-- Note: When '$(ExposeExperimentalFeatures)' == 'false' these links are
33-
NOT required because this project sees API + SDK internals -->
34-
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" RequiresExposedExperimentalFeatures="true" />
35-
<Compile Include="$(RepoRoot)\src\Shared\DiagnosticDefinitions.cs" Link="Includes\DiagnosticDefinitions.cs" RequiresExposedExperimentalFeatures="true" />
36-
<Compile Include="$(RepoRoot)\src\Shared\ExceptionExtensions.cs" Link="Includes\ExceptionExtensions.cs" RequiresExposedExperimentalFeatures="true" />
37-
<Compile Include="$(RepoRoot)\src\Shared\Shims\NullableAttributes.cs" Link="Includes\Shims\NullableAttributes.cs" RequiresExposedExperimentalFeatures="true" />
38-
<Compile Include="$(RepoRoot)\src\Shared\SpanAttributeConstants.cs" Link="Includes\SpanAttributeConstants.cs" RequiresExposedExperimentalFeatures="true" />
3931
</ItemGroup>
4032

4133
</Project>

src/OpenTelemetry.Exporter.InMemory/OpenTelemetry.Exporter.InMemory.csproj

-5
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@
2020

2121
<ItemGroup>
2222
<Compile Include="$(RepoRoot)\src\Shared\PeriodicExportingMetricReaderHelper.cs" Link="Includes\PeriodicExportingMetricReaderHelper.cs" />
23-
24-
<!-- Note: When '$(ExposeExperimentalFeatures)' == 'false' these links are
25-
NOT required because this project sees API internals -->
26-
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" RequiresExposedExperimentalFeatures="true" />
27-
<Compile Include="$(RepoRoot)\src\Shared\DiagnosticDefinitions.cs" Link="Includes\DiagnosticDefinitions.cs" RequiresExposedExperimentalFeatures="true" />
2823
</ItemGroup>
2924

3025
</Project>

src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OpenTelemetry.Exporter.OpenTelemetryProtocol.csproj

-9
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,6 @@
4040
<Compile Include="$(RepoRoot)\src\Shared\PeriodicExportingMetricReaderHelper.cs" Link="Includes\PeriodicExportingMetricReaderHelper.cs" />
4141
<Compile Include="$(RepoRoot)\src\Shared\PeerServiceResolver.cs" Link="Includes\PeerServiceResolver.cs" />
4242
<Compile Include="$(RepoRoot)\src\Shared\TagTransformer.cs" Link="Includes\TagTransformer.cs" />
43-
44-
<!-- Note: When '$(ExposeExperimentalFeatures)' == 'false' these links are
45-
NOT required because this project sees API + SDK internals -->
46-
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" RequiresExposedExperimentalFeatures="true" />
47-
<Compile Include="$(RepoRoot)\src\Shared\DiagnosticDefinitions.cs" Link="Includes\DiagnosticDefinitions.cs" RequiresExposedExperimentalFeatures="true" />
48-
<Compile Include="$(RepoRoot)\src\Shared\ExceptionExtensions.cs" Link="Includes\ExceptionExtensions.cs" RequiresExposedExperimentalFeatures="true" />
49-
<Compile Include="$(RepoRoot)\src\Shared\SemanticConventions.cs" Link="Includes\SemanticConventions.cs" RequiresExposedExperimentalFeatures="true" />
50-
<Compile Include="$(RepoRoot)\src\Shared\SpanAttributeConstants.cs" Link="Includes\SpanAttributeConstants.cs" RequiresExposedExperimentalFeatures="true" />
51-
<Compile Include="$(RepoRoot)\src\Shared\StatusHelper.cs" Link="Includes\StatusHelper.cs" RequiresExposedExperimentalFeatures="true" />
5243
</ItemGroup>
5344

5445
<ItemGroup>

src/OpenTelemetry.Extensions.Hosting/OpenTelemetry.Extensions.Hosting.csproj

-8
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,4 @@
1616
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry\OpenTelemetry.csproj" />
1717
</ItemGroup>
1818

19-
<ItemGroup>
20-
<!-- Note: When '$(ExposeExperimentalFeatures)' == 'false' these links are
21-
NOT required because this project sees API internals -->
22-
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" RequiresExposedExperimentalFeatures="true" />
23-
<Compile Include="$(RepoRoot)\src\Shared\DiagnosticDefinitions.cs" Link="Includes\DiagnosticDefinitions.cs" RequiresExposedExperimentalFeatures="true" />
24-
<Compile Include="$(RepoRoot)\src\Shared\ExceptionExtensions.cs" Link="Includes\ExceptionExtensions.cs" RequiresExposedExperimentalFeatures="true" />
25-
</ItemGroup>
26-
2719
</Project>

src/OpenTelemetry/AssemblyInfo.cs

+3-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
using System.Runtime.CompilerServices;
55

6-
[assembly: InternalsVisibleTo("OpenTelemetry.Tests" + AssemblyInfo.PublicKey)]
6+
[assembly: InternalsVisibleTo("OpenTelemetry.Exporter.Console" + AssemblyInfo.PublicKey)]
77
[assembly: InternalsVisibleTo("OpenTelemetry.Exporter.InMemory" + AssemblyInfo.PublicKey)]
88
[assembly: InternalsVisibleTo("OpenTelemetry.Exporter.OpenTelemetryProtocol" + AssemblyInfo.PublicKey)]
99
[assembly: InternalsVisibleTo("OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests" + AssemblyInfo.PublicKey)]
@@ -12,12 +12,9 @@
1212
[assembly: InternalsVisibleTo("OpenTelemetry.Exporter.Prometheus.HttpListener.Tests" + AssemblyInfo.PublicKey)]
1313
[assembly: InternalsVisibleTo("OpenTelemetry.Extensions.Hosting" + AssemblyInfo.PublicKey)]
1414
[assembly: InternalsVisibleTo("OpenTelemetry.Extensions.Hosting.Tests" + AssemblyInfo.PublicKey)]
15-
[assembly: InternalsVisibleTo("Benchmarks" + AssemblyInfo.PublicKey)]
16-
17-
#if !EXPOSE_EXPERIMENTAL_FEATURES
18-
[assembly: InternalsVisibleTo("OpenTelemetry.Exporter.Console" + AssemblyInfo.PublicKey)]
15+
[assembly: InternalsVisibleTo("OpenTelemetry.Tests" + AssemblyInfo.PublicKey)]
1916
[assembly: InternalsVisibleTo("OpenTelemetry.Tests.Stress.Metrics" + AssemblyInfo.PublicKey)]
20-
#endif
17+
[assembly: InternalsVisibleTo("Benchmarks" + AssemblyInfo.PublicKey)]
2118

2219
#if SIGNED
2320
file static class AssemblyInfo

0 commit comments

Comments
 (0)