Skip to content

Commit

Permalink
Improve Directory.Build.props files throughout the repository:
Browse files Browse the repository at this point in the history
- Delete unnecessary files that would otherwise bubble up to test/test-applications/integrations/dependency-libs/Directory.Build.props
- Move Test.Common.props to test/test-applications/Directory.Build.props, and modify solution file and imports accordingly
- Add a new Directory.Build.props in the build directory so there's a chain of them
- Modify all StyleCop Include declarations to use $(MSBuildThisFileDirectory) since relative paths in ItemGroups are evaluated from the original project file location
  • Loading branch information
zacharycmontoya committed Oct 19, 2020
1 parent b68e4ab commit 0ce3823
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 24 deletions.
4 changes: 3 additions & 1 deletion Datadog.Trace.sln
Expand Up @@ -42,7 +42,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
LICENSE-3rdparty.csv = LICENSE-3rdparty.csv
docs\README.md = docs\README.md
stylecop.json = stylecop.json
Test.Common.props = Test.Common.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{9E5F0022-0A50-40BF-AC6A-C3078585ECAB}"
Expand Down Expand Up @@ -313,6 +312,9 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.WebRequest", "test\test-applications\integrations\Samples.WebRequest\Samples.WebRequest.csproj", "{ED2742D3-2AA3-4D62-BB63-CFA43CEACCF3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test-applications", "test-applications", "{9518425A-36A5-4B8F-B0B8-6137DB88441D}"
ProjectSection(SolutionItems) = preProject
test\test-applications\Directory.Build.props = test\test-applications\Directory.Build.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "regression", "regression", "{498A300E-D036-49B7-A43D-821D1CAF11A5}"
ProjectSection(SolutionItems) = preProject
Expand Down
3 changes: 3 additions & 0 deletions build/Directory.Build.props
@@ -0,0 +1,3 @@
<Project>
<Import Project="..\Directory.Build.props" />
</Project>
4 changes: 2 additions & 2 deletions build/tools/Directory.Build.props
@@ -1,8 +1,8 @@
<Project>
<Import Project="..\..\Directory.Build.props" />
<Import Project="..\Directory.Build.props" />

<!-- StyleCop -->
<ItemGroup>
<Compile Include="..\GlobalSuppressions.cs" Link="GlobalSuppressions.tools.cs" />
<Compile Include="$(MSBuildThisFileDirectory)GlobalSuppressions.cs" Link="GlobalSuppressions.tools.cs" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Expand Up @@ -26,7 +26,7 @@
<None Include="$(MSBuildThisFileDirectory)\..\datadog-logo-256x256.png" Pack="true" Visible="false" PackagePath="packageIcon.png" />

<!-- StyleCop -->
<Compile Include="..\GlobalSuppressions.cs" Link="GlobalSuppressions.src.cs" />
<Compile Include="$(MSBuildThisFileDirectory)GlobalSuppressions.cs" Link="GlobalSuppressions.src.cs" />

<!-- reference assemblies let us target .NET Framework without the SDK (for example, on non-Windows) -->
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="all" />
Expand Down
2 changes: 1 addition & 1 deletion test/Directory.Build.props
Expand Up @@ -16,6 +16,6 @@

<!-- StyleCop -->
<ItemGroup>
<Compile Include="..\GlobalSuppressions.cs" Link="GlobalSuppressions.test.cs" />
<Compile Include="$(MSBuildThisFileDirectory)GlobalSuppressions.cs" Link="GlobalSuppressions.test.cs" />
</ItemGroup>
</Project>
Expand Up @@ -12,8 +12,8 @@

<IsPackable>false</IsPackable>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<ProfilerOutputDirectory>$(MSBuildThisFileDirectory)\src\Datadog.Trace.ClrProfiler.Native\bin\$(Configuration)\$(Platform)</ProfilerOutputDirectory>
<ManagedProfilerOutputDirectory Condition="'$(ManagedProfilerOutputDirectory)' == ''">$(MSBuildThisFileDirectory)\src\Datadog.Trace.ClrProfiler.Managed\bin\$(Configuration)</ManagedProfilerOutputDirectory>
<ProfilerOutputDirectory>$(MSBuildThisFileDirectory)\..\..\src\Datadog.Trace.ClrProfiler.Native\bin\$(Configuration)\$(Platform)</ProfilerOutputDirectory>
<ManagedProfilerOutputDirectory Condition="'$(ManagedProfilerOutputDirectory)' == ''">$(MSBuildThisFileDirectory)\..\..\src\Datadog.Trace.ClrProfiler.Managed\bin\$(Configuration)</ManagedProfilerOutputDirectory>

<!--These should be consolidated in a file that can be shared for the tests and samples directories -->
<DefineConstants Condition="'$(BuildingInsideVisualStudio)'=='true' or '$(TestAllPackageVersions)'!='true'">$(DefineConstants);DEFAULT_SAMPLES</DefineConstants>
Expand All @@ -22,15 +22,15 @@

<ItemGroup Condition="'$(ExcludeManagedProfiler)' != 'true' and
'$(LoadManagedProfilerFromProfilerDirectory)' != 'true' ">
<ProjectReference Include="$(MSBuildThisFileDirectory)\src\Datadog.Trace.ClrProfiler.Managed\Datadog.Trace.ClrProfiler.Managed.csproj" />
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\..\src\Datadog.Trace.ClrProfiler.Managed\Datadog.Trace.ClrProfiler.Managed.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(ExcludeNativeProfiler)' != 'true'">
<None Include="$(ProfilerOutputDirectory)\*.dll;$(ProfilerOutputDirectory)\*.so;$(ProfilerOutputDirectory)\*.pdb"
CopyToOutputDirectory="Always"
CopyToPublishDirectory="Always"
Link="profiler-lib\%(RecursiveDir)\%(Filename)%(Extension)" />
<Content Include="$(MSBuildThisFileDirectory)\integrations.json"
<Content Include="$(MSBuildThisFileDirectory)\..\..\integrations.json"
CopyToOutputDirectory="Always"
CopyToPublishDirectory="Always"
Link="profiler-lib\integrations.json" />
Expand Down
2 changes: 1 addition & 1 deletion test/test-applications/integrations/Directory.Build.props
@@ -1,3 +1,3 @@
<Project>
<Import Project="..\..\..\Test.Common.props" />
<Import Project="..\Directory.Build.props" />
</Project>

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion test/test-applications/regression/Directory.Build.props
@@ -1,3 +1,3 @@
<Project>
<Import Project="..\..\..\Test.Common.props" />
<Import Project="..\Directory.Build.props" />
</Project>
2 changes: 1 addition & 1 deletion tools/Directory.Build.props
Expand Up @@ -3,6 +3,6 @@

<!-- StyleCop -->
<ItemGroup>
<Compile Include="..\GlobalSuppressions.cs" Link="GlobalSuppressions.tools.cs" />
<Compile Include="$(MSBuildThisFileDirectory)GlobalSuppressions.cs" Link="GlobalSuppressions.tools.cs" />
</ItemGroup>
</Project>

0 comments on commit 0ce3823

Please sign in to comment.