Skip to content
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
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ The build script `build.ps1` can be used to bootstrap, build and test the projec

* Bootstrap: `./build.ps1 -Bootstrap`
* Build:
* Targeting .NET 4.6.1 (Windows only): `./build.ps1 -Configuration Debug -Framework net461`
* Targeting .NET 4.6.2 (Windows only): `./build.ps1 -Configuration Debug -Framework net462`
* Targeting .NET Core: `./build.ps1 -Configuration Debug -Framework netcoreapp2.1`
* Test:
* Targeting .NET 4.6.1 (Windows only): `./build.ps1 -Test -Configuration Debug -Framework net461`
* Targeting .NET 4.6.2 (Windows only): `./build.ps1 -Test -Configuration Debug -Framework net462`
* Targeting .NET Core: `./build.ps1 -Test -Configuration Debug -Framework netcoreapp2.1`

After build, the produced artifacts can be found at `<your-local-repo-root>/bin/Debug`.
Expand Down
2 changes: 1 addition & 1 deletion .vsts-ci/releaseBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ stages:
Write-Host "PS Version: $($($PSVersionTable.PSVersion))"
Set-Location -Path '$(Build.SourcesDirectory)\PSReadLine'
.\build.ps1 -Bootstrap
.\build.ps1 -Configuration Release -Framework net461 -CheckHelpContent
.\build.ps1 -Configuration Release -Framework net462 -CheckHelpContent

