Skip to content

Commit

Permalink
🔧 add MSBuild task to copy plugin dlls to folder
Browse files Browse the repository at this point in the history
For ease of development, this also includes a template .user file to automatically copy to server instance on publish.

Probably due to .NET5 sdk, a small change to the project file properties was also required to copy all dlls to the build folder.
  • Loading branch information
senritsu committed Nov 22, 2020
1 parent da0109d commit e47dd82
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,5 @@ UpgradeLog*.XML
# MonoDevelop metafiles
MediaBrowser.Plugins.Anime.userprefs

# Specific ignores for this repo
plugin/
16 changes: 16 additions & 0 deletions Jellyfin.Plugin.Anime/Jellyfin.Plugin.Anime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,31 @@
<RootNamespace>Jellyfin.Plugin.Anime</RootNamespace>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<FileVersion>10.0.0.0</FileVersion>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AnitomySharp.NETStandard" Version="0.3.0-beta.1" />
<PackageReference Include="Jellyfin.Controller" Version="10.6.0" />
</ItemGroup>

<ItemGroup>
<None Remove="Configuration\configPage.html" />
<EmbeddedResource Include="Configuration\configPage.html" />
</ItemGroup>

<PropertyGroup>
<BinaryPluginOutputFolder>$(SolutionDir)\plugin</BinaryPluginOutputFolder>
</PropertyGroup>

<Target Name="CopyPlugin" AfterTargets="Build">
<ItemGroup>
<BinaryPluginFile Include="$(OutDir)\Jellyfin.Plugin.Anime.dll" />
<BinaryPluginFile Include="$(OutDir)\AnitomySharp.dll" />
</ItemGroup>
<Copy
SourceFiles="@(BinaryPluginFile)"
DestinationFolder="$(BinaryPluginOutputFolder)\Anime" />
</Target>

</Project>
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,26 @@ This plugin is built with .NET Core to download metadata for anime.

2. Ensure you have .NET Core SDK setup and installed

3. Build plugin with following command.
3. Build plugin project using either your IDE or the CLI. As an example, the following can be used for a Release build:

```sh
dotnet publish --configuration Release --output bin
dotnet build --configuration Release
```
4. Place the resulting file in the `plugins` folder under the program data directory or inside the portable install directory

On build, the project automatically copies all relevant plugin files to the `plugin` folder in the repository root.

4. Copy the contents of the `plugin` folder (at the repo root) to the `plugins` folder of your Jellyfin installation, under the program data directory or inside the portable install directory

### Copy automation for development

Step 4 can be automated by adding a `Jellyfin.Plugin.Anime.csproj.user` file to the project folder, to copy the published dlls directly to the correct folder for your local Jellyfin server.

```xml
<?xml version="1.0"?>
<Project>
<PropertyGroup>
<!-- NOTE The following property will deploy the plugin to the config folder of your running Jellyfin install, for easier testing. This way you don't have to copy files manually, and a simple server restart is sufficient. -->
<BinaryPluginOutputFolder>PATH_TO_YOUR_JELLYFIN_CONFIG_FOLDER\plugins</BinaryPluginOutputFolder>-->
</PropertyGroup>
</Project>
```

0 comments on commit e47dd82

Please sign in to comment.