-
Notifications
You must be signed in to change notification settings - Fork 237
Migrate to netstandard2.0 and PSStandard #741
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
Changes from 10 commits
dc7cae2
624f7fe
3cda894
187aea6
bdf008e
3ba9c0a
3567a2d
15dcb61
e622473
a929752
05d2f44
f5114c8
e189f87
f220082
071b7e0
9304ba0
8fc5b68
7146a05
d9f3168
66bf56f
6fac967
7651f0f
f8f60bd
1525ff8
88639c5
d8f4b2e
32b770f
395771e
f5cfe42
02ee0e8
b8482c5
063dadc
25c322b
0a66601
d5cbd9a
e1d0ac3
e978b7c
3c13822
f8c462c
38bce43
12b4cb6
b47d915
8b86ac9
0bac8b6
4297563
59edb3c
865dc97
32e13fe
514ccf0
2f870b7
ff1b14d
05ed5b5
8677a7a
f08b6a9
da2e0b0
cdccf3a
354da07
6a60e46
e7a3cc9
6cc0fb3
3462b23
f9d3018
86601f4
3511ed6
c69610e
131e51f
271df79
d99fbb6
784cef5
71c9ee9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,16 +18,17 @@ param( | |
|
||
$script:IsCIBuild = $env:APPVEYOR -ne $null | ||
$script:IsUnix = $PSVersionTable.PSEdition -and $PSVersionTable.PSEdition -eq "Core" -and !$IsWindows | ||
$script:TargetFrameworksParam = "/p:TargetFrameworks=\`"$(if (!$script:IsUnix) { "net451;" })netstandard1.6\`"" | ||
$script:TargetPlatform = "netstandard2.0" | ||
$script:TargetFrameworksParam = "/p:TargetFrameworks=`"$script:TargetPlatform`"" | ||
$script:SaveModuleSupportsAllowPrerelease = (Get-Command Save-Module).Parameters.ContainsKey("AllowPrerelease") | ||
|
||
if ($PSVersionTable.PSEdition -ne "Core") { | ||
Add-Type -Assembly System.IO.Compression.FileSystem | ||
} | ||
|
||
task SetupDotNet -Before Clean, Build, TestHost, TestServer, TestProtocol, TestPowerShellApi, PackageNuGet { | ||
task SetupDotNet -Before Clean, Build, TestHost, TestServer, TestProtocol, PackageNuGet { | ||
|
||
$requiredSdkVersion = "2.0.0" | ||
$requiredSdkVersion = "2.1.300" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. did you really need a newer version of this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed this to 2.1.301 (I think that's a stable one?) -- I needed to change it to get things to work There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now changed to 2.1.401 since that's the latest release. I had to update, and there doesn't seem to be a reason to not update to the latest. |
||
|
||
$dotnetPath = "$PSScriptRoot/.dotnet" | ||
$dotnetExePath = if ($script:IsUnix) { "$dotnetPath/dotnet" } else { "$dotnetPath/dotnet.exe" } | ||
|
@@ -128,30 +129,14 @@ task GetProductVersion -Before PackageNuGet, PackageModule, UploadArtifacts { | |
Write-Host "`n### Product Version: $script:FullVersion`n" -ForegroundColor Green | ||
} | ||
|
||
function BuildForPowerShellVersion($version) { | ||
Write-Host -ForegroundColor Green "`n### Testing API usage for PowerShell $version...`n" | ||
exec { & $script:dotnetExe build -f net451 .\src\PowerShellEditorServices\PowerShellEditorServices.csproj /p:PowerShellVersion=$version } | ||
} | ||
|
||
task TestPowerShellApi -If { !$script:IsUnix } { | ||
BuildForPowerShellVersion v3 | ||
BuildForPowerShellVersion v4 | ||
BuildForPowerShellVersion v5r1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😎 |
||
|
||
# Do a final restore to put everything back to normal | ||
exec { & $script:dotnetExe restore .\src\PowerShellEditorServices\PowerShellEditorServices.csproj } | ||
} | ||
|
||
task Build { | ||
exec { & $script:dotnetExe publish -c $Configuration .\src\PowerShellEditorServices.Host\PowerShellEditorServices.Host.csproj -f netstandard1.6 } | ||
if (!$script:IsUnix) { | ||
exec { & $script:dotnetExe publish -c $Configuration .\src\PowerShellEditorServices.Host\PowerShellEditorServices.Host.csproj -f net451 } | ||
} | ||
exec { & $script:dotnetExe restore } | ||
exec { & $script:dotnetExe publish -c $Configuration .\src\PowerShellEditorServices.Host\PowerShellEditorServices.Host.csproj -f $script:TargetPlatform } | ||
exec { & $script:dotnetExe build -c $Configuration .\src\PowerShellEditorServices.VSCode\PowerShellEditorServices.VSCode.csproj $script:TargetFrameworksParam } | ||
exec { & $script:dotnetExe publish -c $Configuration .\src\PowerShellEditorServices\PowerShellEditorServices.csproj -f netstandard1.6 } | ||
Copy-Item $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\netstandard1.6\publish\UnixConsoleEcho.dll -Destination $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\netstandard1.6 | ||
Copy-Item $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\netstandard1.6\publish\runtimes\osx-64\native\libdisablekeyecho.dylib -Destination $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\netstandard1.6 | ||
Copy-Item $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\netstandard1.6\publish\runtimes\linux-64\native\libdisablekeyecho.so -Destination $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\netstandard1.6 | ||
exec { & $script:dotnetExe publish -c $Configuration .\src\PowerShellEditorServices\PowerShellEditorServices.csproj -f $script:TargetPlatform } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: can you put the PSES.VSCode one on the bottom since that is separate to the actual PSES module? |
||
Copy-Item $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\$script:TargetPlatform\publish\UnixConsoleEcho.dll -Destination $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\$script:TargetPlatform | ||
Copy-Item $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\$script:TargetPlatform\publish\runtimes\osx-64\native\libdisablekeyecho.dylib -Destination $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\$script:TargetPlatform | ||
Copy-Item $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\$script:TargetPlatform\publish\runtimes\linux-64\native\libdisablekeyecho.so -Destination $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\$script:TargetPlatform | ||
} | ||
|
||
function UploadTestLogs { | ||
|
@@ -174,22 +159,40 @@ function UploadTestLogs { | |
|
||
task Test TestServer,TestProtocol,TestHost | ||
|
||
task TestServer -If { !$script:IsUnix } { | ||
task TestServer { | ||
Set-Location .\test\PowerShellEditorServices.Test\ | ||
exec { & $script:dotnetExe build -c $Configuration -f net452 } | ||
exec { & $script:dotnetExe xunit -configuration $Configuration -framework net452 -verbose -nobuild } | ||
|
||
if (-not $script:IsUnix) { | ||
exec { & $script:dotnetExe build -c $Configuration -f net461 } | ||
exec { & $script:dotnetExe xunit -configuration $Configuration -framework net461 -verbose -nobuild } | ||
} | ||
|
||
exec { & $script:dotnetExe build -c $Configuration -f netcoreapp2.1 } | ||
exec { & $script:dotnetExe test -f netcoreapp2.1 } | ||
} | ||
|
||
task TestProtocol -If { !$script:IsUnix } { | ||
task TestProtocol { | ||
Set-Location .\test\PowerShellEditorServices.Test.Protocol\ | ||
exec { & $script:dotnetExe build -c $Configuration -f net452 } | ||
exec { & $script:dotnetExe xunit -configuration $Configuration -framework net452 -verbose -nobuild } | ||
|
||
if (-not $script:IsUnix) { | ||
exec { & $script:dotnetExe build -c $Configuration -f net461 } | ||
exec { & $script:dotnetExe xunit -configuration $Configuration -framework net461 -verbose -nobuild } | ||
} | ||
|
||
exec { & $script:dotnetExe build -c $Configuration -f netcoreapp2.1 } | ||
exec { & $script:dotnetExe test -f netcoreapp2.1 } | ||
} | ||
|
||
task TestHost -If { !$script:IsUnix } { | ||
task TestHost -If { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there still is a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. p.s. I thought these were the evil tests. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah yes! I thought I fixed this already but evidently not |
||
Set-Location .\test\PowerShellEditorServices.Test.Host\ | ||
exec { & $script:dotnetExe build -c $Configuration -f net452 } | ||
exec { & $script:dotnetExe xunit -configuration $Configuration -framework net452 -verbose -nobuild } | ||
|
||
if (-not $script:IsUnix) { | ||
exec { & $script:dotnetExe build -c $Configuration -f net461 } | ||
exec { & $script:dotnetExe xunit -configuration $Configuration -framework net461 -verbose -nobuild } | ||
} | ||
|
||
exec { & $script:dotnetExe build -c $Configuration -f netcoreapp2.1 } | ||
exec { & $script:dotnetExe test -f netcoreapp2.1 } | ||
} | ||
|
||
task CITest ?Test, { | ||
|
@@ -207,21 +210,12 @@ task LayoutModule -After Build { | |
New-Item -Force $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop -Type Directory | Out-Null | ||
New-Item -Force $PSScriptRoot\module\PowerShellEditorServices\bin\Core -Type Directory | Out-Null | ||
|
||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\netstandard1.6\publish\Serilog*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Core\ | ||
|
||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\netstandard1.6\* -Filter Microsoft.PowerShell.EditorServices*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Core\ | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\netstandard1.6\UnixConsoleEcho.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Core\ | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\netstandard1.6\libdisablekeyecho.* -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Core\ | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\netstandard1.6\publish\runtimes\win\lib\netstandard1.3\* -Filter System.IO.Pipes*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Core\ | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\$script:TargetPlatform\publish\Serilog*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Core\ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As @SeeminglyScience said, we don't need to put this in |
||
|
||
if (!$script:IsUnix) { | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\net451\Serilog*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop | ||
|
||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net451\* -Filter Microsoft.PowerShell.EditorServices*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\ | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net451\Newtonsoft.Json.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\ | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net451\UnixConsoleEcho.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\ | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net451\publish\System.Runtime.InteropServices.RuntimeInformation.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\ | ||
} | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\$script:TargetPlatform\* -Filter Microsoft.PowerShell.EditorServices*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Core\ | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\$script:TargetPlatform\UnixConsoleEcho.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Core\ | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\$script:TargetPlatform\libdisablekeyecho.* -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Core\ | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\$script:TargetPlatform\publish\runtimes\win\lib\netstandard1.3\* -Filter System.IO.Pipes*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Core\ | ||
|
||
# Copy Third Party Notices.txt to module folder | ||
Copy-Item -Force -Path "$PSScriptRoot\Third Party Notices.txt" -Destination $PSScriptRoot\module\PowerShellEditorServices | ||
|
@@ -231,23 +225,13 @@ task LayoutModule -After Build { | |
New-Item -Force $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin\Desktop -Type Directory | Out-Null | ||
New-Item -Force $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin\Core -Type Directory | Out-Null | ||
|
||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.VSCode\bin\$Configuration\netstandard1.6\* -Filter Microsoft.PowerShell.EditorServices.VSCode*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin\Core\ | ||
if (!$script:IsUnix) { | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.VSCode\bin\$Configuration\net451\* -Filter Microsoft.PowerShell.EditorServices.VSCode*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin\Desktop\ | ||
} | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.VSCode\bin\$Configuration\$script:TargetPlatform\* -Filter Microsoft.PowerShell.EditorServices.VSCode*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin\Core\ | ||
|
||
if ($Configuration -eq "Debug") { | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.VSCode\bin\$Configuration\netstandard1.6\Microsoft.PowerShell.EditorServices.VSCode.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin\Core\ | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\netstandard1.6\Microsoft.PowerShell.EditorServices.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Core\ | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\netstandard1.6\Microsoft.PowerShell.EditorServices.Host.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Core\ | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Protocol\bin\$Configuration\netstandard1.6\Microsoft.PowerShell.EditorServices.Protocol.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Core\ | ||
|
||
if (!$script:IsUnix) { | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.VSCode\bin\$Configuration\net451\Microsoft.PowerShell.EditorServices.VSCode.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin\Desktop\ | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\net451\Microsoft.PowerShell.EditorServices.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\ | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net451\Microsoft.PowerShell.EditorServices.Host.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\ | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Protocol\bin\$Configuration\net451\Microsoft.PowerShell.EditorServices.Protocol.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\ | ||
} | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.VSCode\bin\$Configuration\$script:TargetPlatform\Microsoft.PowerShell.EditorServices.VSCode.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin\Core\ | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\$script:TargetPlatform\Microsoft.PowerShell.EditorServices.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Core\ | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\$script:TargetPlatform\Microsoft.PowerShell.EditorServices.Host.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Core\ | ||
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Protocol\bin\$Configuration\$script:TargetPlatform\Microsoft.PowerShell.EditorServices.Protocol.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Core\ | ||
} | ||
} | ||
|
||
|
@@ -359,4 +343,4 @@ task UploadArtifacts -If ($script:IsCIBuild) { | |
} | ||
|
||
# The default task is to run the entire CI build | ||
task . GetProductVersion, Clean, Build, TestPowerShellApi, CITest, BuildCmdletHelp, PackageNuGet, PackageModule, UploadArtifacts | ||
task . GetProductVersion, Clean, Build, CITest, BuildCmdletHelp, PackageNuGet, PackageModule, UploadArtifacts |
Uh oh!
There was an error while loading. Please reload this page.