Skip to content

Commit 784cef5

Browse files
author
Robert Holt
committed
Address @tylerl0706's feedback
1 parent d99fbb6 commit 784cef5

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

PowerShellEditorServices.build.ps1

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ if ($PSVersionTable.PSEdition -ne "Core") {
111111
Add-Type -Assembly System.IO.Compression.FileSystem
112112
}
113113

114-
function Get-NugetAsmForRuntime {
114+
function Restore-NugetAsmForRuntime {
115115
param(
116116
[ValidateNotNull()][string]$PackageName,
117117
[ValidateNotNull()][string]$PackageVersion,
@@ -135,7 +135,8 @@ function Get-NugetAsmForRuntime {
135135

136136
$packageDirPath = Join-Path $tmpDir "$PackageName.$PackageVersion"
137137
if (-not (Test-Path $packageDirPath)) {
138-
$tmpNupkgPath = Join-Path $tmpDir 'tmp.zip'
138+
$guid = New-Guid
139+
$tmpNupkgPath = Join-Path $tmpDir "$guid.zip"
139140
if (Test-Path $tmpNupkgPath) {
140141
Remove-Item -Force $tmpNupkgPath
141142
}
@@ -267,9 +268,9 @@ task GetProductVersion -Before PackageNuGet, PackageModule, UploadArtifacts {
267268
}
268269

269270
task Build {
271+
exec { & $script:dotnetExe publish -c $Configuration .\src\PowerShellEditorServices\PowerShellEditorServices.csproj -f $script:TargetPlatform }
270272
exec { & $script:dotnetExe publish -c $Configuration .\src\PowerShellEditorServices.Host\PowerShellEditorServices.Host.csproj -f $script:TargetPlatform }
271273
exec { & $script:dotnetExe build -c $Configuration .\src\PowerShellEditorServices.VSCode\PowerShellEditorServices.VSCode.csproj $script:TargetFrameworksParam }
272-
exec { & $script:dotnetExe publish -c $Configuration .\src\PowerShellEditorServices\PowerShellEditorServices.csproj -f $script:TargetPlatform }
273274
}
274275

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

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

303303
Invoke-WithCreateDefaultHook -NewModulePath $script:PSCoreModulePath {
304-
exec { & $script:dotnetExe build -c $Configuration -f $script:TestRuntime.Core }
305304
exec { & $script:dotnetExe xunit -f $script:TestRuntime.Core --fx-version $script:NetCoreTestingFrameworkVersion }
306305
}
307306
}
@@ -310,17 +309,15 @@ task TestProtocol {
310309
Set-Location .\test\PowerShellEditorServices.Test.Protocol\
311310

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

317315
Invoke-WithCreateDefaultHook {
318-
exec { & $script:dotnetExe build -c $Configuration -f $script:TestRuntime.Core }
319316
exec { & $script:dotnetExe xunit -f $script:TestRuntime.Core --fx-version $script:NetCoreTestingFrameworkVersion }
320317
}
321318
}
322319

323-
task TestHost -If {
320+
task TestHost {
324321
Set-Location .\test\PowerShellEditorServices.Test.Host\
325322

326323
if (-not $script:IsUnix) {
@@ -375,7 +372,7 @@ task LayoutModule -After Build {
375372
}
376373

377374
foreach ($packageDetails in $script:RequiredNugetBinaries[$binDestinationDir]) {
378-
Get-NugetAsmForRuntime -DestinationPath $binDestPath @packageDetails
375+
Restore-NugetAsmForRuntime -DestinationPath $binDestPath @packageDetails
379376
}
380377
}
381378
}

src/PowerShellEditorServices.Protocol/PowerShellEditorServices.Protocol.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<ProjectReference Include="..\PowerShellEditorServices\PowerShellEditorServices.csproj" />
1515
</ItemGroup>
1616
<ItemGroup>
17-
<PackageReference Include="Newtonsoft.Json" Version="10.0.0" />
17+
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
1818
<PackageReference Include="PowerShellStandard.Library" Version="5.1.0-preview-06" PrivateAssets="All" />
1919
<PackageReference Include="System.IO.Pipes.AccessControl" Version="4.5.1" />
2020
</ItemGroup>

test/PowerShellEditorServices.Test/Session/WorkspaceTests.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,7 @@ public void CanResolveWorkspaceRelativePath()
4141
[Fact]
4242
public void CanDetermineIsPathInMemory()
4343
{
44-
#if !CoreCLR
45-
string tempDir = Environment.GetEnvironmentVariable("TEMP");
46-
#else
4744
string tempDir = Path.GetTempPath();
48-
#endif
4945
string shortDirPath = Path.Combine(tempDir, "GitHub", "PowerShellEditorServices");
5046
string shortFilePath = Path.Combine(shortDirPath, "foo.ps1");
5147
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";

0 commit comments

Comments
 (0)