|
7 | 7 | </PropertyGroup> |
8 | 8 |
|
9 | 9 | <ItemGroup> |
10 | | - <PackageReference Include="Microsoft.OneCollect.RecordTrace" Version="$(MicrosoftOneCollectRecordTraceVersion)" PrivateAssets="All" Condition="'$(TargetOS)' == 'linux'" /> |
| 10 | + <PackageReference Include="Microsoft.OneCollect.RecordTrace" Version="$(MicrosoftOneCollectRecordTraceVersion)" PrivateAssets="All" /> |
11 | 11 | </ItemGroup> |
12 | 12 |
|
13 | 13 | <ItemGroup> |
|
16 | 16 | </ItemGroup> |
17 | 17 |
|
18 | 18 | <ItemGroup> |
19 | | - <None Include="dotnet-common.script" CopyToOutputDirectory="PreserveNewest" /> |
| 19 | + <Content Include="dotnet-common.script"> |
| 20 | + <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
| 21 | + <TargetPath>dotnet-common.script</TargetPath> |
| 22 | + </Content> |
20 | 23 | </ItemGroup> |
21 | 24 |
|
22 | | - <ItemGroup Condition="'$(TargetOS)' == 'linux'"> |
23 | | - <None Include="$(NuGetPackageRoot)microsoft.onecollect.recordtrace/$(MicrosoftOneCollectRecordTraceVersion)/runtimes/$(TargetOS)-$(TargetArchitecture)/native/record-trace"> |
24 | | - <Link>record-trace</Link> |
25 | | - <Visible>false</Visible> |
| 25 | + <ItemGroup Condition="'$(TargetOS)' != 'AnyOS'"> |
| 26 | + <Content Include="$(NuGetPackageRoot)microsoft.onecollect.recordtrace/$(MicrosoftOneCollectRecordTraceVersion)/runtimes/$(TargetOS)-$(TargetArchitecture)/native/record-trace"> |
26 | 27 | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
27 | | - </None> |
| 28 | + <TargetPath>record-trace</TargetPath> |
| 29 | + </Content> |
28 | 30 | </ItemGroup> |
| 31 | + |
| 32 | + <!-- CI Build Include all record-trace variants in building the managed test components --> |
| 33 | + <!-- Afterwards, when copying the native project binaries, try to copy the specific one when we have a TargetOS --> |
| 34 | + <ItemGroup Condition="'$(TargetOS)' == 'AnyOS'"> |
| 35 | + <Content Include="$(NuGetPackageRoot)microsoft.onecollect.recordtrace/$(MicrosoftOneCollectRecordTraceVersion)/runtimes/linux-x64/native/record-trace"> |
| 36 | + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
| 37 | + <TargetPath>linux-x64/record-trace</TargetPath> |
| 38 | + </Content> |
| 39 | + <Content Include="$(NuGetPackageRoot)microsoft.onecollect.recordtrace/$(MicrosoftOneCollectRecordTraceVersion)/runtimes/linux-arm64/native/record-trace"> |
| 40 | + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
| 41 | + <TargetPath>linux-arm64/record-trace</TargetPath> |
| 42 | + </Content> |
| 43 | + </ItemGroup> |
| 44 | + |
| 45 | + <Target Name="CopyRidSpecificRecordTrace" AfterTargets="CopyAllNativeTestProjectBinaries"> |
| 46 | + <PropertyGroup> |
| 47 | + <RecordTraceRidSubdir Condition="'$(TargetArchitecture)' == 'x64'">linux-x64</RecordTraceRidSubdir> |
| 48 | + <RecordTraceRidSubdir Condition="'$(TargetArchitecture)' == 'arm64'">linux-arm64</RecordTraceRidSubdir> |
| 49 | + <RecordTraceSource>$(OutputPath)$(RecordTraceRidSubdir)/record-trace</RecordTraceSource> |
| 50 | + <RecordTraceDest>$(OutputPath)record-trace</RecordTraceDest> |
| 51 | + </PropertyGroup> |
| 52 | + |
| 53 | + <Copy |
| 54 | + SourceFiles="$(RecordTraceSource)" |
| 55 | + DestinationFiles="$(RecordTraceDest)" |
| 56 | + Condition="Exists('$(RecordTraceSource)')" |
| 57 | + SkipUnchangedFiles="true" /> |
| 58 | + |
| 59 | + <Exec Command="chmod +x '$(RecordTraceDest)'" Condition="Exists('$(RecordTraceDest)')" /> |
| 60 | + |
| 61 | + <Message Text="Copied RID-specific record-trace from $(RecordTraceSource) to $(RecordTraceDest)" Importance="High" Condition="Exists('$(RecordTraceSource)')" /> |
| 62 | + <Warning Text="record-trace not found at $(RecordTraceSource) for RID $(RecordTraceRidSubdir)" Condition="!Exists('$(RecordTraceSource)')" /> |
| 63 | + </Target> |
29 | 64 | </Project> |
0 commit comments