Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
hexxone committed May 4, 2024
1 parent d9a53ed commit 77d8ae4
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 19 deletions.
6 changes: 5 additions & 1 deletion HttpsReverseProxy/HttpsReverseProxy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Yarp.ReverseProxy" Version="2.1.0"/>
<PackageReference Include="Yarp.ReverseProxy" Version="2.1.0" />
</ItemGroup>

<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Message Importance="high" Text="&#xA; Building Plugin...&#xA; " />
<Exec Command="dotnet build ../TeleJelly/TeleJelly.csproj" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion TeleJelly/Assets/Config/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<!-- Title and Infos -->
<div class="sectionTitleContainer flex align-items-center">
<h2 class="sectionTitle">TeleJelly Configuration</h2>
<h3>Version: <b id="TeleJellyVersion">1.0.3.0</b></h3>
<h3>Version: <b id="TeleJellyVersion">1.0.5.0</b></h3>
<a href="https://github.com/hexxone/TeleJelly"
class="button-link emby-button headerHelpButton"
is="emby-linkbutton"
Expand Down
6 changes: 3 additions & 3 deletions TeleJelly/Controller/TelegramController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ public async Task<IActionResult> ExtraFiles([FromRoute] string fileName)
}

var mimeType = MimeTypes.GetMimeType(view.EmbeddedResourcePath);
var memeTypes = new[] { "text/html", "text/css", "application/javascript", "application/x-javascript" };
// dont try to minify binary files...like fonts... will end badly
if (!memeTypes.Contains(mimeType))
var textTypes = new[] { "text/html", "text/css", "application/javascript", "application/x-javascript" };
// don't try to minify binary files...like fonts... will end badly
if (!textTypes.Contains(mimeType))
{
return File(stream, mimeType);
}
Expand Down
6 changes: 4 additions & 2 deletions TeleJelly/ILRepack.targets
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- ILRepack -->
<Target Name="ILRepacker" AfterTargets="Build" Condition="'$(Configuration)' == 'Release'">
<Target Name="ILRepacker" AfterTargets="Build">
<Message Importance="high" Text="&#xA; Repacking DLLs...&#xA; " />
<ItemGroup>
<InputAssemblies Include="$(TargetPath)" />
<InputAssemblies Include="@(ReferencePathWithRefAssemblies)" Condition="'%(filename)' == 'Newtonsoft.Json' Or '%(filename)' == 'Telegram.Bot' Or '%(filename)' == 'Microsoft.Extensions.Logging'"/>
<!-- Telegram.Bot requires Newtonsoft.Json, ILogger requires Logging.Abstractions -->
<InputAssemblies Include="@(ReferencePathWithRefAssemblies)"
Condition="'%(filename)' == 'Newtonsoft.Json' Or '%(filename)' == 'Telegram.Bot' Or '%(filename)' == 'Microsoft.Extensions.Logging.Abstractions' Or '%(filename)' == 'Microsoft.Extensions.DependencyInjection.Abstractions'"/>
</ItemGroup>

<ILRepack
Expand Down
31 changes: 19 additions & 12 deletions TeleJelly/TeleJelly.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Jellyfin.Plugin.TeleJelly</RootNamespace>
<AssemblyVersion>1.0.3.0</AssemblyVersion>
<FileVersion>1.0.3.0</FileVersion>
<Version>1.0.3.0</Version>
<AssemblyVersion>1.0.5.0</AssemblyVersion>
<FileVersion>1.0.5.0</FileVersion>
<Version>1.0.5.0</Version>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<MSBuildArgs>/property:GenerateFullPaths=true /consoleloggerparameters:NoSummary</MSBuildArgs>
Expand Down Expand Up @@ -60,28 +60,35 @@
</ItemGroup>

