diff --git a/Sitemapify.sln b/Sitemapify.sln index f92b4df..0ad3603 100644 --- a/Sitemapify.sln +++ b/Sitemapify.sln @@ -19,6 +19,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sitemapify.Umbraco", "src\S EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SitemapifyUmbracoSample", "sample\SitemapifyUmbracoSample\SitemapifyUmbracoSample.csproj", "{B9A91429-FB57-4568-8D88-804A9E00BAEA}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sitemapify.CastleWindsor", "src\Sitemapify.CastleWindsor\Sitemapify.CastleWindsor.csproj", "{D8A6AE48-A51D-4CF4-BCD1-47036A7443D4}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -45,6 +47,10 @@ Global {B9A91429-FB57-4568-8D88-804A9E00BAEA}.Debug|Any CPU.Build.0 = Debug|Any CPU {B9A91429-FB57-4568-8D88-804A9E00BAEA}.Release|Any CPU.ActiveCfg = Release|Any CPU {B9A91429-FB57-4568-8D88-804A9E00BAEA}.Release|Any CPU.Build.0 = Release|Any CPU + {D8A6AE48-A51D-4CF4-BCD1-47036A7443D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D8A6AE48-A51D-4CF4-BCD1-47036A7443D4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D8A6AE48-A51D-4CF4-BCD1-47036A7443D4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D8A6AE48-A51D-4CF4-BCD1-47036A7443D4}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -55,5 +61,6 @@ Global {4E4129F4-0FEB-4A66-8DEC-3E80D5764F80} = {F9DFA62C-7451-4648-BF0D-23C8E821D9E2} {1BC1FBB9-9E9E-417B-8BDC-A519FE7D4296} = {84B1F178-A2EC-4349-A23F-85BE79C8BFF7} {B9A91429-FB57-4568-8D88-804A9E00BAEA} = {F9DFA62C-7451-4648-BF0D-23C8E821D9E2} + {D8A6AE48-A51D-4CF4-BCD1-47036A7443D4} = {84B1F178-A2EC-4349-A23F-85BE79C8BFF7} EndGlobalSection EndGlobal diff --git a/build.cake b/build.cake index f129593..9719e63 100644 --- a/build.cake +++ b/build.cake @@ -114,14 +114,18 @@ Task("Copy-Files") EnsureDirectoryExists(buildOutput +"/Sitemapify.Umbraco"); EnsureDirectoryExists(buildOutput +"/Sitemapify.Umbraco/lib/net45"); - CopyFile("./src/Sitemapify.Umbraco/bin/" +configuration +"/Sitemapify.Umbraco.dll", buildOutput +"/Sitemapify.Umbraco/lib/net45/Sitemapify.dll"); - CopyFile("./src/Sitemapify.Umbraco/bin/" +configuration +"/Sitemapify.Umbraco.pdb", buildOutput +"/Sitemapify.Umbraco/lib/net45//Sitemapify.pdb"); + CopyFile("./src/Sitemapify.Umbraco/bin/" +configuration +"/Sitemapify.Umbraco.dll", buildOutput +"/Sitemapify.Umbraco/lib/net45/Sitemapify.Umbraco.dll"); + CopyFile("./src/Sitemapify.Umbraco/bin/" +configuration +"/Sitemapify.Umbraco.pdb", buildOutput +"/Sitemapify.Umbraco/lib/net45//Sitemapify.Umbraco.pdb"); + + EnsureDirectoryExists(buildOutput +"/Sitemapify.CastleWindsor"); + EnsureDirectoryExists(buildOutput +"/Sitemapify.CastleWindsor/lib/net45"); + CopyFile("./src/Sitemapify.CastleWindsor/bin/" +configuration +"/Sitemapify.CastleWindsor.dll", buildOutput +"/Sitemapify.CastleWindsor/lib/net45/Sitemapify.CastleWindsor.dll"); + CopyFile("./src/Sitemapify.CastleWindsor/bin/" +configuration +"/Sitemapify.CastleWindsor.pdb", buildOutput +"/Sitemapify.CastleWindsor/lib/net45//Sitemapify.CastleWindsor.pdb"); }); Task("Create-NuGet-Package") .IsDependentOn("Build") .IsDependentOn("Copy-Files") - .WithCriteria(() => FileExists("./nuspec/Sitemapify.nuspec")) .Does(() => { EnsureDirectoryExists(artifacts +"/packages/"); @@ -153,6 +157,22 @@ Task("Create-NuGet-Package") new NuSpecDependency { Id = "Sitemapify", Version = "[" +versionInfo.NuGetVersionV2 +"]"} } }); + + NuGetPack("./nuspec/Sitemapify.CastleWindsor.nuspec", new NuGetPackSettings { + BasePath = buildOutput +"/Sitemapify.CastleWindsor", + Properties = new Dictionary { { "Configuration", configuration }}, + Symbols = false, + NoPackageAnalysis = true, + Version = versionInfo.NuGetVersionV2, + OutputDirectory = artifacts +"/packages/", + Files = new[] { + new NuSpecContent { Source = "**/*", Target = "" }, + }, + Dependencies = new[] { + new NuSpecDependency { Id = "Castle.Windsor", Version = "[3.1,4]" }, + new NuSpecDependency { Id = "Sitemapify", Version = "[" +versionInfo.NuGetVersionV2 +"]"} + } + }); }); Task("Update-AppVeyor-Build-Number") diff --git a/nuspec/Sitemapify.CastleWindsor.nuspec b/nuspec/Sitemapify.CastleWindsor.nuspec new file mode 100644 index 0000000..4570474 --- /dev/null +++ b/nuspec/Sitemapify.CastleWindsor.nuspec @@ -0,0 +1,21 @@ + + + + Sitemapify.CastleWindsor + Sitemapify Castle Windsor Adapter + Provides a castle windsor adapter for the sitemapify ASP.NET sitemap handler + Phil Oyston + Phil Oyston + https://raw.githubusercontent.com/stormid/sitemapify/master/LICENSE + https://github.com/stormid/sitemapify + https://raw.githubusercontent.com/stormid/sitemapify/master/docs/img/sitemap.png + false + sitemap seo webforms mvc castle windsor + + + + + + + + \ No newline at end of file diff --git a/nuspec/Sitemapify.Umbraco.nuspec b/nuspec/Sitemapify.Umbraco.nuspec index ce964e9..fc6fd5b 100644 --- a/nuspec/Sitemapify.Umbraco.nuspec +++ b/nuspec/Sitemapify.Umbraco.nuspec @@ -10,9 +10,10 @@ https://github.com/stormid/sitemapify https://raw.githubusercontent.com/stormid/sitemapify/master/docs/img/sitemap.png false - sitemap seo webforms mvc + sitemap seo webforms mvc umbraco + diff --git a/src/Sitemapify.CastleWindsor/CastleWindsorSitemapifyContainerAdapter.cs b/src/Sitemapify.CastleWindsor/CastleWindsorSitemapifyContainerAdapter.cs new file mode 100644 index 0000000..510a956 --- /dev/null +++ b/src/Sitemapify.CastleWindsor/CastleWindsorSitemapifyContainerAdapter.cs @@ -0,0 +1,21 @@ +using Castle.Core.Configuration; +using Castle.MicroKernel; +using Sitemapify.Config; + +namespace Sitemapify.CastleWindsor +{ + public class CastleWindsorSitemapifyContainerAdapter : ISitemapContainerAdapter + { + private readonly IKernel _kernel; + public CastleWindsorSitemapifyContainerAdapter(IKernel kernel) + { + _kernel = kernel; + } + + public T Resolve() where T : class + { + if (_kernel.HasComponent(typeof (T))) return _kernel.Resolve(); + return null; + } + } +} diff --git a/src/Sitemapify.CastleWindsor/Properties/AssemblyInfo.cs b/src/Sitemapify.CastleWindsor/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..41e9d6b --- /dev/null +++ b/src/Sitemapify.CastleWindsor/Properties/AssemblyInfo.cs @@ -0,0 +1,6 @@ +using System.Reflection; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Sitemapify.CastleWindsor")] \ No newline at end of file diff --git a/src/Sitemapify.CastleWindsor/Sitemapify.CastleWindsor.csproj b/src/Sitemapify.CastleWindsor/Sitemapify.CastleWindsor.csproj new file mode 100644 index 0000000..2fd6548 --- /dev/null +++ b/src/Sitemapify.CastleWindsor/Sitemapify.CastleWindsor.csproj @@ -0,0 +1,75 @@ + + + + + Debug + AnyCPU + {D8A6AE48-A51D-4CF4-BCD1-47036A7443D4} + Library + Properties + Sitemapify.CastleWindsor + Sitemapify.CastleWindsor + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\Castle.Core.3.3.0\lib\net45\Castle.Core.dll + True + + + ..\..\packages\Castle.Windsor.3.3.0\lib\net45\Castle.Windsor.dll + True + + + + + + + + + + + + + Properties\VersionAssemblyInfo.cs + + + + + + + + + + + {16ed145c-cd29-4063-95c0-bd7c46d86d18} + Sitemapify + + + + + \ No newline at end of file diff --git a/src/Sitemapify.CastleWindsor/SitemapifyWindsorInstaller.cs b/src/Sitemapify.CastleWindsor/SitemapifyWindsorInstaller.cs new file mode 100644 index 0000000..8b683c4 --- /dev/null +++ b/src/Sitemapify.CastleWindsor/SitemapifyWindsorInstaller.cs @@ -0,0 +1,24 @@ +using Castle.MicroKernel.Registration; +using Castle.MicroKernel.SubSystems.Configuration; +using Castle.Windsor; +using Sitemapify.Builders; +using Sitemapify.Builders.Impl; +using Sitemapify.Providers; +using Sitemapify.Providers.Impl; + +namespace Sitemapify.CastleWindsor +{ + public class SitemapifyWindsorInstaller : IWindsorInstaller + { + public void Install(IWindsorContainer container, IConfigurationStore store) + { + container.Register( + Component.For().ImplementedBy().IsFallback().LifestylePerWebRequest(), + Component.For().ImplementedBy().IsFallback().LifestylePerWebRequest(), + Component.For().ImplementedBy().IsFallback().LifestylePerWebRequest() + ); + + Configure.With(new CastleWindsorSitemapifyContainerAdapter(container.Kernel)); + } + } +} \ No newline at end of file diff --git a/src/Sitemapify.CastleWindsor/packages.config b/src/Sitemapify.CastleWindsor/packages.config new file mode 100644 index 0000000..010612f --- /dev/null +++ b/src/Sitemapify.CastleWindsor/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file