update mac project

pull/702/head
Luke 10 years ago
parent 13cef31b4f
commit fb0c07aa93

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Reactive.Core" publicKeyToken="f300afd708cefcd3" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.20823.0" newVersion="2.0.20823.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Reactive.Interfaces" publicKeyToken="f300afd708cefcd3" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.20823.0" newVersion="2.0.20823.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

@ -25,8 +25,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.Providers", "M
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.Server.Implementations", "MediaBrowser.Server.Implementations\MediaBrowser.Server.Implementations.csproj", "{2E781478-814D-4A48-9D80-BFF206441A65}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.Server.Mono", "MediaBrowser.Server.Mono\MediaBrowser.Server.Mono.csproj", "{175A9388-F352-4586-A6B4-070DED62B644}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.Server.Startup.Common", "MediaBrowser.Server.Startup.Common\MediaBrowser.Server.Startup.Common.csproj", "{B90AB8F2-1BFF-4568-A3FD-2A338A435A75}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.WebDashboard", "MediaBrowser.WebDashboard\MediaBrowser.WebDashboard.csproj", "{5624B7B5-B5A7-41D8-9F10-CC5611109619}"
@ -60,20 +58,6 @@ Global
{0BD82FA6-EB8A-4452-8AF5-74F9C3849451}.Release|Any CPU.Build.0 = Release|Any CPU
{0BD82FA6-EB8A-4452-8AF5-74F9C3849451}.Release|x86.ActiveCfg = Release|Any CPU
{0BD82FA6-EB8A-4452-8AF5-74F9C3849451}.Release|x86.Build.0 = Release|Any CPU
{175A9388-F352-4586-A6B4-070DED62B644}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
{175A9388-F352-4586-A6B4-070DED62B644}.AppStore|Any CPU.Build.0 = Release|Any CPU
{175A9388-F352-4586-A6B4-070DED62B644}.Debug|Any CPU.ActiveCfg = Debug|x86
{175A9388-F352-4586-A6B4-070DED62B644}.Debug|Any CPU.Build.0 = Debug|x86
{175A9388-F352-4586-A6B4-070DED62B644}.Debug|x86.ActiveCfg = Debug|x86
{175A9388-F352-4586-A6B4-070DED62B644}.Debug|x86.Build.0 = Debug|x86
{175A9388-F352-4586-A6B4-070DED62B644}.Release Mono|Any CPU.ActiveCfg = Release Mono|Any CPU
{175A9388-F352-4586-A6B4-070DED62B644}.Release Mono|Any CPU.Build.0 = Release Mono|Any CPU
{175A9388-F352-4586-A6B4-070DED62B644}.Release Mono|x86.ActiveCfg = Release Mono|x86
{175A9388-F352-4586-A6B4-070DED62B644}.Release Mono|x86.Build.0 = Release Mono|x86
{175A9388-F352-4586-A6B4-070DED62B644}.Release|Any CPU.ActiveCfg = Release|Any CPU
{175A9388-F352-4586-A6B4-070DED62B644}.Release|Any CPU.Build.0 = Release|Any CPU
{175A9388-F352-4586-A6B4-070DED62B644}.Release|x86.ActiveCfg = Release|x86
{175A9388-F352-4586-A6B4-070DED62B644}.Release|x86.Build.0 = Release|x86
{17E1F4E6-8ABD-4FE5-9ECF-43D4B6087BA2}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
{17E1F4E6-8ABD-4FE5-9ECF-43D4B6087BA2}.AppStore|Any CPU.Build.0 = Release|Any CPU
{17E1F4E6-8ABD-4FE5-9ECF-43D4B6087BA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU

@ -1,32 +1,15 @@
<Properties>
<MonoDevelop.Ide.Workspace ActiveConfiguration="Release" />
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
<MonoDevelop.Ide.Workbench ActiveDocument="MediaBrowser.Server.Mac/Main.cs">
<Files>
<File FileName="MediaBrowser.Server.Mac/AppController.cs" Line="4" Column="4" />
<File FileName="MediaBrowser.Server.Mac/Main.cs" Line="4" Column="4" />
<File FileName="MediaBrowser.Common.Implementations/BaseApplicationPaths.cs" Line="13" Column="13" />
<File FileName="MediaBrowser.Server.Mac/app.config" Line="56" Column="56" />
<File FileName="MediaBrowser.WebDashboard/Api/PackageCreator.cs" Line="99" Column="99" />
<File FileName="MediaBrowser.Server.Mac/EmptyXmlFile.xml" Line="1" Column="1" />
<File FileName="MediaBrowser.Server.Mono/Program.cs" Line="9" Column="9" />
<File FileName="MediaBrowser.Server.Mac/AppDelegate.cs" Line="1" Column="1" />
<File FileName="MediaBrowser.Server.Mono/Networking/NetworkManager.cs" Line="1" Column="1" />
<File FileName="MediaBrowser.Server.Mono/Native/NativeApp.cs" Line="37" Column="37" />
<File FileName="MediaBrowser.Server.Mac/Main.cs" Line="120" Column="120" />
</Files>
<Pads>
<Pad Id="ProjectPad">
<State expanded="True" selected="True">
<Node name="MediaBrowser.Common.Implementations" expanded="True">
<Node name="Devices" expanded="True" />
</Node>
<Node name="MediaBrowser.Server.Implementations" expanded="True" />
<Node name="MediaBrowser.Server.Mac" expanded="True">
<Node name="Native" expanded="True" />
</Node>
<Node name="MediaBrowser.Server.Mono" expanded="True">
<Node name="Networking" expanded="True" />
</Node>
<Node name="MediaBrowser.Server.Startup.Common" expanded="True" />
<State expanded="True">
<Node name="MediaBrowser.Server.Mac" expanded="True" />
<Node name="MediaBrowser.Server.Mono" expanded="True" />
<Node name="MediaBrowser.Server.Startup.Common" expanded="True" selected="True" />
<Node name="MediaBrowser.WebDashboard" expanded="True">
<Node name="Api" expanded="True" />
</Node>

@ -0,0 +1,3 @@
<configuration>
<dllmap dll="libwebp" target="libwebp.5.dylib" os="osx"/>
</configuration>

@ -0,0 +1,3 @@
<configuration>
<dllmap dll="MediaInfo" target="libmediainfo.dylib" os="osx"/>
</configuration>

@ -69,10 +69,14 @@
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Drawing" />
<Reference Include="XamMac" />
<Reference Include="Mono.Posix">
<HintPath>..\packages\Mono.Posix.4.0.0.0\lib\net40\Mono.Posix.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
<Folder Include="Native\" />
<Folder Include="Resources\swagger-ui\" />
</ItemGroup>
<ItemGroup>
<Compile Include="AppDelegate.cs" />
@ -85,19 +89,24 @@
</Compile>
<Compile Include="Main.cs" />
<Compile Include="Native\NativeApp.cs" />
<Compile Include="Native\BaseMonoApp.cs" />
<Compile Include="Native\NetworkManager.cs" />
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="MainMenu.xib" />
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
<None Include="MediaBrowser.MediaInfo.dll.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Imazen.WebP.dll.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<ProjectReference Include="..\MediaBrowser.Server.Mono\MediaBrowser.Server.Mono.csproj">
<Project>{175A9388-F352-4586-A6B4-070DED62B644}</Project>
<Name>MediaBrowser.Server.Mono</Name>
</ProjectReference>
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj">
<Project>{7EEEB4BB-F3E8-48FC-B4C5-70F0FFF8329B}</Project>
<Name>MediaBrowser.Model</Name>
@ -126,4 +135,85 @@
<ItemGroup>
<Content Include="touchicon.png" />
</ItemGroup>
<ItemGroup>
<NativeReference Include="..\ThirdParty\MediaInfo\osx\libmediainfo.dylib">
<IsCxx>False</IsCxx>
<Kind>Dynamic</Kind>
</NativeReference>
<NativeReference Include="..\ThirdParty\libwebp\osx\libwebp.5.dylib">
<IsCxx>False</IsCxx>
<Kind>Dynamic</Kind>
</NativeReference>
<NativeReference Include="..\ThirdParty\SQLite3\osx\libsqlite3.0.dylib">
<IsCxx>False</IsCxx>
<Kind>Dynamic</Kind>
</NativeReference>
<NativeReference Include="..\ThirdParty\SQLite3\osx\libsqlite3.dylib">
<IsCxx>False</IsCxx>
<Kind>Dynamic</Kind>
</NativeReference>
<NativeReference Include="..\ThirdParty\libgdiplus\osx\libgdiplus.dylib">
<IsCxx>False</IsCxx>
<Kind>Dynamic</Kind>
</NativeReference>
</ItemGroup>
<ItemGroup>
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\index.html">
<Link>Resources\swagger-ui\index.html</Link>
</BundleResource>
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\swagger-ui.js">
<Link>Resources\swagger-ui\swagger-ui.js</Link>
</BundleResource>
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\swagger-ui.min.js">
<Link>Resources\swagger-ui\swagger-ui.min.js</Link>
</BundleResource>
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\css\screen.css">
<Link>Resources\swagger-ui\css\screen.css</Link>
</BundleResource>
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\images\logo_small.png">
<Link>Resources\swagger-ui\images\logo_small.png</Link>
</BundleResource>
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\images\pet_store_api.png">
<Link>Resources\swagger-ui\images\pet_store_api.png</Link>
</BundleResource>
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\images\throbber.gif">
<Link>Resources\swagger-ui\images\throbber.gif</Link>
</BundleResource>
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\images\wordnik_api.png">
<Link>Resources\swagger-ui\images\wordnik_api.png</Link>
</BundleResource>
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\lib\backbone-min.js">
<Link>Resources\swagger-ui\lib\backbone-min.js</Link>
</BundleResource>
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\lib\handlebars-1.0.0.js">
<Link>Resources\swagger-ui\lib\handlebars-1.0.0.js</Link>
</BundleResource>
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\lib\highlight.7.3.pack.js">
<Link>Resources\swagger-ui\lib\highlight.7.3.pack.js</Link>
</BundleResource>
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\lib\jquery-1.8.0.min.js">
<Link>Resources\swagger-ui\lib\jquery-1.8.0.min.js</Link>
</BundleResource>
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\lib\jquery.ba-bbq.min.js">
<Link>Resources\swagger-ui\lib\jquery.ba-bbq.min.js</Link>
</BundleResource>
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\lib\jquery.slideto.min.js">
<Link>Resources\swagger-ui\lib\jquery.slideto.min.js</Link>
</BundleResource>
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\lib\jquery.wiggle.min.js">
<Link>Resources\swagger-ui\lib\jquery.wiggle.min.js</Link>
</BundleResource>
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\lib\shred.bundle.js">
<Link>Resources\swagger-ui\lib\shred.bundle.js</Link>
</BundleResource>
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\lib\swagger.js">
<Link>Resources\swagger-ui\lib\swagger.js</Link>
</BundleResource>
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\lib\underscore-min.js">
<Link>Resources\swagger-ui\lib\underscore-min.js</Link>
</BundleResource>
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\lib\shred\content.js">
<Link>Resources\swagger-ui\lib\shred\content.js</Link>
</BundleResource>
</ItemGroup>
</Project>

@ -0,0 +1,165 @@
using MediaBrowser.Common.Net;
using MediaBrowser.Model.Logging;
using MediaBrowser.Server.Startup.Common;
using Mono.Unix.Native;
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text.RegularExpressions;
namespace MediaBrowser.Server.Mac
{
public abstract class BaseMonoApp : INativeApp
{
/// <summary>
/// Shutdowns this instance.
/// </summary>
public abstract void Shutdown();
/// <summary>
/// Restarts this instance.
/// </summary>
public void Restart()
{
}
/// <summary>
/// Determines whether this instance [can self restart].
/// </summary>
/// <returns><c>true</c> if this instance [can self restart]; otherwise, <c>false</c>.</returns>
public bool CanSelfRestart
{
get
{
return false;
}
}
/// <summary>
/// Gets a value indicating whether this instance can self update.
/// </summary>
/// <value><c>true</c> if this instance can self update; otherwise, <c>false</c>.</value>
public bool CanSelfUpdate
{
get
{
return false;
}
}
public bool SupportsAutoRunAtStartup
{
get { return false; }
}
public void PreventSystemStandby()
{
}
public List<Assembly> GetAssembliesWithParts()
{
var list = new List<Assembly>();
list.Add(GetType().Assembly);
return list;
}
public void AuthorizeServer(int httpServerPort, string httpServerUrlPrefix, int udpPort, string tempDirectory)
{
}
private NativeEnvironment _nativeEnvironment;
public NativeEnvironment Environment
{
get { return _nativeEnvironment ?? (_nativeEnvironment = GetEnvironmentInfo()); }
}
public bool SupportsRunningAsService
{
get
{
return false;
}
}
public bool IsRunningAsService
{
get
{
return false;
}
}
public void ConfigureAutoRun(bool autorun)
{
}
public INetworkManager CreateNetworkManager(ILogger logger)
{
return new NetworkManager(logger);
}
private NativeEnvironment GetEnvironmentInfo()
{
var info = new NativeEnvironment
{
OperatingSystem = Startup.Common.OperatingSystem.Linux
};
var uname = GetUnixName();
var sysName = uname.sysname ?? string.Empty;
info.OperatingSystem = Startup.Common.OperatingSystem.Osx;
var archX86 = new Regex("(i|I)[3-6]86");
if (archX86.IsMatch(uname.machine))
{
info.SystemArchitecture = Architecture.X86;
}
else if (string.Equals(uname.machine, "x86_64", StringComparison.OrdinalIgnoreCase))
{
info.SystemArchitecture = Architecture.X86_X64;
}
else if (uname.machine.StartsWith("arm", StringComparison.OrdinalIgnoreCase))
{
info.SystemArchitecture = Architecture.Arm;
}
info.OperatingSystemVersionString = string.IsNullOrWhiteSpace(sysName) ?
System.Environment.OSVersion.VersionString :
sysName;
return info;
}
private Uname _unixName;
private Uname GetUnixName()
{
if (_unixName == null)
{
var uname = new Uname();
Utsname utsname;
var callResult = Syscall.uname(out utsname);
if (callResult == 0)
{
uname.sysname = utsname.sysname;
uname.machine = utsname.machine;
}
_unixName = uname;
}
return _unixName;
}
private class Uname
{
public string sysname = string.Empty;
public string machine = string.Empty;
}
}
}

@ -1,5 +1,4 @@
using System;
using MediaBrowser.Server.Mono.Native;
namespace MediaBrowser.Server.Mac
{

@ -0,0 +1,39 @@
using MediaBrowser.Common.Implementations.Networking;
using MediaBrowser.Common.Net;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Net;
using System.Collections.Generic;
namespace MediaBrowser.Server.Mac
{
/// <summary>
/// Class NetUtils
/// </summary>
public class NetworkManager : BaseNetworkManager, INetworkManager
{
public NetworkManager(ILogger logger)
: base(logger)
{
}
/// <summary>
/// Gets the network shares.
/// </summary>
/// <param name="path">The path.</param>
/// <returns>IEnumerable{NetworkShare}.</returns>
public IEnumerable<NetworkShare> GetNetworkShares(string path)
{
return new List<NetworkShare> ();
}
/// <summary>
/// Gets available devices within the domain
/// </summary>
/// <returns>PC's in the Domain</returns>
public IEnumerable<FileSystemEntryInfo> GetNetworkDevices()
{
return new List<FileSystemEntryInfo> ();
}
}
}

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Mono.Posix" version="4.0.0.0" targetFramework="net45" />
</packages>
Loading…
Cancel
Save