# Set target folder paths
New-Item -Path .\bin\Release\NuGetPackage -ItemType Directory > $null
Expand Down
4 changes: 2 additions & 2 deletions MockPSConsole/MockPSConsole.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<OutputType>Exe</OutputType>
<RootNamespace>MockPSConsole</RootNamespace>
<AssemblyName>MockPSConsole</AssemblyName>
<TargetFrameworks>net461;net6.0</TargetFrameworks>
<TargetFrameworks>net462;net6.0</TargetFrameworks>
<FileAlignment>512</FileAlignment>
<ApplicationManifest>Program.manifest</ApplicationManifest>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<PackageReference Include="System.Xml.XDocument" version="4.3.0" />
<PackageReference Include="System.Data.DataSetExtensions" version="4.5.0" />
<PackageReference Include="Microsoft.CSharp" version="4.7.0" />
Expand Down
18 changes: 9 additions & 9 deletions PSReadLine.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ param(
[ValidateSet("Debug", "Release")]
[string]$Configuration = (property Configuration Release),

[ValidateSet("net461", "net6.0")]
[ValidateSet("net462", "net6.0")]
[string]$Framework,

[switch]$CheckHelpContent
Expand All @@ -32,7 +32,7 @@ $targetDir = "bin/$Configuration/PSReadLine"

if (-not $Framework)
{
$Framework = if ($PSVersionTable.PSEdition -eq "Core") { "net6.0" } else { "net461" }
$Framework = if ($PSVersionTable.PSEdition -eq "Core") { "net6.0" } else { "net462" }
}

Write-Verbose "Building for '$Framework'" -Verbose
Expand Down Expand Up @@ -64,9 +64,9 @@ $mockPSConsoleParams = @{
<#
Synopsis: Build the Polyfiller assembly
#>
task BuildPolyfiller @polyFillerParams -If ($Framework -eq "net461") {
## Build both "net461" and "net6.0"
exec { dotnet publish -f "net461" -c $Configuration Polyfill }
task BuildPolyfiller @polyFillerParams -If ($Framework -eq "net462") {
## Build both "net462" and "net6.0"
exec { dotnet publish -f "net462" -c $Configuration Polyfill }
exec { dotnet publish -f "net6.0" -c $Configuration Polyfill }
}

Expand Down Expand Up @@ -128,15 +128,15 @@ task LayoutModule BuildPolyfiller, BuildMainModule, {
Set-Content -Path (Join-Path $targetDir (Split-Path $file -Leaf)) -Value (ConvertTo-CRLF $content) -Force
}

if ($Framework -eq "net461") {
if (-not (Test-Path "$targetDir/net461")) {
New-Item "$targetDir/net461" -ItemType Directory -Force > $null
if ($Framework -eq "net462") {
if (-not (Test-Path "$targetDir/net462")) {
New-Item "$targetDir/net462" -ItemType Directory -Force > $null
}
if (-not (Test-Path "$targetDir/net6plus")) {
New-Item "$targetDir/net6plus" -ItemType Directory -Force > $null
}

Copy-Item "Polyfill/bin/$Configuration/net461/Microsoft.PowerShell.PSReadLine.Polyfiller.dll" "$targetDir/net461" -Force
Copy-Item "Polyfill/bin/$Configuration/net462/Microsoft.PowerShell.PSReadLine.Polyfiller.dll" "$targetDir/net462" -Force
Copy-Item "Polyfill/bin/$Configuration/net6.0/Microsoft.PowerShell.PSReadLine.Polyfiller.dll" "$targetDir/net6plus" -Force
}

Expand Down
2 changes: 1 addition & 1 deletion PSReadLine/OnImportAndRemove.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private static Assembly ResolveAssembly(object sender, ResolveEventArgs args)
}

string root = Path.GetDirectoryName(typeof(OnModuleImportAndRemove).Assembly.Location);
string subd = (Environment.Version.Major >= 6) ? "net6plus" : "net461";
string subd = (Environment.Version.Major >= 6) ? "net6plus" : "net462";
string path = Path.Combine(root, subd, "Microsoft.PowerShell.PSReadLine.Polyfiller.dll");

return Assembly.LoadFrom(path);
Expand Down
4 changes: 2 additions & 2 deletions PSReadLine/PSReadLine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<FileVersion>2.2.3</FileVersion>
<InformationalVersion>2.2.3</InformationalVersion>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<TargetFrameworks>net461;net6.0</TargetFrameworks>
<TargetFrameworks>net462;net6.0</TargetFrameworks>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
<LangVersion>9.0</LangVersion>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<PackageReference Include="PowerShellStandard.Library" version="5.1.0" />
<PackageReference Include="Microsoft.CSharp" version="4.7.0" />
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" />
Expand Down
2 changes: 1 addition & 1 deletion PSReadLine/PSReadLine.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CompanyName = 'Microsoft Corporation'
Copyright = '(c) Microsoft Corporation. All rights reserved.'
Description = 'Great command line editing in the PowerShell console host'
PowerShellVersion = '5.0'
DotNetFrameworkVersion = '4.6.1'
DotNetFrameworkVersion = '4.6.2'
CLRVersion = '4.0.0'
FormatsToProcess = 'PSReadLine.format.ps1xml'
AliasesToExport = @()
Expand Down
2 changes: 1 addition & 1 deletion PSReadLine/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"profiles": {
"PSReadLine-net461": {
"PSReadLine-net462": {
"commandName": "Executable",
"executablePath": "powershell",
"commandLineArgs": "-NoProfile -NonInteractive -NoExit -Command Import-Module .\\PSReadLine.psd1"
Expand Down
6 changes: 3 additions & 3 deletions Polyfill/Polyfill.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
<PropertyGroup>
<AssemblyName>Microsoft.PowerShell.PSReadLine.Polyfiller</AssemblyName>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<TargetFrameworks>net461;net6.0</TargetFrameworks>
<TargetFrameworks>net462;net6.0</TargetFrameworks>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<PackageReference Include="PowerShellStandard.Library" Version="5.1.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="System.Management.Automation" Version="7.2.0" />
</ItemGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net462'">
<DefineConstants>$(DefineConstants);LEGACY</DefineConstants>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,10 @@ The build script `build.ps1` can be used to bootstrap, build and test the projec

* Bootstrap: `./build.ps1 -Bootstrap`
* Build:
* Targeting .NET 4.6.1 (Windows only): `./build.ps1 -Configuration Debug -Framework net461`
* Targeting .NET 4.6.2 (Windows only): `./build.ps1 -Configuration Debug -Framework net462`
* Targeting .NET Core: `./build.ps1 -Configuration Debug -Framework netcoreapp2.1`
* Test:
* Targeting .NET 4.6.1 (Windows only): `./build.ps1 -Test -Configuration Debug -Framework net461`
* Targeting .NET 4.6.2 (Windows only): `./build.ps1 -Test -Configuration Debug -Framework net462`
* Targeting .NET Core: `./build.ps1 -Test -Configuration Debug -Framework netcoreapp2.1`

After build, the produced artifacts can be found at `<your-local-repo-root>/bin/Debug`.
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ install:

build_script:
- pwsh: |
./build.ps1 -Configuration Release -Framework net461
./build.ps1 -Configuration Release -Framework net462

test_script:
- pwsh: ./build.ps1 -Test -Configuration Release -Framework net461
- pwsh: ./build.ps1 -Test -Configuration Release -Framework net462

artifacts:
- path: .\bin\Release\PSReadLine.zip
8 changes: 4 additions & 4 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
PS > .\build.ps1 -Bootstrap
Check and install prerequisites for the build.
.EXAMPLE
PS > .\build.ps1 -Configuration Release -Framework net461
Build the main module with 'Release' configuration and targeting 'net461'.
PS > .\build.ps1 -Configuration Release -Framework net462
Build the main module with 'Release' configuration and targeting 'net462'.
.EXAMPLE
PS > .\build.ps1
Build the main module with the default configuration (Debug) and the default target framework (determined by the current session).
Expand All @@ -27,7 +27,7 @@
The target framework for the build.
When not specified, the target framework is determined by the current PowerShell session:
- If the current session is PowerShell Core, then use 'netcoreapp3.1' as the default target framework.
- If the current session is Windows PowerShell, then use 'net461' as the default target framework.
- If the current session is Windows PowerShell, then use 'net462' as the default target framework.
#>
[CmdletBinding()]
param(
Expand All @@ -39,7 +39,7 @@ param(
[ValidateSet("Debug", "Release")]
[string] $Configuration = "Debug",

[ValidateSet("net461", "net6.0")]
[ValidateSet("net462", "net6.0")]
[string] $Framework
)

Expand Down
4 changes: 2 additions & 2 deletions test/PSReadLine.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<OutputType>library</OutputType>
<RootNamespace>UnitTestPSReadLine</RootNamespace>
<AssemblyName>PSReadLine.Tests</AssemblyName>
<TargetFrameworks>net461;net6.0</TargetFrameworks>
<TargetFrameworks>net462;net6.0</TargetFrameworks>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<IsCodedUITest>False</IsCodedUITest>
Expand All @@ -14,7 +14,7 @@
<LangVersion>9.0</LangVersion>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<PackageReference Include="System.Xml.XDocument" version="4.3.0" />
<PackageReference Include="System.Data.DataSetExtensions" version="4.5.0" />
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" />
Expand Down
13 changes: 0 additions & 13 deletions test/packages.config

This file was deleted.