forked from signalfx/signalfx-dotnet-tracing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Datadog.Trace.proj
181 lines (156 loc) · 8.47 KB
/
Datadog.Trace.proj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<!-- Modified by SignalFx -->
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildInParallel Condition="'$(BuildInParallel)' == ''">true</BuildInParallel>
</PropertyGroup>
<ItemGroup>
<CsharpProject Include="src\**\*.csproj"/>
<CsharpTestProject Include="test\**\*.csproj"/>
<CppProject Include="src\**\*.vcxproj"/>
<CppTestProject Include="test\**\*.vcxproj"/>
<SampleProject Include="samples*\**\*.csproj"/>
<SampleLibProject Include="sample-libs\**\*.csproj"/>
<WindowsInstallerProject Include="deploy\**\*.wixproj"/>
</ItemGroup>
<ItemGroup>
<FrameworkReproduction Include="reproductions\EntityFramework6x.MdTokenLookupFailure\EntityFramework6x.MdTokenLookupFailure.csproj" />
<FrameworkReproduction Include="reproductions\StackExchange.Redis.AssemblyConflict.LegacyProject\StackExchange.Redis.AssemblyConflict.LegacyProject.csproj" />
</ItemGroup>
<Import Condition="'$(PerformComprehensiveTesting)'=='true'" Project="PackageVersionsComprehensive.g.props" />
<Import Condition="'$(PerformComprehensiveTesting)'!='true'" Project="PackageVersionsLatestMinors.g.props" />
<Target Name="Restore">
<MSBuild Targets="Restore" Projects="@(CsharpProject);@(CsharpTestProject);@(CppProject);@(CppTestProject);@(SampleProject)"/>
</Target>
<Target Name="Clean">
<MSBuild Targets="Clean" Projects="@(CsharpProject);@(CsharpTestProject);@(CppProject);@(CppTestProject);@(SampleProject);@(WindowsInstallerProject)"/>
</Target>
<!-- default target -->
<Target Name="Build">
<MSBuild Targets="Build" Projects="@(CsharpProject);@(CsharpTestProject);@(CppProject);@(CppTestProject)">
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
</MSBuild>
</Target>
<Target Name="BuildFrameworkReproductions">
<MSBuild Targets="Build" Projects="@(FrameworkReproduction)">
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
</MSBuild>
</Target>
<Target Name="BuildCsharp">
<MSBuild Targets="Build" Projects="@(CsharpProject)" RemoveProperties="Platform">
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
</MSBuild>
</Target>
<Target Name="BuildCsharpTests">
<MSBuild Targets="Build" Projects="@(CsharpTestProject)">
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
</MSBuild>
</Target>
<Target Name="BuildCpp">
<MSBuild Targets="Build" Projects="@(CppProject)">
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
</MSBuild>
<MSBuild Targets="Build" Projects="@(CppProject)" Condition="'$(BuildAdditionalx86Profiler)' == 'true'" Properties="Platform=x86">
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
</MSBuild>
</Target>
<Target Name="BuildCppTests">
<MSBuild Targets="Build" Projects="@(CppTestProject)">
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
</MSBuild>
</Target>
<Target Name="RestoreAndBuildSamplesForPackageVersions" Condition="'$(TestAllPackageVersions)'=='true'">
<!-- Build the core C# projects first, so that the sample project builds do not need to build them and can be run
concurrently -->
<MSBuild Targets="Restore" Projects="@(CsharpProject)" BuildInParallel="false" RemoveProperties="TargetFramework;Platform">
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
</MSBuild>
<MSBuild Targets="Build" Projects="@(CsharpProject)" BuildInParallel="false" RemoveProperties="TargetFramework;Platform">
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
</MSBuild>
<!-- Build the sample-libs projects next in case any sample projects rely on them -->
<MSBuild Targets="Restore" Projects="@(SampleLibProject)" BuildInParallel="false" RemoveProperties="TargetFramework">
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
</MSBuild>
<MSBuild Targets="Build" Projects="@(SampleLibProject)" BuildInParallel="false" RemoveProperties="TargetFramework">
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
</MSBuild>
<!-- Filter the sample projects by TargetFramework -->
<ItemGroup>
<PackageVersionSampleCompile Include="@(PackageVersionSample)" Condition="'%(PackageVersionSample.TargetFramework)' == '' or '%(PackageVersionSample.TargetFramework)'=='$(TargetFramework)'" />
</ItemGroup>
<!-- Build the sample projects concurrently -->
<MSBuild Targets="Restore" Projects="@(PackageVersionSampleCompile)" BuildInParallel="$(BuildInParallel)">
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
</MSBuild>
<MSBuild Targets="Publish" Projects="@(PackageVersionSampleCompile)" BuildInParallel="$(BuildInParallel)">
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
</MSBuild>
</Target>
<Target Name="BuildSamples" DependsOnTargets="RestoreAndBuildSamplesForPackageVersions">
<MSBuild Targets="Build" Projects="@(SampleProject)">
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
</MSBuild>
</Target>
<Target Name="SetMsiProperties">
<PropertyGroup>
<BuildAdditionalx86Profiler Condition="'$(Platform)' == 'x64'">true</BuildAdditionalx86Profiler>
</PropertyGroup>
</Target>
<Target Name="PublishManagedProfilerOnDisk">
<ItemGroup>
<ManagedProfilerPublishProject Include="src\Datadog.Trace.ClrProfiler.Managed\Datadog.Trace.ClrProfiler.Managed.csproj">
<Properties>TargetFramework=net45;PublishDir=$(MSBuildThisFileDirectory)\src\bin\managed-publish\net45</Properties>
</ManagedProfilerPublishProject>
<ManagedProfilerPublishProject Include="src\Datadog.Trace.ClrProfiler.Managed\Datadog.Trace.ClrProfiler.Managed.csproj">
<Properties>TargetFramework=net461;PublishDir=$(MSBuildThisFileDirectory)\src\bin\managed-publish\net461</Properties>
</ManagedProfilerPublishProject>
<ManagedProfilerPublishProject Include="src\Datadog.Trace.ClrProfiler.Managed\Datadog.Trace.ClrProfiler.Managed.csproj">
<Properties>TargetFramework=netstandard2.0;PublishDir=$(MSBuildThisFileDirectory)\src\bin\managed-publish\netstandard2.0</Properties>
</ManagedProfilerPublishProject>
</ItemGroup>
<MSBuild Targets="Publish" Projects="@(ManagedProfilerPublishProject)" BuildInParallel="$(BuildInParallel)" RemoveProperties="Platform">
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
</MSBuild>
</Target>
<Target Name="Msi" DependsOnTargets="SetMsiProperties;BuildCsharp;BuildCpp;PublishManagedProfilerOnDisk">
<MSBuild Targets="Build" Projects="@(WindowsInstallerProject)">
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
</MSBuild>
</Target>
<Target Name="CreateHomeDirectory" DependsOnTargets="BuildCsharp;BuildCpp;PublishManagedProfilerOnDisk">
<ItemGroup>
<PublishedManagedTracerFiles Include="$(MSBuildThisFileDirectory)src\bin\managed-publish\**\*.*" />
</ItemGroup>
<PropertyGroup>
<WindowsHomeOutput>$(MSBuildThisFileDirectory)src\bin\windows-tracer-home</WindowsHomeOutput>
</PropertyGroup>
<Copy
SourceFiles="$(MSBuildThisFileDirectory)integrations.json"
DestinationFolder="$(WindowsHomeOutput)"
SkipUnchangedFiles="true"
Retries="3"
RetryDelayMilliseconds="300"/>
<Copy
SourceFiles="@(PublishedManagedTracerFiles)"
DestinationFiles="@(PublishedManagedTracerFiles->'$(WindowsHomeOutput)\%(RecursiveDir)%(Filename)%(Extension)')"
SkipUnchangedFiles="true"
Retries="3"
RetryDelayMilliseconds="300"/>
<Copy
SourceFiles="$(MSBuildThisFileDirectory)src\Datadog.Trace.ClrProfiler.Native\bin\Release\x64\SignalFx.Tracing.ClrProfiler.Native.dll"
DestinationFolder="$(WindowsHomeOutput)\x64"
SkipUnchangedFiles="true"
Retries="3"
RetryDelayMilliseconds="300"/>
<Copy
SourceFiles="$(MSBuildThisFileDirectory)src\Datadog.Trace.ClrProfiler.Native\bin\Release\x86\SignalFx.Tracing.ClrProfiler.Native.dll"
DestinationFolder="$(WindowsHomeOutput)\x86"
SkipUnchangedFiles="true"
Retries="3"
RetryDelayMilliseconds="300"/>
<Delete Files="$(WindowsHomeOutput).zip" />
<ZipDirectory
SourceDirectory="$(WindowsHomeOutput)"
DestinationFile="$(WindowsHomeOutput).zip" />
</Target>
</Project>