-
Notifications
You must be signed in to change notification settings - Fork 839
Warn when FSharp.Core major version exceeds SDK compiler version #19183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
6
commits into
main
Choose a base branch
from
copilot/warn-high-fsharp-core-version
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+129
−2
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
62e76b2
Initial plan
Copilot 058695d
Add FSharp.Core version validation implementation and tests
Copilot f65d23c
Fix test framework version to net10.0
Copilot cbfab19
Fix MSBuild property assignment syntax for item metadata
Copilot 90ab65d
Improve MSBuild property function clarity and handle multiple packages
Copilot 13d0360
Add quotes in property function calls for consistency
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
tests/fsharp/SDKTests/tests/FSharpCoreVersion - HigherVersionWarns.proj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <Project ToolsVersion="4.0" DefaultTargets="Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <PropertyGroup> | ||
| <TestFSCorePackageVersion>8.0.100</TestFSCorePackageVersion> | ||
| </PropertyGroup> | ||
| <Import Project="FSharpCoreVersionTest.props" /> | ||
| <PropertyGroup> | ||
| <TestResolvedVersion>9.0.0</TestResolvedVersion> | ||
| <ExpectedMaxMajor>8</ExpectedMaxMajor> | ||
| <ExpectWarning>true</ExpectWarning> | ||
| </PropertyGroup> | ||
| <Import Project="FSharpCoreVersionTest.targets" /> | ||
| </Project> |
12 changes: 12 additions & 0 deletions
12
tests/fsharp/SDKTests/tests/FSharpCoreVersion - LowerVersionNoWarning.proj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <Project ToolsVersion="4.0" DefaultTargets="Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <PropertyGroup> | ||
| <TestFSCorePackageVersion>9.0.100</TestFSCorePackageVersion> | ||
| </PropertyGroup> | ||
| <Import Project="FSharpCoreVersionTest.props" /> | ||
| <PropertyGroup> | ||
| <TestResolvedVersion>8.0.100</TestResolvedVersion> | ||
| <ExpectedMaxMajor>9</ExpectedMaxMajor> | ||
| <ExpectWarning>false</ExpectWarning> | ||
| </PropertyGroup> | ||
| <Import Project="FSharpCoreVersionTest.targets" /> | ||
| </Project> |
12 changes: 12 additions & 0 deletions
12
tests/fsharp/SDKTests/tests/FSharpCoreVersion - PrereleaseParsing.proj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <Project ToolsVersion="4.0" DefaultTargets="Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <PropertyGroup> | ||
| <TestFSCorePackageVersion>9.0.100-preview.1</TestFSCorePackageVersion> | ||
| </PropertyGroup> | ||
| <Import Project="FSharpCoreVersionTest.props" /> | ||
| <PropertyGroup> | ||
| <TestResolvedVersion>10.0.0-beta.1</TestResolvedVersion> | ||
| <ExpectedMaxMajor>9</ExpectedMaxMajor> | ||
| <ExpectWarning>true</ExpectWarning> | ||
| </PropertyGroup> | ||
| <Import Project="FSharpCoreVersionTest.targets" /> | ||
| </Project> |
12 changes: 12 additions & 0 deletions
12
tests/fsharp/SDKTests/tests/FSharpCoreVersion - SameVersionNoWarning.proj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <Project ToolsVersion="4.0" DefaultTargets="Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <PropertyGroup> | ||
| <TestFSCorePackageVersion>9.0.100</TestFSCorePackageVersion> | ||
| </PropertyGroup> | ||
| <Import Project="FSharpCoreVersionTest.props" /> | ||
| <PropertyGroup> | ||
| <TestResolvedVersion>9.0.200</TestResolvedVersion> | ||
| <ExpectedMaxMajor>9</ExpectedMaxMajor> | ||
| <ExpectWarning>false</ExpectWarning> | ||
| </PropertyGroup> | ||
| <Import Project="FSharpCoreVersionTest.targets" /> | ||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
|
|
||
| <Import Project="$(FSharpRepositoryPath)\eng\Versions.props" /> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework Condition="'$(TargetFramework)' == ''">net10.0</TargetFramework> | ||
| <_TargetFrameworkVersionWithoutV>10.0</_TargetFrameworkVersionWithoutV> | ||
| <TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier> | ||
| <Configuration Condition="'$(Configuration)' == ''">Release</Configuration> | ||
| <TargetsDirectory>$(FSharpRepositoryPath)\artifacts\bin\FSharpSuite.Tests\$(Configuration)\$(TARGETFRAMEWORK)</TargetsDirectory> | ||
| <Platform Condition="'$(Platform)' == ''">AnyCPU</Platform> | ||
| <OutputPath>$(MSBuildThisFileDirectory)</OutputPath> | ||
| </PropertyGroup> | ||
|
|
||
| <!-- Override SDK version BEFORE import --> | ||
| <PropertyGroup Condition="'$(TestFSCorePackageVersion)' != ''"> | ||
| <FSCorePackageVersion>$(TestFSCorePackageVersion)</FSCorePackageVersion> | ||
| <FSCorePackageVersionSet>true</FSCorePackageVersionSet> | ||
| </PropertyGroup> | ||
|
|
||
| <Import Project="$(TargetsDirectory)\Microsoft.FSharp.NetSdk.props" /> | ||
|
|
||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
|
|
||
| <Import Project="$(TargetsDirectory)\Microsoft.FSharp.NetSdk.targets" /> | ||
|
|
||
| <Target Name="Test"> | ||
| <Message Importance="High" Text="Testing: $(MSBuildProjectName)" /> | ||
|
|
||
| <!-- Simulate version comparison --> | ||
| <PropertyGroup Condition="'$(TestResolvedVersion)' != ''"> | ||
| <_TestResolvedMajor>$([System.Version]::Parse('$(TestResolvedVersion.Split('-')[0])').Major)</_TestResolvedMajor> | ||
| <_TestShouldWarn Condition="$(_TestResolvedMajor) > $(FSharpCoreMaximumMajorVersion)">true</_TestShouldWarn> | ||
| </PropertyGroup> | ||
|
|
||
| <!-- Assertions --> | ||
| <Error Condition="'$(ExpectedMaxMajor)' != '' and '$(FSharpCoreMaximumMajorVersion)' != '$(ExpectedMaxMajor)'" | ||
| Text="FSharpCoreMaximumMajorVersion: expected '$(ExpectedMaxMajor)' actual '$(FSharpCoreMaximumMajorVersion)'" /> | ||
|
|
||
| <Error Condition="'$(ExpectWarning)' == 'true' and '$(_TestShouldWarn)' != 'true'" | ||
| Text="Expected warning but didn't get one" /> | ||
|
|
||
| <Error Condition="'$(ExpectWarning)' == 'false' and '$(_TestShouldWarn)' == 'true'" | ||
| Text="Did not expect warning but got one" /> | ||
|
|
||
| <Message Importance="High" Text="PASSED: $(MSBuildProjectName)" /> | ||
| </Target> | ||
|
|
||
| </Project> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.