diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/DotNetOpenAuth.BuildTasks/CreateWebApplication.cs | 4 | ||||
-rw-r--r-- | src/DotNetOpenAuth.BuildTasks/DotNetOpenAuth.BuildTasks.csproj | 1 | ||||
-rw-r--r-- | src/DotNetOpenAuth.BuildTasks/FilterItems.cs | 24 |
3 files changed, 28 insertions, 1 deletions
diff --git a/src/DotNetOpenAuth.BuildTasks/CreateWebApplication.cs b/src/DotNetOpenAuth.BuildTasks/CreateWebApplication.cs index 056a49b..4980898 100644 --- a/src/DotNetOpenAuth.BuildTasks/CreateWebApplication.cs +++ b/src/DotNetOpenAuth.BuildTasks/CreateWebApplication.cs @@ -66,11 +66,13 @@ namespace DotNetOpenAuth.BuildTasks { return false; } + Log.LogMessage(MessageImportance.Normal, "Creating web applications under web site: {0}", site.Name); + for (int i = 0; i < this.PhysicalPaths.Length; i++) { string physicalPath = this.PhysicalPaths[i].ItemSpec; string virtualPath = this.VirtualPaths[i].ItemSpec; - Log.LogMessage(MessageImportance.Normal, "Creating web application: {0} -> {1}", virtualPath, physicalPath); + Log.LogMessage(MessageImportance.Normal, "\t{0} -> {1}", virtualPath, physicalPath); var app = site.Applications.FirstOrDefault(a => string.Equals(a.Path, virtualPath, StringComparison.OrdinalIgnoreCase)); if (app == null) { diff --git a/src/DotNetOpenAuth.BuildTasks/DotNetOpenAuth.BuildTasks.csproj b/src/DotNetOpenAuth.BuildTasks/DotNetOpenAuth.BuildTasks.csproj index 8a46e44..4eb920e 100644 --- a/src/DotNetOpenAuth.BuildTasks/DotNetOpenAuth.BuildTasks.csproj +++ b/src/DotNetOpenAuth.BuildTasks/DotNetOpenAuth.BuildTasks.csproj @@ -53,6 +53,7 @@ <Compile Include="ChangeAssemblyReference.cs" /> <Compile Include="CreateWebApplication.cs" /> <Compile Include="DeleteWebApplication.cs" /> + <Compile Include="FilterItems.cs" /> <Compile Include="GetBuildVersion.cs" /> <Compile Include="CheckAdminRights.cs" /> <Compile Include="ReSignDelaySignedAssemblies.cs" /> diff --git a/src/DotNetOpenAuth.BuildTasks/FilterItems.cs b/src/DotNetOpenAuth.BuildTasks/FilterItems.cs new file mode 100644 index 0000000..97631c6 --- /dev/null +++ b/src/DotNetOpenAuth.BuildTasks/FilterItems.cs @@ -0,0 +1,24 @@ +namespace DotNetOpenAuth.BuildTasks { + using System; + using System.Collections.Generic; + using System.Linq; + using System.Text; + using Microsoft.Build.Utilities; + using Microsoft.Build.Framework; + + public class FilterItems : Task { + [Required] + public ITaskItem[] InputItems { get; set; } + + [Required] + public ITaskItem[] StartsWithAny { get; set; } + + [Output] + public ITaskItem[] FilteredItems { get; set; } + + public override bool Execute() { + FilteredItems = InputItems.Where(item => StartsWithAny.Any(filter => item.ItemSpec.StartsWith(filter.ItemSpec, StringComparison.OrdinalIgnoreCase))).ToArray(); + return true; + } + } +} |