Skip to content

Commit 5fcfe4c

Browse files
authored
feat: Copy plugins to publish directory (#30)
1 parent d3c518a commit 5fcfe4c

File tree

6 files changed

+49
-28
lines changed

6 files changed

+49
-28
lines changed

Directory.Packages.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
44
</PropertyGroup>
55
<ItemGroup>
6+
<PackageVersion Include="CopyPluginsToPublishDirectory" Version="1.0.0" />
67
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
78
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
89
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />

samples/HostApplications/ConsoleApp/Example.HostConsoleApp.csproj

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,12 @@
66

77
<ItemGroup>
88
<PackageReference Include="DotEnv.Core" />
9+
<PackageReference Include="CopyPluginsToPublishDirectory" />
910
</ItemGroup>
1011

1112
<ItemGroup>
1213
<ProjectReference Include="..\..\..\src\Core\CPlugin.Net.csproj" />
1314
<ProjectReference Include="..\..\Contracts\Example.Contracts.csproj" />
1415
</ItemGroup>
1516

16-
<ItemGroup>
17-
<!--
18-
Copy the plugins directory to the publish directory.
19-
This copies the directories and subdirectories (including files with extension)
20-
from the plugins folder to the publish directory.
21-
For this to work, the plug-ins must be compiled.
22-
-->
23-
<Content
24-
Include="bin\$(Configuration)\$(TargetFramework)\plugins\**"
25-
CopyToPublishDirectory="PreserveNewest"
26-
TargetPath="plugins\%(RecursiveDir)\%(Filename)%(Extension)"
27-
/>
28-
</ItemGroup>
29-
3017
</Project>

samples/HostApplications/WebApi/Example.HostWebApi.csproj

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<PackageReference Include="Microsoft.AspNetCore.OpenApi" />
99
<PackageReference Include="Swashbuckle.AspNetCore" />
1010
<PackageReference Include="SimpleResults.AspNetCore" />
11+
<PackageReference Include="CopyPluginsToPublishDirectory" />
1112
</ItemGroup>
1213

1314
<ItemGroup>
@@ -16,18 +17,4 @@
1617
<ProjectReference Include="..\..\SharedEntities\Example.SharedEntities.csproj" />
1718
</ItemGroup>
1819

19-
<ItemGroup>
20-
<!--
21-
Copy the plugins directory to the publish directory.
22-
This copies the directories and subdirectories (including files with extension)
23-
from the plugins folder to the publish directory.
24-
For this to work, the plug-ins must be compiled.
25-
-->
26-
<Content
27-
Include="bin\$(Configuration)\$(TargetFramework)\plugins\**"
28-
CopyToPublishDirectory="PreserveNewest"
29-
TargetPath="plugins\%(RecursiveDir)\%(Filename)%(Extension)"
30-
/>
31-
</ItemGroup>
32-
3320
</Project>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
3+
<metadata>
4+
<id>CopyPluginsToPublishDirectory</id>
5+
<version>1.0.0</version>
6+
<authors>Dave Roman</authors>
7+
<owners>Dave Roman</owners>
8+
<projectUrl>https://github.com/MrDave1999/CPlugin.Net</projectUrl>
9+
<license type="expression">MIT</license>
10+
<readme>README.md</readme>
11+
<icon>plugin-icon-nuget.png</icon>
12+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
13+
<description>
14+
A simple package that allows to copy the plugins directory from the output directory to the publish directory
15+
</description>
16+
<releaseNotes></releaseNotes>
17+
<copyright>Copyright (c) Dave Roman</copyright>
18+
<tags>targets target plugins addons plugin plugin-architecture</tags>
19+
</metadata>
20+
21+
<files>
22+
<file src="README.md" target="" />
23+
<file src="..\plugin-icon-nuget.png" target="" />
24+
<file src="build\**" target="build" />
25+
</files>
26+
</package>

targets/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## About
2+
3+
A simple package that allows to copy the plugins directory from the output directory (e.g. bin/Debug/net8.0) to the publish directory.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project>
2+
3+
<ItemGroup>
4+
<!--
5+
Copy the plugins directory to the publish directory.
6+
This copies the directories and subdirectories (including files with extension)
7+
from the plugins folder to the publish directory.
8+
For this to work, the plugins must be compiled.
9+
-->
10+
<Content
11+
Include="bin\$(Configuration)\$(TargetFramework)\plugins\**"
12+
CopyToPublishDirectory="PreserveNewest"
13+
TargetPath="plugins\%(RecursiveDir)\%(Filename)%(Extension)"
14+
/>
15+
</ItemGroup>
16+
17+
</Project>

0 commit comments

Comments
 (0)