mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Build: Merging windows and linux targets for the windows host because VS does not support the import
This commit is contained in:
parent
61439695a8
commit
aef5ce59cb
@ -28,7 +28,7 @@ namespace Kyoo.Authentication
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Convert a user to an <see cref="IdentityServerUser"/>.
|
/// Convert a user to an IdentityServerUser.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="user">The user to convert.</param>
|
/// <param name="user">The user to convert.</param>
|
||||||
/// <returns>The corresponding identity server user.</returns>
|
/// <returns>The corresponding identity server user.</returns>
|
||||||
|
@ -1,12 +1,43 @@
|
|||||||
<Project>
|
<Project ToolsVersion="Current">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ProjectGuid>{98851001-40DD-46A6-94B3-2F8D90722076}</ProjectGuid>
|
<IsWindows Condition="$([MSBuild]::IsOSPlatform('Windows'))">true</IsWindows>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<Import Project="Kyoo.Host.WindowsTrait.target" Condition="$(IsWindows) == true" />
|
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
|
||||||
<Import Project="Kyoo.Host.WindowsTrait.linux.target" Condition="$(IsWindows) != true" />
|
|
||||||
|
|
||||||
<ItemGroup>
|
<PropertyGroup Condition="$(IsWindows) == true">
|
||||||
<None Remove="*.target" />
|
<OutputType>WinExe</OutputType>
|
||||||
|
<TargetFramework>net5.0-windows</TargetFramework>
|
||||||
|
<UseWindowsForms>true</UseWindowsForms>
|
||||||
|
<RootNamespace>Kyoo.WindowsHost</RootNamespace>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup Condition="$(IsWindows) == true">
|
||||||
|
<ProjectReference Include="../Kyoo.Core/Kyoo.Core.csproj" />
|
||||||
|
<ProjectReference Include="../Kyoo.Host.Console/Kyoo.Host.Console.csproj" Condition="$(IncludeConsole) == true" />
|
||||||
|
|
||||||
|
<None Remove="kyoo.ico" />
|
||||||
|
<Content Include="kyoo.ico">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="$(IsWindows) != true">
|
||||||
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
|
<NoWarn>NU1503</NoWarn>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
|
||||||
|
|
||||||
|
<Target Name="Build" Condition="$(IsWindows) != true">
|
||||||
|
<Message Importance="high" Text="Detected current operating system is not windows, skipping WindowsHost build." />
|
||||||
|
</Target>
|
||||||
|
<Target Name="Clean" Condition="$(IsWindows) != true" />
|
||||||
|
<Target Name="Pack" Condition="$(IsWindows) != true" />
|
||||||
|
<Target Name="Restore" Condition="$(IsWindows) != true" />
|
||||||
|
<Target Name="Publish" Condition="$(IsWindows) != true" />
|
||||||
|
|
||||||
|
<ItemGroup Condition="$(IsWindows) != true">
|
||||||
|
<None Include="@(Compile)" Visible="true" />
|
||||||
|
<Compile Remove="*" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
<Project>
|
|
||||||
<!-- Project file used instead of the default csproj when the host system is not windows. This only skip the build. -->
|
|
||||||
|
|
||||||
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net5.0</TargetFramework>
|
|
||||||
<NoWarn>NU1503</NoWarn>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
|
|
||||||
|
|
||||||
<Target Name="Build">
|
|
||||||
<Message Importance="high" Text="Detected current operating system is not windows, skipping WindowsHost build." />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<Target Name="Clean" />
|
|
||||||
<Target Name="Pack" />
|
|
||||||
<Target Name="Restore" />
|
|
||||||
<Target Name="Publish" />
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="@(Compile)" Visible="true" />
|
|
||||||
<Compile Remove="*" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
@ -1,24 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
<!-- Project file used instead of the default csproj when the host system is windows.
|
|
||||||
This is the real csproj used to compile the project.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<OutputType>WinExe</OutputType>
|
|
||||||
<TargetFramework>net5.0-windows</TargetFramework>
|
|
||||||
<UseWindowsForms>true</UseWindowsForms>
|
|
||||||
<RootNamespace>Kyoo.WindowsHost</RootNamespace>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="../Kyoo.Core/Kyoo.Core.csproj" />
|
|
||||||
<ProjectReference Include="../Kyoo.Host.Console/Kyoo.Host.Console.csproj" Condition="$(IncludeConsole) == true" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Remove="kyoo.ico"/>
|
|
||||||
<Content Include="kyoo.ico">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
@ -31,7 +31,6 @@ namespace Kyoo.Host.WindowsTrait
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private Thread _thread;
|
private Thread _thread;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a new <see cref="SystemTrait"/>.
|
/// Create a new <see cref="SystemTrait"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -73,8 +72,8 @@ namespace Kyoo.Host.WindowsTrait
|
|||||||
private readonly IApplication _application;
|
private readonly IApplication _application;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The options containing the <see cref="BasicOptions.PublicUrl"/>.
|
/// The options containing the <see cref="BasicOptions.PublicUrl"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly IOptions<BasicOptions> _options;
|
private readonly IOptions<BasicOptions> _options;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -95,10 +94,12 @@ namespace Kyoo.Host.WindowsTrait
|
|||||||
AppDomain.CurrentDomain.ProcessExit += (_, _) => Dispose();
|
AppDomain.CurrentDomain.ProcessExit += (_, _) => Dispose();
|
||||||
System.Windows.Forms.Application.ApplicationExit += (_, _) => Dispose();
|
System.Windows.Forms.Application.ApplicationExit += (_, _) => Dispose();
|
||||||
|
|
||||||
_icon = new NotifyIcon();
|
_icon = new NotifyIcon
|
||||||
_icon.Text = "Kyoo";
|
{
|
||||||
_icon.Icon = new Icon(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "kyoo.ico"));
|
Text = "Kyoo",
|
||||||
_icon.Visible = true;
|
Icon = new Icon(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "kyoo.ico")),
|
||||||
|
Visible = true
|
||||||
|
};
|
||||||
_icon.MouseClick += (_, e) =>
|
_icon.MouseClick += (_, e) =>
|
||||||
{
|
{
|
||||||
if (e.Button != MouseButtons.Left)
|
if (e.Button != MouseButtons.Left)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user