Skip to content

Commit

Permalink
[repo] Include license files in packages (#2118)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeBlanch authored Oct 1, 2024
1 parent 1bdbf96 commit aadcdbb
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 25 deletions.
File renamed without changes.
31 changes: 13 additions & 18 deletions build/Common.prod.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
<RepositoryUrl>https://github.com/open-telemetry/opentelemetry-dotnet-contrib</RepositoryUrl>
<PackageProjectUrl>https://OpenTelemetry.io</PackageProjectUrl>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackagePrimaryLicenseFile>$(RepoRoot)\LICENSE.TXT</PackagePrimaryLicenseFile>
<PackageIcon>opentelemetry-icon-color.png</PackageIcon>
<Authors>OpenTelemetry authors</Authors>
<Authors>OpenTelemetry Authors</Authors>
<Copyright>Copyright The OpenTelemetry Authors</Copyright>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)/OpenTelemetryContrib.prod.ruleset</CodeAnalysisRuleSet>
<NoWarn>$(NoWarn),1573,1712</NoWarn>
<PackageOutputPath Condition="$(Build_ArtifactStagingDirectory) != ''">$(Build_ArtifactStagingDirectory)</PackageOutputPath>
Expand All @@ -19,13 +20,9 @@
</PropertyGroup>

<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)opentelemetry-icon-color.png" Pack="true" PackagePath="\"/>

<PackageReference Include="MinVer" Version="$(MinVerPkgVer)" Condition="'$(IntegrationBuild)' != 'true'">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="$(MicrosoftPublicApiAnalyzersPkgVer)" Condition="'$(EnablePublicApi)'!='false'" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="$(MinVerPkgVer)" PrivateAssets="All" Condition="'$(IntegrationBuild)' != 'true'" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubPkgVer)" PrivateAssets="All" Condition="'$(IntegrationBuild)' != 'true'" />
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="$(MicrosoftPublicApiAnalyzersPkgVer)" PrivateAssets="All" Condition="'$(EnablePublicApi)' != 'false'" />
</ItemGroup>

<Target Name="AssemblyVersionTarget" AfterTargets="MinVer" Condition="'$(MinVerVersion)'!=''">
Expand Down Expand Up @@ -55,11 +52,14 @@
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<ItemGroup Condition="'$(Deterministic)'=='true'">
<SourceRoot Include="$(MSBuildThisFileDirectory)/"/>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)opentelemetry-icon-color.png" Pack="true" PackagePath="\"/>
<SourceRoot Include="$(MSBuildThisFileDirectory)/" Condition="'$(Deterministic)' == 'true'" />
<!-- Note: This includes all the PublicApiAnalyzers files in projects to make editing easier in the IDE -->
<None Include=".publicApi\**\PublicAPI.*.txt" Condition="'$(EnablePublicApi)' != 'false'" />
</ItemGroup>

<PropertyGroup Condition="'$(Deterministic)'=='true'">
<PropertyGroup Condition="'$(Deterministic)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

Expand All @@ -69,14 +69,9 @@
<Error Text="Cannot perform package validation without a baseline package version." />
</Target>

<ItemGroup Condition="'$(EnablePublicApi)'!='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="ResolvePublicApiFiles"
BeforeTargets="CoreCompile"
Condition="'$(EnablePublicApi)'!='false'">
Condition="'$(EnablePublicApi)' != 'false'">
<ItemGroup>
<!-- Note: This resolves all the PublicApiAnalyzers files which are actually used by the analyzer -->
<AdditionalFiles Include=".publicApi\PublicAPI.*.txt" />
Expand Down
1 change: 1 addition & 0 deletions opentelemetry-dotnet-contrib.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution items", "Solution
CODEOWNERS = CODEOWNERS
CONTRIBUTING.md = CONTRIBUTING.md
global.json = global.json
LICENSE.TXT = LICENSE.TXT
NuGet.config = NuGet.config
opentelemetry-dotnet-contrib.proj = opentelemetry-dotnet-contrib.proj
README.md = README.md
Expand Down
21 changes: 14 additions & 7 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
<Project>

<Import Project="..\Directory.Build.targets" Condition="Exists('..\Directory.Build.targets')" />
<Import Project="$(RepoRoot)\build\Common.targets" />

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubPkgVer)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<PropertyGroup>
<TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
</PropertyGroup>

<ItemGroup>
<EmbeddedFiles Include="$(GeneratedAssemblyInfoFile)"/>
</ItemGroup>

<ItemGroup Condition="'$(IsPackable)' == 'true'">
<None Include="$(PackagePrimaryLicenseFile)"
PackagePath="$([System.IO.Path]::GetFileName('$(PackagePrimaryLicenseFile)'))"
Pack="true"
Visible="false" />
<None Include="$(PackageThirdPartyNoticesFile)"
PackagePath="$([System.IO.Path]::GetFileName('$(PackageThirdPartyNoticesFile)'))"
Pack="true"
Visible="false" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);net462</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Description>An OpenTelemetry .NET exporter that exports to local ETW or UDS.</Description>
<PackageThirdPartyNoticesFile>THIRD-PARTY-NOTICES.TXT</PackageThirdPartyNoticesFile>
<!-- Tweak style rules for Geneva: Allow underscores in constant names and allow regions inside code blocks -->
<NoWarn>$(NoWarn);SA1123;SA1310</NoWarn>
<MinVerTagPrefix>Exporter.Geneva-</MinVerTagPrefix>
Expand Down

0 comments on commit aadcdbb

Please sign in to comment.