Skip to content

Commit

Permalink
Updated Terminal.Gui reference to 1.16.0, as they have dropped suppor…
Browse files Browse the repository at this point in the history
…t for .NET Standard 2.0

Change from targetting .NET Standard to multi target .NET Standard 2.1 + .NET Framework 4.7.2

Updated vscode launch/tasks json files, and confirmed launching/debugging still works

Updated yml workflows for github, as dotnet publish is no longer supported. We must use dotnet build as publish is not supported for multi targetting projects
  • Loading branch information
halvarsson committed May 7, 2024
1 parent b35d636 commit 29089e8
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
dotnet-version: 6.0.x

- name: Build
run: dotnet publish
run: dotnet build -c Release
4 changes: 2 additions & 2 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
dotnet-version: 6.0.x

- name: Build
run: dotnet publish -o psedit
run: dotnet build -c Release

- name: Release
run: Publish-Module -Path .\psedit -NuGetApiKey $Env:APIKEY
run: Publish-Module -Path .\bin\Release -NuGetApiKey $Env:APIKEY
env:
APIKEY: ${{ secrets.APIKEY }}
shell: pwsh
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"-Command",
"& { Import-Module .\\psedit.psd1; Show-PSEditor}"
],
"cwd": "${workspaceFolder}\\bin\\Debug\\netstandard2.0\\publish",
"cwd": "${workspaceFolder}\\bin\\Debug",
"console": "externalTerminal",
"stopAtEntry": false
},
Expand All @@ -30,7 +30,7 @@
"-Command",
"& { Import-Module .\\psedit.psd1; Show-PSEditor}"
],
"cwd": "${workspaceFolder}\\bin\\Debug\\netstandard2.0\\publish",
"cwd": "${workspaceFolder}\\bin\\Debug",
"console": "externalTerminal",
"stopAtEntry": false
},
Expand Down
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"command": "dotnet",
"type": "shell",
"args": [
"publish",
"build",
// Ask dotnet build to generate full paths for file names.
"/property:GenerateFullPaths=true",
// Do not generate summary otherwise it leads to duplicate errors in Problems panel
Expand Down
43 changes: 36 additions & 7 deletions psedit.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,48 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.1;net472</TargetFrameworks>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="PowerShellStandard.Library" Version="5.1.1" />
<PackageReference Include="Terminal.Gui" Version="1.10.0" />
<PackageReference Include="Terminal.Gui" Version="1.16.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<ItemGroup>
<None Include="psedit.psd1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<!-- Output paths for Debug configuration -->
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)'=='Debug|netstandard2.1'">
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<OutputPath>bin\Debug\coreclr\</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)'=='Debug|net472'">
<OutputPath>bin\Debug\clr\</OutputPath>
</PropertyGroup>

<Target Name="CopyAdditionalFiles" AfterTargets="Build" Condition="'$(Configuration)' == 'Debug'">
<!-- Copy psedit.psd1 and psedit.psm1 to the root output directory -->
<Copy SourceFiles="psedit.psd1"
DestinationFolder="bin\Debug"
SkipUnchangedFiles="true" />
</Target>

<!-- Output paths for Release configuration -->
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)'=='Release|netstandard2.1'">
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<OutputPath>bin\Release\coreclr\</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)'=='Release|net472'">
<OutputPath>bin\Release\clr\</OutputPath>
</PropertyGroup>

<Target Name="CopyAdditionalFilesRelease" AfterTargets="Build" Condition="'$(Configuration)' == 'Release'">
<!-- Copy psedit.psd1 and psedit.psm1 to the root output directory -->
<Copy SourceFiles="psedit.psd1"
DestinationFolder="bin\Release"
SkipUnchangedFiles="true" />
</Target>

</Project>
10 changes: 8 additions & 2 deletions psedit.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@
@{

# Script module or binary module file associated with this manifest.
RootModule = 'psedit.dll'

RootModule = if($PSEdition -eq 'Core')
{
'coreclr\psedit.dll'
}
else # Desktop
{
'clr\psedit.dll'
}
# Version number of this module.
ModuleVersion = '0.0.6'

Expand Down

0 comments on commit 29089e8

Please sign in to comment.