From 510621f1bce4933038ed063fcb6570ddc89bf2c8 Mon Sep 17 00:00:00 2001 From: Renaud Paquay Date: Fri, 16 Jul 2010 18:17:34 -0700 Subject: [PATCH] Update MsDeploy package to include module binaries --HG-- branch : dev --- Orchard.proj | 40 +++++++++++++------ .../FilterModuleBinaries.cs | 30 ++++++++++++++ .../MSBuild.Orchard.Tasks.csproj | 1 + 3 files changed, 59 insertions(+), 12 deletions(-) create mode 100644 src/Tools/MSBuild.Orchard.Tasks/FilterModuleBinaries.cs diff --git a/Orchard.proj b/Orchard.proj index 1ed293ffc..e70bada06 100644 --- a/Orchard.proj +++ b/Orchard.proj @@ -90,29 +90,45 @@ + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - + + - + diff --git a/src/Tools/MSBuild.Orchard.Tasks/FilterModuleBinaries.cs b/src/Tools/MSBuild.Orchard.Tasks/FilterModuleBinaries.cs new file mode 100644 index 000000000..4faa0d4da --- /dev/null +++ b/src/Tools/MSBuild.Orchard.Tasks/FilterModuleBinaries.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +namespace MSBuild.Orchard.Tasks { + public class FilterModuleBinaries : Task { + public ITaskItem[] ModulesBinaries { get; set; } + public ITaskItem[] OrchardWebBinaries { get; set; } + + [Output] + public ITaskItem[] ExcludedBinaries { get; set; } + + public override bool Execute() { + + var orchardWebAssemblies = new HashSet( + OrchardWebBinaries.Select(item => Path.GetFileName(item.ItemSpec)), + StringComparer.InvariantCultureIgnoreCase); + + ExcludedBinaries = ModulesBinaries + .Where(item => orchardWebAssemblies.Contains(Path.GetFileName(item.ItemSpec))) + .Select(item => new TaskItem(item)) + .ToArray(); + + return true; + } + } +} diff --git a/src/Tools/MSBuild.Orchard.Tasks/MSBuild.Orchard.Tasks.csproj b/src/Tools/MSBuild.Orchard.Tasks/MSBuild.Orchard.Tasks.csproj index 53dcd64ee..32554a3f5 100644 --- a/src/Tools/MSBuild.Orchard.Tasks/MSBuild.Orchard.Tasks.csproj +++ b/src/Tools/MSBuild.Orchard.Tasks/MSBuild.Orchard.Tasks.csproj @@ -66,6 +66,7 @@ +