<Target Name="VersionTarget" AfterTargets="MinVer" Condition="'$(MinVerVersion)' != ''">
<PropertyGroup>
<MinVerPreReleaseTrimmed>$([System.Text.RegularExpressions.Regex]::Replace('$(MinVerPreRelease)', '^[^\.]*\.0', ''))</MinVerPreReleaseTrimmed>
<AssemblyVersion>$(MinVerMajor).$(MinVerMinor).$(MinVerPatch)$(MinVerPreReleaseTrimmed)</AssemblyVersion>
<FileVersion>$(AssemblyVersion)</FileVersion>
<ProductVersion>$(MinVerVersion)</ProductVersion>
</PropertyGroup>
<Message Importance="high" Text="Tagging MinVer as Assembly Version... $(MinVerMajor).$(MinVerMinor).$(MinVerPatch)$(MinVerPreReleaseTrimmed)" />
</Target>

<!-- After Release Build, ILRepack.target gets called. -->

<Target Name="CopyToServer" AfterTargets="CleanReferenceCopyLocalPaths" Condition="'$(OS)' == 'Windows_NT' and '$(Configuration)'=='Debug'">
<Target Name="JellyfinPluginHelper" AfterTargets="ILRepacker" Condition="'$(MinVerVersion)' != ''">
<Message Importance="high" Text="&#xA; Running Jellyfin Plugin Helper...&#xA; " />
<Exec Command="dotnet restore ../JellyfinPluginHelper/JellyfinPluginHelper.csproj" />
<MSBuild Projects="../JellyfinPluginHelper/JellyfinPluginHelper.csproj" Targets="Build" />
<MSBuild Projects="../JellyfinPluginHelper/JellyfinPluginHelper.csproj" Targets="Run" Properties="RunArguments=%22$(MinVerVersion)&quot; &quot;$(ProjectDir)../&quot; &quot;$(ProjectDir)$(OutDir)$(AssemblyName).dll&quot;" />
</Target>

<Target Name="CopyToServer" AfterTargets="JellyfinPluginHelper" Condition="'$(OS)' == 'Windows_NT'">
<Message Importance="high" Text="&#xA; Copying built Plugin to JellyFin Server...&#xA; " />
<PropertyGroup>
<LocalAppDataPath>$(LocalAppData)</LocalAppDataPath>
</PropertyGroup>
<ItemGroup>
<ServerFilesToDelete Include="$(LocalAppDataPath)/jellyfin/plugins/TeleJelly/**/*.*" />
<BuiltFilesToCopy Include="$(OutDir)/**/*.*" />
<BuiltFilesToCopy Include="$(OutDir)$(AssemblyName).dll" />
<BuiltFilesToCopy Include="$(ProjectDir)../meta.json" />
</ItemGroup>
<Delete Files="$(ServerFilesToDelete)" />
<Copy SourceFiles="@(BuiltFilesToCopy)" DestinationFolder="$(LocalAppDataPath)/jellyfin/plugins/TeleJelly/%(RecursiveDir)" OverwriteReadOnlyFiles="true" />
</Target>

<Target Name="JellyfinPluginHelper" AfterTargets="CleanReferenceCopyLocalPaths" Condition="'$(Configuration)'=='Release' and '$(MinVerVersion)' != ''">
<Message Importance="high" Text="&#xA; Running Jellyfin Plugin Helper...&#xA; " />
<Exec Command="dotnet restore ../JellyfinPluginHelper/JellyfinPluginHelper.csproj" />
<MSBuild Projects="../JellyfinPluginHelper/JellyfinPluginHelper.csproj" Targets="Build" />
<MSBuild Projects="../JellyfinPluginHelper/JellyfinPluginHelper.csproj" Targets="Run" Properties="RunArguments=%22$(MinVerVersion)&quot; &quot;$(ProjectDir)../&quot; &quot;$(ProjectDir)$(OutDir)$(AssemblyName).dll&quot;" />
</Target>
</Project>

0 comments on commit 77d8ae4

Please sign in to comment.