Skip to content

Commit

Permalink
Merge branch 'main' into api-deferredrracerproviderbuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
cijothomas committed Jun 14, 2021
2 parents eec9afb + a19d9e0 commit efd6448
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .github/workflows/apicompatibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: API Compatibility

on:
pull_request:
branches: [ main, metrics ]
paths-ignore:
- '**.md'

jobs:
build-test:
runs-on: windows-latest
env:
CheckAPICompatibility: true
steps:
- uses: actions/checkout@v2

- name: Install dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -340,3 +340,5 @@ ASALocalRun/

# SonarQube folder
/.sonarqube

/src/LastMajorVersionBinaries
1 change: 1 addition & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<packageSources>
<clear />
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
<add key=".Net Core Tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
</packageSources>
<disabledPackageSources />
</configuration>
4 changes: 3 additions & 1 deletion OpenTelemetry.sln
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{7CB2F02E
build\OpenTelemetry.prod.loose.ruleset = build\OpenTelemetry.prod.loose.ruleset
build\OpenTelemetry.prod.ruleset = build\OpenTelemetry.prod.ruleset
build\OpenTelemetry.test.ruleset = build\OpenTelemetry.test.ruleset
build\PreBuild.ps1 = build\PreBuild.ps1
build\process-codecoverage.ps1 = build\process-codecoverage.ps1
build\RELEASING.md = build\RELEASING.md
build\stylecop.json = build\stylecop.json
Expand Down Expand Up @@ -100,6 +101,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ISSUE_TEMPLATE", "ISSUE_TEM
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{E69578EB-B456-4062-A645-877CD964528B}"
ProjectSection(SolutionItems) = preProject
.github\workflows\apicompatibility.yml = .github\workflows\apicompatibility.yml
.github\workflows\code-coverage.yml = .github\workflows\code-coverage.yml
.github\workflows\codeql-analysis.yml = .github\workflows\codeql-analysis.yml
.github\workflows\docfx.yml = .github\workflows\docfx.yml
Expand Down Expand Up @@ -199,7 +201,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestApp.AspNetCore.5.0", "t
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "exception-reporting", "docs\trace\exception-reporting\exception-reporting.csproj", "{08D29501-F0A3-468F-B18D-BD1821A72383}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "customizing-the-sdk", "docs\trace\customizing-the-sdk\customizing-the-sdk.csproj", "{64E3D8BB-93AB-4571-93F7-ED8D64DFFD06}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "customizing-the-sdk", "docs\trace\customizing-the-sdk\customizing-the-sdk.csproj", "{64E3D8BB-93AB-4571-93F7-ED8D64DFFD06}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
7 changes: 7 additions & 0 deletions build/Common.prod.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(MinVerTagPrefix)' == 'core-' AND '$(CheckAPICompatibility)' == 'true'">
<PackageReference Include="Microsoft.DotNet.ApiCompat" Version="6.0.0-beta.21308.1" PrivateAssets="All" />
<ResolvedMatchingContract Include="..\LastMajorVersionBinaries\$(AssemblyName)\$(OTelPreviousStableVer)\lib\$(TargetFramework)\$(AssemblyName).dll" />
</ItemGroup>
<Target Name="PreBuild" BeforeTargets="PreBuildEvent" Condition="'$(MinVerTagPrefix)' == 'core-' AND '$(CheckAPICompatibility)' == 'true'">
<Exec Command="powershell -ExecutionPolicy Unrestricted -File &quot;$(RepoRoot)\build\PreBuild.ps1&quot; -package $(AssemblyName) -version &quot;$(OTelPreviousStableVer)&quot;" />
</Target>

<PropertyGroup>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)/OpenTelemetry.prod.ruleset</CodeAnalysisRuleSet>
Expand Down
1 change: 1 addition & 0 deletions build/Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<MicrosoftSourceLinkGitHubPkgVer>[1.0.0,2.0)</MicrosoftSourceLinkGitHubPkgVer>
<NewtonsoftJsonPkgVer>[12.0.2,13.0)</NewtonsoftJsonPkgVer>
<OpenTracingPkgVer>[0.12.1,0.13)</OpenTracingPkgVer>
<OTelPreviousStableVer>1.0.1</OTelPreviousStableVer>
<StackExchangeRedisPkgVer>[2.1.58,3.0)</StackExchangeRedisPkgVer>
<StyleCopAnalyzersPkgVer>[1.1.118,2.0)</StyleCopAnalyzersPkgVer>
<SystemCollectionsImmutablePkgVer>1.4.0</SystemCollectionsImmutablePkgVer>
Expand Down
26 changes: 26 additions & 0 deletions build/PreBuild.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
param([string]$package, [string]$version)

$workDir = "..\LastMajorVersionBinaries"
if (-Not (Test-Path $workDir))
{
Write-Host "Working directory for previous package versions not found, creating..."
New-Item -Path $workDir -ItemType "directory" | Out-Null
}

if (Test-Path -Path "$workDir\$package.$version.zip")
{
Write-Debug "Previous package version already downloaded"
}
else
{
Write-Host "Retrieving $package @$version for compatibility check"
Invoke-WebRequest -Uri https://www.nuget.org/api/v2/package/$package/$version -Outfile "$workDir\$package.$version.zip"
}
if (Test-Path -Path "$workDir\$package\$version\lib")
{
Write-Debug "Previous package version already extracted"
}
else
{
Expand-Archive -LiteralPath "$workDir\$package.$version.zip" -DestinationPath "$workDir\$package\$version" -Force
}

0 comments on commit efd6448

Please sign in to comment.