Skip to content

Commit 178212e

Browse files
authored
Minor tweaks to shared files (DataDog#1729)
As we are cleaning up the Profiler build to reference `dd-trace-dotnet` instead of `dd-shared-components-dotnet`, we discover the need to minor tweaks. This PR is the collection of such tweaks which I collected into a single PR to minimize churn. The Profiler work is now done (https://github.com/DataDog/dd-continuous-profiler-dotnet/pull/135). Note that while this PR is being reviewed and merged, the Profiler builds cleanly while referencing `dd-trace-dotnet / macrogreg/SharedItemsCatchup`. Once this PR is merged, we must point the profiler to `dd-trace-dotnet / master`. Changes here: * Make packages path the same for all shared items. * Props files must use relative paths to construct shared file references. * Fix upward walking chains in `Directory.Build.props` files.
1 parent c926ae1 commit 178212e

File tree

7 files changed

+38
-6
lines changed

7 files changed

+38
-6
lines changed

shared/NuGet.config

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
4+
<fallbackPackageFolders>
5+
<!-- Do not depend on global state -->
6+
<clear />
7+
</fallbackPackageFolders>
8+
9+
<packageRestore>
10+
<!-- Allow NuGet to download missing packages -->
11+
<add key="enabled" value="True" />
12+
13+
<!-- Automatically check for missing packages during build in Visual Studio -->
14+
<add key="automatic" value="True" />
15+
</packageRestore>
16+
17+
<packageSources>
18+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
19+
</packageSources>
20+
21+
<config>
22+
<add key="RepositoryPath" value="../../_build/ImportedPackages" />
23+
</config>
24+
</configuration>

shared/samples/Datadog.DynamicDiagnosticSourceBindings.Demo/LateLoadDS.NetFx/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
<SkipCodeAnalysis>true</SkipCodeAnalysis>
1010
</PropertyGroup>
1111

12-
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../../'))" />
12+
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
1313

1414
</Project>

shared/src/managed-lib/DynamicDiagnosticSourceBindings/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
44

5-
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../../'))" />
5+
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
66

77
<Import Project="ProductVersion.props" />
88

shared/src/managed-lib/ManagedLoader/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
44

5-
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../../'))" />
5+
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
66

77
<Import Project="ProductVersion.props" />
88

shared/src/managed-src/Datadog.Logging/Datadog.Logging.Composition.props

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
</PropertyGroup>
66

77
<PropertyGroup>
8-
<SharedSrcBaseDir>$(EnlistmentRoot)\shared\src\managed-src</SharedSrcBaseDir>
8+
<!-- In .csproj files we define 'SharedSrcBaseDir' similar to this: -->
9+
<!-- <SharedSrcBaseDir>$(EnlistmentRoot)\shared\src\managed-src</SharedSrcBaseDir> -->
10+
<!-- However, in this .props file we need to use a relative path, becasue it may be pulled into a -->
11+
<!-- project located in a different repo which has a different value for 'EnlistmentRoot'. -->
12+
<SharedSrcBaseDir>$([System.IO.Path]::GetFullPath( $(MSBuildThisFileDirectory)\..\ ))</SharedSrcBaseDir>
913
<SharedSrcBaseLabel>Shared-Src</SharedSrcBaseLabel>
1014
</PropertyGroup>
1115

shared/src/managed-src/Datadog.Logging/Datadog.Logging.Emission.props

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
</PropertyGroup>
66

77
<PropertyGroup>
8-
<SharedSrcBaseDir>$(EnlistmentRoot)\shared\src\managed-src</SharedSrcBaseDir>
8+
<!-- In .csproj files we define 'SharedSrcBaseDir' similar to this: -->
9+
<!-- <SharedSrcBaseDir>$(EnlistmentRoot)\shared\src\managed-src</SharedSrcBaseDir> -->
10+
<!-- However, in this .props file we need to use a relative path, becasue it may be pulled into a -->
11+
<!-- project located in a different repo which has a different value for 'EnlistmentRoot'. -->
12+
<SharedSrcBaseDir>$([System.IO.Path]::GetFullPath( $(MSBuildThisFileDirectory)\..\ ))</SharedSrcBaseDir>
913
<SharedSrcBaseLabel>Shared-Src</SharedSrcBaseLabel>
1014
</PropertyGroup>
1115

shared/test/Vendored.System.Diagnostics.DiagnosticSource.Tests/NuGet.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
<clear />
1616
</disabledPackageSources>
1717
<config>
18-
<add key="RepositoryPath" value="../../packages" />
18+
<add key="RepositoryPath" value="../../../../_build/ImportedPackages" />
1919
</config>
2020
</configuration>

0 commit comments

Comments
 (0)