Skip to content

Commit

Permalink
Add support for additional DotNetRuntime (dotnet#7158)
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoK authored and akoeplinger committed Apr 12, 2021
1 parent 5c4b272 commit 5dc1370
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Microsoft.DotNet.Helix/Sdk/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,23 @@ Given a local folder `$(TestFolder)` containing `runtests.cmd`, this will run `r
<HelixPostCommands>$(HelixPostCommands);echo 'One Pepperoni Pizza'</HelixPostCommands>
</PropertyGroup>

<!--
Optional additional dotnet runtimes or SDKs for correlation payloads
PackageType (defaults to runtime)
Channel (defaults to Current)
-->
<ItemGroup>
<!-- Includes the 6.0.0-preview.4.21178.6 dotnet runtime package version from the Current channel, using the DotNetCliRuntime -->
<AdditionalDotNetPackage Include="6.0.0-preview.4.21178.6">
<!-- 'sdk', 'runtime' or 'aspnetcore-runtime' -->
<PackageType>runtime</PackageType>
<!-- 'Current' or 'LTS', determines what channel 'latest' version pulls from -->
<Channel>Current</Channel>
</AdditionalDotNetPackage>
<!-- Includes the 6.0.0-preview.4.21175.1 version, using the default runtime packageType, DotNetCliRuntime, and Current channel -->
<AdditionalDotNetPackage Include="6.0.0-preview.4.21175.1" />
</ItemGroup>

<!--
XUnit Runner
Enabling this will create one work item for each xunit test project specified.
Expand Down
23 changes: 23 additions & 0 deletions src/Microsoft.DotNet.Helix/Sdk/tools/dotnet-cli/DotNetCli.targets
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,27 @@
<HelixPreCommands Condition="!$(IsPosixShell)">$(HelixPreCommands);set DOTNET_ROOT=%HELIX_CORRELATION_PAYLOAD%\$(DotNetCliDestination);set DOTNET_CLI_TELEMETRY_OPTOUT=1</HelixPreCommands>
</PropertyGroup>
</Target>

<Target Name="AddAdditionalRuntimes"
Condition="@(AdditionalDotNetPackage->Count()) != 0"
AfterTargets="Build"
Outputs="%(AdditionalDotNetPackage.Identity)">
<PropertyGroup>
<_channel>%(AdditionalDotNetPackage.Channel)</_channel>
<_channel Condition=" '$(_channel)' == '' ">Current</_channel>
<_packageType>%(AdditionalDotNetPackage.PackageType)</_packageType>
<_packageType Condition=" '$(_packageType)' == '' ">runtime</_packageType>
</PropertyGroup>

<Message Text = "Adding correlation payload for additional .NET Core package: Version: '%(AdditionalDotNetPackage.Identity)' Runtime: '$(DotNetCliRuntime)' PackageType: '$(_packageType)' Channel: '$(_channel)' "/>
<FindDotNetCliPackage Version="%(AdditionalDotNetPackage.Identity)" Runtime="$(DotNetCliRuntime)" PackageType="$(_packageType)" Channel="$(_channel)">
<Output TaskParameter="PackageUri" PropertyName="DotNetCliPackageUri"/>
</FindDotNetCliPackage>
<ItemGroup>
<HelixCorrelationPayload Include="dotnet-additional">
<Uri>$(DotNetCliPackageUri)</Uri>
<Destination>$(DotNetCliDestination)</Destination>
</HelixCorrelationPayload>
</ItemGroup>
</Target>
</Project>

0 comments on commit 5dc1370

Please sign in to comment.