aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukePulverenti <luke.pulverenti@gmail.com>2013-02-20 21:40:36 -0500
committerLukePulverenti <luke.pulverenti@gmail.com>2013-02-20 21:40:36 -0500
commit509156cbc3497ff8daabefd3dba843f5b085701a (patch)
treeb97879f175ee1ca225354b367eb3d287dd8cd25b
parent767cdc1f6f6a63ce997fc9476911e2c361f9d402 (diff)
remove core plugin output from source control
-rw-r--r--.gitignore1
-rw-r--r--.hgignore49
-rw-r--r--.hgtags5
-rw-r--r--MediaBrowser.Api/MediaBrowser.Api.csproj2
-rw-r--r--MediaBrowser.ApiInteraction.Javascript/MediaBrowser.ApiInteraction.Javascript.csproj2
-rw-r--r--MediaBrowser.Common/Kernel/BaseKernel.cs27
-rw-r--r--MediaBrowser.Common/Net/HttpServer.cs80
-rw-r--r--MediaBrowser.Controller/Kernel.cs12
-rw-r--r--MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj6
-rw-r--r--MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj2
10 files changed, 70 insertions, 116 deletions
diff --git a/.gitignore b/.gitignore
index 4922421b7..0535685c3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,6 +31,7 @@ local.properties
#################
## Media Browser
#################
+CorePlugins*/
ProgramData*/
ProgramData-Server*/
ProgramData-UI*/
diff --git a/.hgignore b/.hgignore
deleted file mode 100644
index c5c5c4877..000000000
--- a/.hgignore
+++ /dev/null
@@ -1,49 +0,0 @@
-# use glob syntax
-syntax: glob
-
-*.obj
-*.pdb
-*.user
-*.aps
-*.pch
-*.vspscc
-*.vssscc
-*_i.c
-*_p.c
-*.ncb
-*.suo
-*.tlb
-*.tlh
-*.bak
-*.cache
-*.ilk
-*.log
-*.lib
-*.sbr
-*.scc
-*.psess
-*.vsp
-*.vspx
-*.orig
-*.rej
-*.sdf
-*.opensdf
-*.ipch
-[Bb]in
-[Dd]ebug*/
-obj/
-[Rr]elease*/
-ProgramData*/
-ProgramData-Server*/
-ProgramData-UI*/
-_ReSharper*/
-[Tt]humbs.db
-[Tt]est[Rr]esult*
-[Bb]uild[Ll]og.*
-*.[Pp]ublish.xml
-*.resharper
-
-# ncrunch files
-*.ncrunchsolution
-*.ncrunchproject
-Setup/*
diff --git a/.hgtags b/.hgtags
deleted file mode 100644
index 497220570..000000000
--- a/.hgtags
+++ /dev/null
@@ -1,5 +0,0 @@
-811bcaa9490681194bd72a01c4b0f91d78a0ec97 CO Version 0.12.12.25
-811bcaa9490681194bd72a01c4b0f91d78a0ec97 CO Version 0.12.12.25
-0000000000000000000000000000000000000000 CO Version 0.12.12.25
-0000000000000000000000000000000000000000 CO Version 0.12.12.25
-e98137e38224a0d82cd7d98a71264e0cddc91ca4 CO Version 0.12.12.25
diff --git a/MediaBrowser.Api/MediaBrowser.Api.csproj b/MediaBrowser.Api/MediaBrowser.Api.csproj
index baa515fb2..ed3a1b343 100644
--- a/MediaBrowser.Api/MediaBrowser.Api.csproj
+++ b/MediaBrowser.Api/MediaBrowser.Api.csproj
@@ -148,7 +148,7 @@
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
- <PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)\MediaBrowser.ServerApplication\" /y</PostBuildEvent>
+ <PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)\MediaBrowser.ServerApplication\CorePlugins\" /y</PostBuildEvent>
</PropertyGroup>
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
diff --git a/MediaBrowser.ApiInteraction.Javascript/MediaBrowser.ApiInteraction.Javascript.csproj b/MediaBrowser.ApiInteraction.Javascript/MediaBrowser.ApiInteraction.Javascript.csproj
index e91c72670..984a28ad7 100644
--- a/MediaBrowser.ApiInteraction.Javascript/MediaBrowser.ApiInteraction.Javascript.csproj
+++ b/MediaBrowser.ApiInteraction.Javascript/MediaBrowser.ApiInteraction.Javascript.csproj
@@ -102,7 +102,7 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
- <PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)\MediaBrowser.ServerApplication\" /y</PostBuildEvent>
+ <PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)\MediaBrowser.ServerApplication\CorePlugins\" /y</PostBuildEvent>
</PropertyGroup>
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
diff --git a/MediaBrowser.Common/Kernel/BaseKernel.cs b/MediaBrowser.Common/Kernel/BaseKernel.cs
index a4cd81665..616a0305c 100644
--- a/MediaBrowser.Common/Kernel/BaseKernel.cs
+++ b/MediaBrowser.Common/Kernel/BaseKernel.cs
@@ -3,7 +3,6 @@ using MediaBrowser.Common.IO;
using MediaBrowser.Common.Localization;
using MediaBrowser.Common.Mef;
using MediaBrowser.Common.Net;
-using MediaBrowser.Common.Net.Handlers;
using MediaBrowser.Common.Plugins;
using MediaBrowser.Common.ScheduledTasks;
using MediaBrowser.Common.Serialization;
@@ -17,7 +16,6 @@ using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
-using System.ComponentModel.Composition.Primitives;
using System.Deployment.Application;
using System.Diagnostics;
using System.IO;
@@ -517,6 +515,31 @@ namespace MediaBrowser.Common.Kernel
yield return pluginAssembly;
}
+ var runningDirectory = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);
+ var corePluginDirectory = Path.Combine(runningDirectory, "CorePlugins");
+
+ // This will prevent the .dll file from getting locked, and allow us to replace it when needed
+ pluginAssemblies = Directory.EnumerateFiles(corePluginDirectory, "*.dll", SearchOption.TopDirectoryOnly)
+ .Select(file =>
+ {
+ try
+ {
+ return Assembly.Load(File.ReadAllBytes((file)));
+ }
+ catch (Exception ex)
+ {
+ _failedPluginAssemblies.Add(file);
+ Logger.ErrorException("Error loading {0}", ex, file);
+ return null;
+ }
+
+ }).Where(a => a != null);
+
+ foreach (var pluginAssembly in pluginAssemblies)
+ {
+ yield return pluginAssembly;
+ }
+
// Include composable parts in the Model assembly
yield return typeof (SystemInfo).Assembly;
diff --git a/MediaBrowser.Common/Net/HttpServer.cs b/MediaBrowser.Common/Net/HttpServer.cs
index efd6d9d32..7bb81c1ca 100644
--- a/MediaBrowser.Common/Net/HttpServer.cs
+++ b/MediaBrowser.Common/Net/HttpServer.cs
@@ -209,56 +209,52 @@ namespace MediaBrowser.Common.Net
RaiseReceiveWebRequest(context);
- Task.Run(() =>
+ try
{
- try
- {
- ProcessRequest(context);
- }
- catch (InvalidOperationException ex)
- {
- HandleException(context.Response, ex, 422);
-
- throw;
- }
- catch (ResourceNotFoundException ex)
- {
- HandleException(context.Response, ex, 404);
+ ProcessRequest(context);
+ }
+ catch (InvalidOperationException ex)
+ {
+ HandleException(context.Response, ex, 422);
- throw;
- }
- catch (FileNotFoundException ex)
- {
- HandleException(context.Response, ex, 404);
+ throw;
+ }
+ catch (ResourceNotFoundException ex)
+ {
+ HandleException(context.Response, ex, 404);
- throw;
- }
- catch (DirectoryNotFoundException ex)
- {
- HandleException(context.Response, ex, 404);
+ throw;
+ }
+ catch (FileNotFoundException ex)
+ {
+ HandleException(context.Response, ex, 404);
- throw;
- }
- catch (UnauthorizedAccessException ex)
- {
- HandleException(context.Response, ex, 401);
+ throw;
+ }
+ catch (DirectoryNotFoundException ex)
+ {
+ HandleException(context.Response, ex, 404);
- throw;
- }
- catch (ArgumentException ex)
- {
- HandleException(context.Response, ex, 400);
+ throw;
+ }
+ catch (UnauthorizedAccessException ex)
+ {
+ HandleException(context.Response, ex, 401);
- throw;
- }
- catch (Exception ex)
- {
- HandleException(context.Response, ex, 500);
+ throw;
+ }
+ catch (ArgumentException ex)
+ {
+ HandleException(context.Response, ex, 400);
- throw;
- }
+ throw;
+ }
+ catch (Exception ex)
+ {
+ HandleException(context.Response, ex, 500);
- });
+ throw;
+ }
}
/// <summary>
diff --git a/MediaBrowser.Controller/Kernel.cs b/MediaBrowser.Controller/Kernel.cs
index aca7c4bd2..803c4774e 100644
--- a/MediaBrowser.Controller/Kernel.cs
+++ b/MediaBrowser.Controller/Kernel.cs
@@ -412,18 +412,6 @@ namespace MediaBrowser.Controller
await Task.WhenAll(itemRepoTask, userRepoTask, userDataRepoTask, displayPreferencesRepoTask).ConfigureAwait(false);
}
- protected override IEnumerable<Assembly> GetComposablePartAssemblies()
- {
- var runningDirectory = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);
-
- return base.GetComposablePartAssemblies().Concat(new[] {
-
- Assembly.Load(File.ReadAllBytes(Path.Combine(runningDirectory, "MediaBrowser.Api.dll"))),
- Assembly.Load(File.ReadAllBytes(Path.Combine(runningDirectory, "MediaBrowser.ApiInteraction.Javascript.dll"))),
- Assembly.Load(File.ReadAllBytes(Path.Combine(runningDirectory, "MediaBrowser.WebDashboard.dll")))
- });
- }
-
/// <summary>
/// Gets a repository by name from a list, and returns the default if not found
/// </summary>
diff --git a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj
index f318600ba..f7799557e 100644
--- a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj
+++ b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj
@@ -314,13 +314,13 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
- <Content Include="MediaBrowser.Api.dll">
+ <Content Include="CorePlugins\MediaBrowser.Api.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
- <Content Include="MediaBrowser.ApiInteraction.Javascript.dll">
+ <Content Include="CorePlugins\MediaBrowser.ApiInteraction.Javascript.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
- <Content Include="MediaBrowser.WebDashboard.dll">
+ <Content Include="CorePlugins\MediaBrowser.WebDashboard.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="x64\SQLite.Interop.dll">
diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
index 4e2ee0c66..9a1c89c66 100644
--- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
+++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
@@ -400,7 +400,7 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
- <PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)\MediaBrowser.ServerApplication\" /y</PostBuildEvent>
+ <PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)\MediaBrowser.ServerApplication\CorePlugins\" /y</PostBuildEvent>
</PropertyGroup>
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.