Skip to content

Commit

Permalink
add ReleaseDll target
Browse files Browse the repository at this point in the history
KeePass now recommends distributing plugins as dll rather than plgx
  • Loading branch information
dlech committed Dec 24, 2023
1 parent 37f4239 commit a947e8e
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 9 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build PLGX
name: Build DLL/PLGX

on: [push, pull_request]

Expand All @@ -17,14 +17,21 @@ jobs:
- name: Setup MSBuild.exe
uses: microsoft/[email protected]

- name: Build DLL
run: msbuild /property:Configuration=ReleaseDll /t:build KeeAgent.sln

- uses: actions/upload-artifact@v3
with:
name: KeeAgent.dll
path: KeeAgent/bin/ReleaseDll/KeeAgent.dll

- name: Build PLGX
run: msbuild /property:Configuration=ReleasePlgx /t:build KeeAgent.sln

- name: List PLGX
run: ~\.nuget\packages\plgxtool\1.0.3\tools\PlgxTool.exe -l .\KeeAgent\bin\ReleasePlgx\KeeAgent.plgx

- name: Upload artifact
uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v3
with:
name: KeeAgent.plgx
path: KeeAgent/bin/ReleasePlgx/KeeAgent.plgx
11 changes: 9 additions & 2 deletions KeeAgent.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28606.126
# Visual Studio Version 17
VisualStudioVersion = 17.6.33815.320
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeeAgent", "KeeAgent\KeeAgent.csproj", "{742863F2-52ED-41E0-92A1-8EEA60EB75EF}"
EndProject
Expand All @@ -21,25 +21,32 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
ReleaseDll|Any CPU = ReleaseDll|Any CPU
ReleasePlgx|Any CPU = ReleasePlgx|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{742863F2-52ED-41E0-92A1-8EEA60EB75EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{742863F2-52ED-41E0-92A1-8EEA60EB75EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{742863F2-52ED-41E0-92A1-8EEA60EB75EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{742863F2-52ED-41E0-92A1-8EEA60EB75EF}.Release|Any CPU.Build.0 = Release|Any CPU
{742863F2-52ED-41E0-92A1-8EEA60EB75EF}.ReleaseDll|Any CPU.ActiveCfg = ReleaseDll|Any CPU
{742863F2-52ED-41E0-92A1-8EEA60EB75EF}.ReleaseDll|Any CPU.Build.0 = ReleaseDll|Any CPU
{742863F2-52ED-41E0-92A1-8EEA60EB75EF}.ReleasePlgx|Any CPU.ActiveCfg = ReleasePlgx|Any CPU
{742863F2-52ED-41E0-92A1-8EEA60EB75EF}.ReleasePlgx|Any CPU.Build.0 = ReleasePlgx|Any CPU
{9163B6B6-0603-4C6E-BC67-7111ED8CDDE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9163B6B6-0603-4C6E-BC67-7111ED8CDDE1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9163B6B6-0603-4C6E-BC67-7111ED8CDDE1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9163B6B6-0603-4C6E-BC67-7111ED8CDDE1}.Release|Any CPU.Build.0 = Release|Any CPU
{9163B6B6-0603-4C6E-BC67-7111ED8CDDE1}.ReleaseDll|Any CPU.ActiveCfg = Release|Any CPU
{9163B6B6-0603-4C6E-BC67-7111ED8CDDE1}.ReleaseDll|Any CPU.Build.0 = Release|Any CPU
{9163B6B6-0603-4C6E-BC67-7111ED8CDDE1}.ReleasePlgx|Any CPU.ActiveCfg = Release|Any CPU
{9163B6B6-0603-4C6E-BC67-7111ED8CDDE1}.ReleasePlgx|Any CPU.Build.0 = Release|Any CPU
{3BEB6FAE-B14D-4281-8168-DB2A4A0C5FC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3BEB6FAE-B14D-4281-8168-DB2A4A0C5FC4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3BEB6FAE-B14D-4281-8168-DB2A4A0C5FC4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3BEB6FAE-B14D-4281-8168-DB2A4A0C5FC4}.Release|Any CPU.Build.0 = Release|Any CPU
{3BEB6FAE-B14D-4281-8168-DB2A4A0C5FC4}.ReleaseDll|Any CPU.ActiveCfg = Release|Any CPU
{3BEB6FAE-B14D-4281-8168-DB2A4A0C5FC4}.ReleaseDll|Any CPU.Build.0 = Release|Any CPU
{3BEB6FAE-B14D-4281-8168-DB2A4A0C5FC4}.ReleasePlgx|Any CPU.ActiveCfg = Release|Any CPU
{3BEB6FAE-B14D-4281-8168-DB2A4A0C5FC4}.ReleasePlgx|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
Expand Down
29 changes: 25 additions & 4 deletions KeeAgent/KeeAgent.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,11 @@
<Version>2.53.0.21099</Version>
<ExcludeFromPlgx />
</PackageReference>
<PackageReference Include="ILRepack">
<Version>2.0.20</Version>
<PrivateAssets>all</PrivateAssets>
<ExcludeFromPlgx />
</PackageReference>
<PackageReference Include="PlgxTool">
<Version>1.0.3</Version>
<PrivateAssets>all</PrivateAssets>
Expand All @@ -276,6 +281,14 @@
</ItemGroup>
<PropertyGroup>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseDll|AnyCPU'">
<DebugType>none</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\ReleaseDll</OutputPath>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>4</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'ReleasePlgx|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>True</Optimize>
Expand All @@ -285,12 +298,20 @@
<LangVersion>4</LangVersion>
</PropertyGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="AfterBuild" Condition="'$(Configuration)' == 'ReleasePlgx'">
<CallTarget Targets="BuildPlgx" />
<Delete Files="$(OutDir)Microsoft.WindowsAPICodePack.dll;$(OutDir)Microsoft.WindowsAPICodePack.Shell.dll" />
<Target Name="ILMerge">
<Move SourceFiles="$(OutDir)KeeAgent.dll" DestinationFiles="$(OutDir)KeeAgentExt.dll" />
<Exec WorkingDirectory="$(OutDir)" Command="$(ILRepack) /out:KeeAgent.dll KeeAgentExt.dll Mono.Posix.dll SshAgentLib.WinForms.dll SshAgentLib.dll BouncyCastle.Crypto.dll Konscious.Security.Cryptography.Argon2.dll Konscious.Security.Cryptography.Blake2.dll System.Numerics.Vectors.dll System.Net.Sockets.dll" />
</Target>
<Target Name="DeleteDlls" AfterTargets="ILMerge;BuildPlgx">
<Delete Files="$(OutDir)KeeAgent.dll" Condition="'$(Configuration)' != 'ReleaseDll'" />
<Delete Files="$(OutDir)KeeAgentExt.dll" Condition="'$(Configuration)' == 'ReleaseDll'" />
<Delete Files="$(OutDir)SshAgentLib.WinForms.dll;$(OutDir)SshAgentLib.dll;$(OutDir)BouncyCastle.Crypto.dll" />
<Delete Files="$(OutDir)Konscious.Security.Cryptography.Argon2.dll;$(OutDir)Konscious.Security.Cryptography.Blake2.dll" />
<Delete Files="$(OutDir)System.Numerics.Vectors.dll;$(OutDir)System.Net.Sockets.dll" />
<Delete Files="$(OutDir)System.Numerics.Vectors.dll;$(OutDir)System.Net.Sockets.dll;$(OutDir)Mono.Posix.dll" />
</Target>
<Target Name="AfterBuild">
<CallTarget Targets="ILMerge" Condition="'$(Configuration)' == 'ReleaseDll'" />
<CallTarget Targets="BuildPlgx" Condition="'$(Configuration)' == 'ReleasePlgx'" />
</Target>
<ProjectExtensions>
<MonoDevelop>
Expand Down

0 comments on commit a947e8e

Please sign in to comment.