Skip to content
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

Upgrade to use .NET 6 since PowerShell 7.0 is now out out of support #1873

Merged
merged 1 commit into from
Sep 17, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 5 additions & 5 deletions Engine/Engine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<VersionPrefix>1.21.0</VersionPrefix>
<TargetFrameworks>netcoreapp3.1;net462</TargetFrameworks>
<TargetFrameworks>net6;net462</TargetFrameworks>
<AssemblyName>Microsoft.Windows.PowerShell.ScriptAnalyzer</AssemblyName>
<AssemblyVersion>1.21.0</AssemblyVersion>
<PackageId>Engine</PackageId>
Expand All @@ -18,11 +18,11 @@
<DebugType>portable</DebugType>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<PropertyGroup Condition=" '$(TargetFramework)' == 'net6' ">
<DefineConstants>$(DefineConstants);CORECLR</DefineConstants>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net6' ">
<Compile Remove="SafeDirectoryCatalog.cs" />
</ItemGroup>

Expand Down Expand Up @@ -63,10 +63,10 @@
</EmbeddedResource>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<ItemGroup Condition="'$(TargetFramework)' == 'net6'">
<PackageReference Include="System.Management.Automation" Version="7.0.11" />
</ItemGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net6'">
<DefineConstants>$(DefineConstants);PSV7;CORECLR</DefineConstants>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ To install **PSScriptAnalyzer** from source code:

### Requirements

- [.NET Core 3.1.424 SDK](https://www.microsoft.com/net/download/dotnet-core/3.1#sdk-3.1.424) or
- [.NET 6.0.11 containing 6.0.403 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) or
newer patch release
* If building for Windows PowerShell versions, then the .NET Framework 4.6.2 [targeting pack](https://dotnet.microsoft.com/en-us/download/dotnet-framework/net462) (also referred to as developer/targeting pack) need to be installed. This is only possible on Windows.
* Optionally but recommended for development: [Visual Studio 2017/2019](https://www.visualstudio.com/downloads)
Expand Down
6 changes: 3 additions & 3 deletions Rules/Rules.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<VersionPrefix>1.21.0</VersionPrefix>
<TargetFrameworks>netcoreapp3.1;net462</TargetFrameworks>
<TargetFrameworks>net6;net462</TargetFrameworks>
<AssemblyName>Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules</AssemblyName>
<AssemblyVersion>1.21.0</AssemblyVersion>
<PackageId>Rules</PackageId>
Expand All @@ -16,7 +16,7 @@

</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net6' ">
<!-- The version of Newtonsoft.Json needs to be newer than the version in the oldest supported version of PowerShell 7: https://github.com/PowerShell/PowerShell/blob/v7.0.11/src/System.Management.Automation/System.Management.Automation.csproj#L15 -->
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.7.0" />
Expand Down Expand Up @@ -57,7 +57,7 @@
<DefineConstants>$(DefineConstants);PSV3;PSV4</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net6'">
<DefineConstants>$(DefineConstants);PSV7;CORECLR</DefineConstants>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ build_script:
if ($env:PowerShellEdition -eq 'PowerShellCore') {
Set-Location $env:APPVEYOR_BUILD_FOLDER
./build.ps1 -Configuration "$env:BuildConfiguration" -PSVersion 7
./PSCompatibilityCollector/build.ps1 -Configuration "$env:BuildConfiguration" -Framework 'netcoreapp3.1'
./PSCompatibilityCollector/build.ps1 -Configuration "$env:BuildConfiguration" -Framework 'net6'
}

test_script:
Expand Down
2 changes: 1 addition & 1 deletion build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function Start-ScriptAnalyzerBuild

$framework = 'net462'
if ($PSVersion -eq 7) {
$framework = 'netcoreapp3.1'
$framework = 'net6'
}

# build the appropriate assembly
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "3.1.424"
"version": "6.0.403"
}
}