build: repack to one dll assembly

This commit is contained in:
cxfksword 2023-07-19 13:54:33 +08:00
parent 4ee8e53705
commit 51222ffb2f
17 changed files with 26 additions and 18 deletions

View File

@ -33,9 +33,10 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: dotnet restore ${{ env.project }} --no-cache run: dotnet restore ${{ env.project }} --no-cache
- name: Build - name: Build
run: dotnet publish --nologo --no-restore --configuration=Release --framework=net6.0 --output=artifacts -p:Version=${{steps.vars.outputs.VERSION}} ${{ env.project }} run: |
- name: Clean publish dll dotnet publish --nologo --no-restore --configuration=Release --framework=net6.0 --output=tmp -p:Version=${{steps.vars.outputs.VERSION}} ${{ env.project }}
run: cd artifacts && rm -rf MediaBrowser*.dll Microsoft*.dll Newtonsoft*.dll System*.dll Emby*.dll Jellyfin.Data*.dll Jellyfin.Extensions*.dll *.json *.pdb mkdir -p artifacts
cp ./tmp/Jellyfin.Plugin.MetaShark.dll ./artifacts/
- name: Compress build files - name: Compress build files
uses: thedoctor0/zip-release@main uses: thedoctor0/zip-release@main
with: with:

View File

@ -6,6 +6,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Jellyfin.Plugin.MetaShark",
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Jellyfin.Plugin.MetaShark.Test", "Jellyfin.Plugin.MetaShark.Test\Jellyfin.Plugin.MetaShark.Test.csproj", "{80814353-4291-4230-8C4A-4C45CAD4D5D3}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Jellyfin.Plugin.MetaShark.Test", "Jellyfin.Plugin.MetaShark.Test\Jellyfin.Plugin.MetaShark.Test.csproj", "{80814353-4291-4230-8C4A-4C45CAD4D5D3}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AnitomySharp", "AnitomySharp\AnitomySharp.csproj", "{B6FC3E72-D30D-49D3-B545-0EF0CCFF220A}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -20,6 +22,10 @@ Global
{80814353-4291-4230-8C4A-4C45CAD4D5D3}.Debug|Any CPU.Build.0 = Debug|Any CPU {80814353-4291-4230-8C4A-4C45CAD4D5D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80814353-4291-4230-8C4A-4C45CAD4D5D3}.Release|Any CPU.ActiveCfg = Release|Any CPU {80814353-4291-4230-8C4A-4C45CAD4D5D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{80814353-4291-4230-8C4A-4C45CAD4D5D3}.Release|Any CPU.Build.0 = Release|Any CPU {80814353-4291-4230-8C4A-4C45CAD4D5D3}.Release|Any CPU.Build.0 = Release|Any CPU
{B6FC3E72-D30D-49D3-B545-0EF0CCFF220A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B6FC3E72-D30D-49D3-B545-0EF0CCFF220A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B6FC3E72-D30D-49D3-B545-0EF0CCFF220A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B6FC3E72-D30D-49D3-B545-0EF0CCFF220A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@ -7,11 +7,11 @@
<ItemGroup> <ItemGroup>
<InputAssemblies Include="$(OutputPath)$(AssemblyName).dll" /> <InputAssemblies Include="$(OutputPath)$(AssemblyName).dll" />
<InputAssemblies Include="$(OutputPath)publish/RateLimiter.dll" /> <InputAssemblies Include="$(OutputPath)RateLimiter.dll" />
<InputAssemblies Include="$(OutputPath)publish/ComposableAsync.Core.dll" /> <InputAssemblies Include="$(OutputPath)ComposableAsync.Core.dll" />
<InputAssemblies Include="$(OutputPath)publish/TMDbLib.dll" /> <InputAssemblies Include="$(OutputPath)TMDbLib.dll" />
<InputAssemblies Include="$(OutputPath)publish/Newtonsoft.Json.dll" /> <InputAssemblies Include="$(OutputPath)Newtonsoft.Json.dll" />
<InputAssemblies Include="$(OutputPath)publish/AngleSharp.dll" /> <InputAssemblies Include="$(OutputPath)AngleSharp.dll" />
</ItemGroup> </ItemGroup>
<ILRepack <ILRepack

View File

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<RootNamespace>Jellyfin.Plugin.MetaShark</RootNamespace> <RootNamespace>Jellyfin.Plugin.MetaShark</RootNamespace>
@ -6,6 +6,7 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<AnalysisMode>AllEnabledByDefault</AnalysisMode> <AnalysisMode>AllEnabledByDefault</AnalysisMode>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<TreatWarningsAsErrors>False</TreatWarningsAsErrors> <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
@ -13,12 +14,16 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<TreatWarningsAsErrors>False</TreatWarningsAsErrors> <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Compile Remove="Vendor\TMDbLib\**" />
<EmbeddedResource Remove="Vendor\TMDbLib\**" />
<None Remove="Vendor\TMDbLib\**" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="AngleSharp" Version="1.0.1" /> <PackageReference Include="AngleSharp" Version="1.0.1" />
<PackageReference Include="ILRepack.Lib.MSBuild" Version="2.1.18" /> <PackageReference Include="ILRepack.Lib.MSBuild.Minor" Version="2.1.19-alpha.2" />
<PackageReference Include="Jellyfin.Controller" Version="10.8.0" /> <PackageReference Include="Jellyfin.Controller" Version="10.8.0" />
<PackageReference Include="Jellyfin.Model" Version="10.8.0" /> <PackageReference Include="Jellyfin.Model" Version="10.8.0" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="RateLimiter" Version="2.2.0" /> <PackageReference Include="RateLimiter" Version="2.2.0" />
<PackageReference Include="TMDbLib" Version="2.0.0" /> <PackageReference Include="TMDbLib" Version="2.0.0" />
</ItemGroup> </ItemGroup>
@ -32,6 +37,6 @@
<EmbeddedResource Include="Configuration\configPage.html" /> <EmbeddedResource Include="Configuration\configPage.html" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="Vendor\TMDbLib\TMDbLib.csproj" /> <ProjectReference Include="..\AnitomySharp\AnitomySharp.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -38,17 +38,13 @@ jellyfin电影元数据插件影片信息只要从豆瓣获取并由TheMov
1. Clone or download this repository 1. Clone or download this repository
2. Ensure you have .NET Core SDK setup and installed 2. Ensure you have .NET Core SDK 6.0 setup and installed
3. Build plugin with following command. 3. Build plugin with following command.
```sh ```sh
dotnet restore dotnet restore
dotnet publish --output=artifacts Jellyfin.Plugin.MetaShark/Jellyfin.Plugin.MetaShark.csproj dotnet publish --output=artifacts Jellyfin.Plugin.MetaShark/Jellyfin.Plugin.MetaShark.csproj
# remove unused dll
cd artifacts
rm -rf MediaBrowser*.dll Microsoft*.dll Newtonsoft*.dll System*.dll Emby*.dll Jellyfin.Data*.dll Jellyfin.Extensions*.dll *.json *.pdb
``` ```
@ -56,7 +52,7 @@ rm -rf MediaBrowser*.dll Microsoft*.dll Newtonsoft*.dll System*.dll Emby*.dll Je
1. Build the plugin 1. Build the plugin
2. Create a folder, like `metashark` and copy `artifacts/*.dll` into it 2. Create a folder, like `metashark` and copy `artifacts/Jellyfin.Plugin.MetaShark.dll` into it
3. Move folder `metashark` to jellyfin `data/plugins` folder 3. Move folder `metashark` to jellyfin `data/plugins` folder