Skip to content

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

Merged
merged 70 commits into from
Oct 2, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
dc7cae2
Move PSES builds to netstandard and use PSStandard APIs
rjmholt Aug 29, 2018
624f7fe
Fix missed net451 reference in build file
rjmholt Aug 29, 2018
3cda894
First test fixes
rjmholt Aug 29, 2018
187aea6
Add PowerShell SDK references to tests where needed
rjmholt Aug 29, 2018
bdf008e
Converted test paths, removed #ifs from src/
rjmholt Aug 30, 2018
3ba9c0a
Add restore to build rule
rjmholt Sep 3, 2018
3567a2d
Unskip some tests, use non-Windows specific tests, lose hash key orde…
rjmholt Sep 3, 2018
15dcb61
Fix alias tests
rjmholt Sep 3, 2018
e622473
Fix platform specific tests, move build to netcoreapp2.1, break things
rjmholt Sep 4, 2018
a929752
Use latest xunit
rjmholt Sep 5, 2018
05d2f44
Use PrivateAssets to make PS SDK binding work
rjmholt Sep 5, 2018
f5114c8
Exclude host integration tests
rjmholt Sep 5, 2018
e189f87
Change dotnet xunit to dotnet test in test invocation
rjmholt Sep 5, 2018
f220082
Improve test support on Windows
rjmholt Sep 5, 2018
071b7e0
Move project references
rjmholt Sep 5, 2018
9304ba0
Drop unsupported msbuild switches for net461 builds
rjmholt Sep 5, 2018
8fc5b68
Fix net461 test bugs
Sep 6, 2018
7146a05
Add net461 shim binaries for Windows PowerShell
Sep 12, 2018
d9f3168
Build in single dir
Sep 12, 2018
66bf56f
Clean up build script
Sep 12, 2018
6fac967
Skip failing AsyncDebouncer test
Sep 12, 2018
7651f0f
Update build tooling
Sep 12, 2018
f8f60bd
Use correct Newtonsoft.Json version for PSCore 6.0
Sep 12, 2018
1525ff8
Address some PR feedback
Sep 13, 2018
88639c5
Fix casing typos
Sep 13, 2018
d8f4b2e
Make travis fail when errors occur
Sep 13, 2018
32b770f
Merge branch '2.0.0' into migrate-netstandard2.0
rjmholt Sep 13, 2018
395771e
Fix travis build
Sep 13, 2018
f5cfe42
Fix command module import path
Sep 13, 2018
02ee0e8
Try another travis fix
Sep 13, 2018
b8482c5
Restore travis build with verbose flags
Sep 13, 2018
063dadc
Try new travis script
Sep 13, 2018
25c322b
Travis
Sep 13, 2018
0a66601
Another travis try
Sep 13, 2018
d5cbd9a
TRAVIS!!!!!!
Sep 13, 2018
e1d0ac3
travis
Sep 13, 2018
e978b7c
travis >:(
Sep 13, 2018
3c13822
Suspect Save-Module is lying about the prerelease param
Sep 13, 2018
f8c462c
Never check for AllowPrerelease parameter
Sep 13, 2018
38bce43
Add ridiculous psget update dance back in
Sep 13, 2018
12b4cb6
Use newer PowerShell version in Travis
Sep 13, 2018
b47d915
Use newer powershell version
Sep 13, 2018
8b86ac9
Update dotnet CLI download
Sep 13, 2018
0bac8b6
Update dotnet SDK to latest release
Sep 13, 2018
4297563
Fix nuget bin declaration schema
Sep 13, 2018
59edb3c
Move restore to clean rule
Sep 13, 2018
865dc97
Clean up code
rjmholt Sep 14, 2018
32e13fe
Optimise encoding setting
rjmholt Sep 14, 2018
514ccf0
Update travis platforms
rjmholt Sep 14, 2018
2f870b7
Reformat travis.yml
rjmholt Sep 14, 2018
ff1b14d
Update travis config
rjmholt Sep 14, 2018
05ed5b5
Fix travis.yml
rjmholt Sep 14, 2018
8677a7a
Use CreateDefault2() again
rjmholt Sep 14, 2018
f08b6a9
Test for correct platforms
rjmholt Sep 14, 2018
da2e0b0
Move back to net461 for testing
rjmholt Sep 14, 2018
cdccf3a
Test appveyor pwsh path
Sep 14, 2018
354da07
Remove PSHome from appveyor
Sep 14, 2018
6a60e46
Try to set the module path with a config file
rjmholt Sep 17, 2018
e7a3cc9
Actually make the tests work
Sep 17, 2018
6cc0fb3
Enable writing to the config path
Sep 17, 2018
3462b23
Use sudo
Sep 17, 2018
f9d3018
Try different permissions set
Sep 17, 2018
86601f4
Give up and use a CreateDefault test hook instead
Sep 17, 2018
3511ed6
Use dotnet xunit instead of dotnet test
Sep 18, 2018
c69610e
Use simple pwsh process name
Sep 20, 2018
131e51f
Change test paths back to ensure backslack supported on *nix
Sep 20, 2018
271df79
Fix session details gathering in nested prompts
SeeminglyScience Sep 26, 2018
d99fbb6
Fix session details gathering in nested prompts
rjmholt Sep 26, 2018
784cef5
Address @tylerl0706's feedback
Oct 1, 2018
71c9ee9
Clean up temp file for nupkgs
Oct 1, 2018
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
15 changes: 6 additions & 9 deletions PowerShellEditorServices.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ if ($PSVersionTable.PSEdition -ne "Core") {
Add-Type -Assembly System.IO.Compression.FileSystem
}

function Get-NugetAsmForRuntime {
function Restore-NugetAsmForRuntime {
param(
[ValidateNotNull()][string]$PackageName,
[ValidateNotNull()][string]$PackageVersion,
Expand All @@ -135,7 +135,8 @@ function Get-NugetAsmForRuntime {

$packageDirPath = Join-Path $tmpDir "$PackageName.$PackageVersion"
if (-not (Test-Path $packageDirPath)) {
$tmpNupkgPath = Join-Path $tmpDir 'tmp.zip'
$guid = New-Guid
$tmpNupkgPath = Join-Path $tmpDir "$guid.zip"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should probably do the proper clean up here too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like after you expand-archive

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

if (Test-Path $tmpNupkgPath) {
Remove-Item -Force $tmpNupkgPath
}
Expand Down Expand Up @@ -267,9 +268,9 @@ task GetProductVersion -Before PackageNuGet, PackageModule, UploadArtifacts {
}

task Build {
exec { & $script:dotnetExe publish -c $Configuration .\src\PowerShellEditorServices\PowerShellEditorServices.csproj -f $script:TargetPlatform }
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 $script:TargetPlatform }
}

function UploadTestLogs {
Expand All @@ -296,12 +297,10 @@ task TestServer {
Set-Location .\test\PowerShellEditorServices.Test\

if (-not $script:IsUnix) {
exec { & $script:dotnetExe build -f $script:TestRuntime.Desktop }
exec { & $script:dotnetExe xunit -f $script:TestRuntime.Desktop }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you use dotnet test it should do a dotnet build automatically.

}

Invoke-WithCreateDefaultHook -NewModulePath $script:PSCoreModulePath {
exec { & $script:dotnetExe build -c $Configuration -f $script:TestRuntime.Core }
exec { & $script:dotnetExe xunit -f $script:TestRuntime.Core --fx-version $script:NetCoreTestingFrameworkVersion }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing about dotnet build

}
}
Expand All @@ -310,17 +309,15 @@ task TestProtocol {
Set-Location .\test\PowerShellEditorServices.Test.Protocol\

if (-not $script:IsUnix) {
exec { & $script:dotnetExe build -f $script:TestRuntime.Desktop }
exec { & $script:dotnetExe xunit -f $script:TestRuntime.Desktop }
}

Invoke-WithCreateDefaultHook {
exec { & $script:dotnetExe build -c $Configuration -f $script:TestRuntime.Core }
exec { & $script:dotnetExe xunit -f $script:TestRuntime.Core --fx-version $script:NetCoreTestingFrameworkVersion }
}
}

task TestHost -If {
task TestHost {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait I thought these tests were evil? 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are but ideally we can restore them at some point. The build rule exists but isn't called anywhere (used to be under task Test).

Set-Location .\test\PowerShellEditorServices.Test.Host\

if (-not $script:IsUnix) {
Expand Down Expand Up @@ -375,7 +372,7 @@ task LayoutModule -After Build {
}

foreach ($packageDetails in $script:RequiredNugetBinaries[$binDestinationDir]) {
Get-NugetAsmForRuntime -DestinationPath $binDestPath @packageDetails
Restore-NugetAsmForRuntime -DestinationPath $binDestPath @packageDetails
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<ProjectReference Include="..\PowerShellEditorServices\PowerShellEditorServices.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="10.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="PowerShellStandard.Library" Version="5.1.0-preview-06" PrivateAssets="All" />
<PackageReference Include="System.IO.Pipes.AccessControl" Version="4.5.1" />
</ItemGroup>
Expand Down
4 changes: 0 additions & 4 deletions test/PowerShellEditorServices.Test/Session/WorkspaceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ public void CanResolveWorkspaceRelativePath()
[Fact]
public void CanDetermineIsPathInMemory()
{
#if !CoreCLR
string tempDir = Environment.GetEnvironmentVariable("TEMP");
#else
string tempDir = Path.GetTempPath();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought this worked in .NET Framework? It looked like it worked in Windows PowerShell

#endif
string shortDirPath = Path.Combine(tempDir, "GitHub", "PowerShellEditorServices");
string shortFilePath = Path.Combine(shortDirPath, "foo.ps1");
string shortUriForm = "git:/c%3A/Users/Keith/GitHub/dahlbyk/posh-git/src/PoshGitTypes.ps1?%7B%22path%22%3A%22c%3A%5C%5CUsers%5C%5CKeith%5C%5CGitHub%5C%5Cdahlbyk%5C%5Cposh-git%5C%5Csrc%5C%5CPoshGitTypes.ps1%22%2C%22ref%22%3A%22~%22%7D";
Expand Down