Skip to content

Commit

Permalink
Merge branch 'main' into reyang/aspnetcore-logging-example
Browse files Browse the repository at this point in the history
  • Loading branch information
reyang authored Sep 6, 2023
2 parents 2d0c156 + 5cc1f39 commit 1284dc0
Show file tree
Hide file tree
Showing 40 changed files with 549 additions and 393 deletions.
48 changes: 39 additions & 9 deletions build/Common.prod.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
<Import Project=".\Common.props" />

<ItemGroup>
<PackageReference Include="MinVer" PrivateAssets="All" Condition="'$(IntegrationBuild)' != 'true'">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

<PackageReference Include="MinVer" PrivateAssets="All" Condition="'$(IntegrationBuild)' != 'true'" />
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="All" />
</ItemGroup>

<PropertyGroup>
<RunApiCompat>true</RunApiCompat>
<ExposeExperimentalFeatures Condition="'$(ExposeExperimentalFeatures)' == ''">true</ExposeExperimentalFeatures>
</PropertyGroup>

<ItemGroup Condition="'$(MinVerTagPrefix)' == 'core-' AND '$(CheckAPICompatibility)' == 'true' AND '$(RunApiCompat)' == 'true'">
Expand Down Expand Up @@ -50,13 +48,48 @@
</PropertyGroup>

<Target Name="AssemblyVersionTarget" AfterTargets="MinVer" Condition="'$(MinVerVersion)'!='' AND '$(BuildNumber)' != ''">
<!-- Note: $(BuildNumber) is typically only set for builds initiated by the
publish workflow. The goal here is to set the assembly FileVersion and
resolve ExposeExperimentalFeatures based on the version MinVer resolved from
the git tag -->
<PropertyGroup>
<FileVersion>$(MinVerMajor).$(MinVerMinor).$(MinVerPatch).$(BuildNumber)</FileVersion>
<ExposeExperimentalFeatures Condition="'$(MinVerPreRelease)' != ''">true</ExposeExperimentalFeatures>
<ExposeExperimentalFeatures Condition="'$(MinVerPreRelease)' == ''">false</ExposeExperimentalFeatures>
</PropertyGroup>

<Message Importance="high" Text="**AssemblyVersionDebug** TargetFramework: $(TargetFramework), MinVerVersion: $(MinVerVersion), MinVerMajor: $(MinVerMajor), MinVerMinor: $(MinVerMinor), MinVerPatch: $(MinVerPatch), MinVerPreRelease: $(MinVerPreRelease), BuildNumber: $(BuildNumber), FileVersion: $(FileVersion), ExposeExperimentalFeatures: $(ExposeExperimentalFeatures)" />
<!-- Note: The '$(TargetFramework)' != '' check here is to reduce log spam
in builds like dotnet pack which fire MinVer but don't resolve the actual
TargetFramework -->
<Message
Condition="'$(TargetFramework)' != ''"
Importance="high"
Text="**AssemblyVersionDebug** TargetFramework: $(TargetFramework), MinVerVersion: $(MinVerVersion), BuildNumber: $(BuildNumber), FileVersion: $(FileVersion), ExposeExperimentalFeatures: $(ExposeExperimentalFeatures)" />
</Target>

<Target Name="ResolveExposeExperimentalFeatures" BeforeTargets="CoreCompile" DependsOnTargets="AssemblyVersionTarget">
<!-- Note: This runs for all builds. The goal here is to set the
EXPOSE_EXPERIMENTAL_FEATURES compiler constant if
$(ExposeExperimentalFeatures) is enabled and then select the correct api
files for the analyzer -->
<PropertyGroup Condition="'$(ExposeExperimentalFeatures)' == 'true'">
<DefineConstants>$(DefineConstants);EXPOSE_EXPERIMENTAL_FEATURES</DefineConstants>
</PropertyGroup>

<!-- Note: This selects the correct PublicApiAnalyzers files based on $(ExposeExperimentalFeatures) -->
<ItemGroup>
<AdditionalFiles Include=".publicApi\Stable\$(TargetFramework)\PublicAPI.*.txt" />
<AdditionalFiles Include=".publicApi\Experimental\$(TargetFramework)\PublicAPI.*.txt" Condition="'$(ExposeExperimentalFeatures)' == 'true'" />
<AdditionalFiles Include=".publicApi\$(TargetFramework)\PublicAPI.*.txt" />
</ItemGroup>

<!-- Note: The '$(BuildNumber)' != '' check here is to reduce log spam in
local and CI builds. We only want to log this for the publish workflows
where official builds are generated -->
<Message
Condition="'$(BuildNumber)' != ''"
Importance="high"
Text="**ResolveExposeExperimentalFeaturesDebug** TargetFramework: $(TargetFramework), DefineConstants: $(DefineConstants)" />
</Target>

<PropertyGroup>
Expand Down Expand Up @@ -90,11 +123,8 @@
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<!--PublicApi Analyzer-->
<!-- Note: This includes all the PublicApiAnalyzers files in projects to make editing easier in the IDE -->
<ItemGroup>
<AdditionalFiles Include=".publicApi\Stable\$(TargetFramework)\PublicAPI.*.txt" />
<AdditionalFiles Include=".publicApi\Experimental\$(TargetFramework)\PublicAPI.*.txt" Condition="'$(ExposeExperimentalFeatures)' == 'true'" />
<AdditionalFiles Include=".publicApi\$(TargetFramework)\PublicAPI.*.txt" />
<None Include=".publicApi\**\PublicAPI.*.txt" />
</ItemGroup>

Expand Down
5 changes: 0 additions & 5 deletions build/Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
<ImplicitUsings>enable</ImplicitUsings>
<!--temporarily disable. See 3958-->
<!--<AnalysisLevel>latest-All</AnalysisLevel>-->
<ExposeExperimentalFeatures Condition="'$(ExposeExperimentalFeatures)' == ''">true</ExposeExperimentalFeatures>
</PropertyGroup>

<PropertyGroup Condition="'$(ExposeExperimentalFeatures)' == 'true'">
<DefineConstants>$(DefineConstants);EXPOSE_EXPERIMENTAL_FEATURES</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
Expand Down
4 changes: 4 additions & 0 deletions src/OpenTelemetry.Api.ProviderBuilderExtensions/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

## 1.6.0

Released 2023-Sep-05

## 1.6.0-rc.1

Released 2023-Aug-21
Expand Down
Loading

0 comments on commit 1284dc0

Please sign in to comment.