-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Added .NET 8 target #696
base: main
Are you sure you want to change the base?
Added .NET 8 target #696
Conversation
1.1 Aligned package versions with respective targets (.NET 6, netstandard2.0, .NET 8.0) 1.2 Removed .NET 7.0 target 1.3 Removed direct targets on the library for .NET Framework and only left netstandard2.0 because of dependencies, netstandard2.0 reference required anyways and there is no point to split targets on the library itself. 2. StyleCop is deprecated 2.1 Removed StyleCop 2.2 Added Microsoft.CodeAnalysis.NetAnalyzers 2.3 Fixed nullable references issues and other minor issues 3. Moved packages for unit tests out of .props file 4. Upgraded xUnit 4.1 Fixed xUnit warnings 5. Upgraded the rest of packages in unit tests Signed-off-by: Aliaksandr Kukrash <[email protected]>
…ect settings to .props file Signed-off-by: Aliaksandr Kukrash <[email protected]>
Signed-off-by: Aliaksandr Kukrash <[email protected]>
Signed-off-by: Aliaksandr Kukrash <[email protected]>
… latest .NET version in dotnet-install.sh Signed-off-by: Aliaksandr Kukrash <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey - appreciate the effort you went to with this PR. I've added some comments.
inputs: | ||
packageType: "sdk" | ||
useGlobalJson: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What made you want to switch from the global.json being used to specifying the .NET 8 SDK manually? Just consistency with the others?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, you would use latest available patch when building project as opposed to whatever is laying around in your global.json, unless there is a compatibility issue. This was the reason of removal
<TargetPathWithTargetPlatformMoniker Include="$(PKGSystem_Threading_Tasks_Extensions)\lib\netstandard2.0\*.dll" IncludeRuntimeDependency="false" /> | ||
</ItemGroup> | ||
</Target> | ||
<!-- <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole section was to work around transitive dependency issues with source generators (basically if your dependencies have dependencies, you need to specify them all for source generators). Did you not have issues with this with the code compiling?
I guess my only thought is the lock files may help resolve this but I haven't seen anyone mention that on the discussions on GitHub about source generators before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have repro steps for this? I will check and add some tests as well to cover this case.
@@ -1,62 +1,42 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
|
|||
<PropertyGroup Label="Build"> | |||
<TargetFrameworks>netstandard2.0</TargetFrameworks> | |||
<TargetFrameworks>net8.0;net6.0;netstandard2.0</TargetFrameworks> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Source generators can only target netstandard2.0
unfortunately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is interesting. Purely speaking you can use any target for source generator: after all this is just Roslyn, you have all targets available. But! It only works in console (dotnet command line) and in Rider IDE. Visual Studio and MSBuild cannot do that properly and spawns all sorts of issues (missing references, not able to compile, etc.)
As opposed to command line (view from Rider):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can even remove netstandard2.0 completely from the targets and it continues to function no problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will look into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I split Tool project into separate projects to allow proper package versioning for different targets when built from console (and published as a package) - as you cannot properly reference different versions of System.Text.Json and others from within single target. While allowing usage from Visual Studio and falling back to netstandard2.0 only.
@@ -1,13 +1,27 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
|
|||
<PropertyGroup Label="Build"> | |||
<TargetFrameworks>net7.0;net6.0;net472</TargetFrameworks> | |||
<TargetFrameworks>net8.0;net6.0;net462;net472;net48</TargetFrameworks> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how necessary it is to test 3 different versions of .NET Framework. I'd personally be happy to just test one .NET Framework version (likely 4.8).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a harm of listing major relevant versions in here. Benchmarks is another story and probably it worth removing. But I agree, generally speaking it shouldn't matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please let me know how to proceed here. Keep all net versions or leave net48 only?
Signed-off-by: Aliaksandr Kukrash <[email protected]>
…other IDEs and dotnet command line. Signed-off-by: Aliaksandr Kukrash <[email protected]>
Signed-off-by: Aliaksandr Kukrash <[email protected]>
34e1c81
to
e9214e5
Compare
Signed-off-by: Aliaksandr Kukrash <[email protected]>
Signed-off-by: Aliaksandr Kukrash <[email protected]>
Signed-off-by: Aliaksandr Kukrash <[email protected]>
Added .NET 8 Support
StyleCop is deprecated
Moved packages for unit tests out of .props file
Upgraded xUnit
Upgraded the rest of packages in unit tests
Added packages packages.lock.json for repeatable restore