Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<Project>
<PropertyGroup>
<IncludeDotNetCli Condition=" '$(IncludeDotNetCli)' != 'true' ">false</IncludeDotNetCli>
<AspNetCoreRuntimeVersion>6.0.0-preview.2.21154.6</AspNetCoreRuntimeVersion>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also please use this property inside XHarnessRunner.targets?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@premun Check out the latest push and see if you think this will work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonfortescue it didn't work out of the box? without pulling the property in its own file?

I think the whole DotNetCli is included for Helix SDK already

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am meaning to say - did you just try using the property without any other changes?

<DotNetCliPackageType Condition=" '$(DotNetCliPackageType)' == '' ">runtime</DotNetCliPackageType>
<DotNetCliVersion Condition=" '$(DotNetCliVersion)' == '' AND '$(DotNetCliPackageType)' == 'runtime' ">$(BundledNETCoreAppPackageVersion)</DotNetCliVersion>
<!-- TODO (https://github.com/dotnet/arcade/issues/7022): We are hardcoding this version to use the one tied to the SDK version from global.json -->
<DotNetCliVersion Condition=" '$(DotNetCliVersion)' == '' AND '$(DotNetCliPackageType)' == 'aspnetcore-runtime' ">6.0.0-preview.2.21154.6</DotNetCliVersion>
<DotNetCliVersion Condition=" '$(DotNetCliVersion)' == '' AND '$(DotNetCliPackageType)' == 'aspnetcore-runtime' ">$(AspNetCoreRuntimeVersion)</DotNetCliVersion>
<DotNetCliVersion Condition=" '$(DotNetCliVersion)' == '' AND '$(DotNetCliPackageType)' == 'sdk' ">$(NETCoreSdkVersion)</DotNetCliVersion>
<DotNetCliChannel Condition=" '$(DotNetCliChannel)' == '' ">Current</DotNetCliChannel>
<DotNetCliDestination>dotnet-cli</DotNetCliDestination>
Expand Down
29 changes: 29 additions & 0 deletions tests/ASPNETVersionCheck/aspnet-versioncheck.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Param(
[string] $aspNetCoreVersion
)

$versionRegex = "(?<version>\d+\.\d+)\.\d+(?:-(?<preview>\w+\.\d+)\.\d+\.\d+)?"

$dotnetVersion = & dotnet --version
$dotNetSdkMatch = $dotnetVersion -Match $versionRegex
if ($dotNetSdkMatch -eq $false) {
Write-Host ".NET SDK version '$dotnetVersion' did not match regex!"
exit 2
}
$dotnetMajorVersion = $Matches.version
$dotnetPreviewVersion = $Matches.preview
Write-Host ".NET SDK '$dotnetVersion' -- major version: '$dotnetMajorVersion'; preview: '$dotnetPreviewVersion'"

$aspNetCoreMatch = $aspNetCoreVersion -Match $versionRegex
if ($aspNetCoreMatch -eq $false) {
Write-Host "ASP.NET Core Runtime version '$aspNetCoreVersion' did not match regex!"
exit 3
}
$aspNetCoreMajorVersion = $Matches.version
$aspNetCorePreviewVersion = $Matches.preview
Write-Host "ASP.NET SDK '$aspNetCoreVersion' -- major version: '$aspNetCoreMajorVersion'; preview: '$aspNetCorePreviewVersion'"

if ($dotnetMajorVersion -ne $aspNetCoreMajorVersion -or $dotnetPreviewVersion -ne $aspNetCorePreviewVersion) {
Write-Host "ASP.NET Core Runtime version and .NET Core Runtime version do not match -- update DotNetCli.props!"
exit 1
}
7 changes: 7 additions & 0 deletions tests/UnitTests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,11 @@
<!-- <Import Sdk="Microsoft.DotNet.Helix.Sdk" Project="Sdk.targets"/> -->
<!-- Using locally built version of the helix sdk, normal projects replace the below Import with the SDK import above-->
<Import Project="$(MSBuildThisFileDirectory)\..\src\Microsoft.DotNet.Helix\Sdk\sdk\Sdk.targets"/>

<ItemGroup>
<HelixWorkItem Condition="$(HelixTargetQueue.StartsWith('Windows'))" Include="AspNetCoreTest">
<Command>powershell %HELIX_WORKITEM_PAYLOAD%\aspnet-versioncheck.ps1 -aspNetCoreVersion $(AspNetCoreRuntimeVersion)</Command>
<PayloadDirectory>$(MSBuildThisFileDirectory)\AspNetVersionCheck</PayloadDirectory>
</HelixWorkItem>
</ItemGroup>
</Project>