128 lines
6.9 KiB
XML
128 lines
6.9 KiB
XML
<Project>
|
|
<Import Project=".\Common.props" />
|
|
|
|
<PropertyGroup>
|
|
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)/OpenTelemetry.prod.ruleset</CodeAnalysisRuleSet>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup Label="BuildFlags">
|
|
<ExposeExperimentalFeatures Condition="'$(ExposeExperimentalFeatures)' == ''">true</ExposeExperimentalFeatures>
|
|
<EnablePackageValidation Condition="'$(EnablePackageValidation)' == ''">false</EnablePackageValidation>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup Label="PackageProperties">
|
|
<RepositoryType>git</RepositoryType>
|
|
<RepositoryUrl>https://github.com/open-telemetry/opentelemetry-dotnet</RepositoryUrl>
|
|
<PackageTags>Observability;OpenTelemetry;Monitoring;Telemetry;Tracing;Metrics;Logging</PackageTags>
|
|
<PackageIcon>opentelemetry-icon-color.png</PackageIcon>
|
|
<PackageProjectUrl>https://opentelemetry.io</PackageProjectUrl>
|
|
<Authors>OpenTelemetry Authors</Authors>
|
|
<Copyright>Copyright The OpenTelemetry Authors</Copyright>
|
|
<PackageOutputPath Condition="$(Build_ArtifactStagingDirectory) != ''">$(Build_ArtifactStagingDirectory)</PackageOutputPath>
|
|
<IncludeSymbols>true</IncludeSymbols>
|
|
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
|
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
|
|
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
|
<PackagePrimaryLicenseFile>$(RepoRoot)\LICENSE.TXT</PackagePrimaryLicenseFile>
|
|
<PackageThirdPartyNoticesFile>$(RepoRoot)\THIRD-PARTY-NOTICES.TXT</PackageThirdPartyNoticesFile>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup Label="SourceLinkProperties">
|
|
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
|
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
|
<ContinuousIntegrationBuild Condition="'$(Deterministic)'=='true'">true</ContinuousIntegrationBuild>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<!-- Note: Disable net6.0 target for package validation because it has been
|
|
removed. It should be possible to remove this once a stable version has been
|
|
released to NuGet without net6.0. -->
|
|
<PackageValidationBaselineFrameworkToIgnore Include="net6.0" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<PackageReference Include="MinVer" PrivateAssets="All" Condition="'$(IntegrationBuild)' != 'true'" />
|
|
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" Condition="'$(IntegrationBuild)' != 'true'" />
|
|
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="All" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<None Include="$(MSBuildThisFileDirectory)opentelemetry-icon-color.png" Pack="true" PackagePath="\" />
|
|
<SourceRoot Condition="'$(Deterministic)'=='true'" Include="$(MSBuildThisFileDirectory)/" />
|
|
<None Include="$(IntermediateOutputPath)$(ProjectName).BuildFlags.txt"
|
|
Link="$(ProjectName).BuildFlags.txt"
|
|
CopyToOutputDirectory="PreserveNewest"
|
|
Visible="false" />
|
|
<!-- Note: This includes all the PublicApiAnalyzers files in projects to make editing easier in the IDE -->
|
|
<None Include=".publicApi\**\PublicAPI.*.txt" />
|
|
</ItemGroup>
|
|
|
|
<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>
|
|
|
|
<Error
|
|
Condition="'$(MinVerTagPrefix)' == 'coreunstable-' AND ('$(MinVerPreRelease)' == '' OR $(MinVerPreRelease.StartsWith('rc')))"
|
|
Text="Unstable core packages cannot be released stable or as release candidates." />
|
|
|
|
<!-- 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="EnsurePackageValidationBaselineVersion"
|
|
BeforeTargets="RunPackageValidation"
|
|
Condition="'$(DisablePackageBaselineValidation)' != 'true' AND '$(PackageValidationBaselineVersion)' == '' AND '$(MinVerTagPrefix)' != 'coreunstable-'">
|
|
<Error Text="Cannot perform package validation without a baseline package version." />
|
|
</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: We write a file into the output dir which captures the state of
|
|
ExposeExperimentalFeatures for the current compilation. This is used by
|
|
consuming projects (tests, benchmarks, examples, etc) to add compiler
|
|
constants which can be used to detect experimental APIs -->
|
|
<WriteLinesToFile
|
|
File="$(IntermediateOutputPath)$(ProjectName).BuildFlags.txt"
|
|
Lines="ExposeExperimentalFeatures=$(ExposeExperimentalFeatures)"
|
|
Overwrite="true"/>
|
|
|
|
<!-- Note: This selects the correct PublicApiAnalyzers files based on $(ExposeExperimentalFeatures) -->
|
|
<ItemGroup>
|
|
<AdditionalFiles Include=".publicApi\Stable\PublicAPI.*.txt" />
|
|
<AdditionalFiles Include=".publicApi\Stable\$(TargetFramework)\PublicAPI.*.txt" />
|
|
<AdditionalFiles Include=".publicApi\Experimental\PublicAPI.*.txt" Condition="'$(ExposeExperimentalFeatures)' == 'true'" />
|
|
<AdditionalFiles Include=".publicApi\Experimental\$(TargetFramework)\PublicAPI.*.txt" Condition="'$(ExposeExperimentalFeatures)' == 'true'" />
|
|
<AdditionalFiles Include=".publicApi\PublicAPI.*.txt" />
|
|
<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>
|
|
|
|
</Project>
|