Permalink
Browse files

Intitial checkin of Windsor Bootstrapper. Leaks memory however

  • Loading branch information...
chris.nicola
chris.nicola committed Aug 10, 2011
0 parents commit 3cfcbbf361a2fcee6017c6d4217d9603034ec59e
Showing with 64,015 additions and 0 deletions.
  1. +3 −0 .gitmodules
  2. +1 −0 dependencies/Nancy
  3. +49 −0 how_to_build.txt
  4. +21 −0 license.txt
  5. +133 −0 rakefile.rb
  6. +13 −0 readme.md
  7. +91 −0 src/Nancy.BootStrappers.Windsor.Tests/Nancy.BootStrappers.Windsor.Tests.csproj
  8. +145 −0 src/Nancy.BootStrappers.Windsor.Tests/WindsorNancyBootStrapperFixture.cs
  9. +7 −0 src/Nancy.BootStrappers.Windsor.Tests/packages.config
  10. +46 −0 src/Nancy.BootStrappers.Windsor.sln
  11. +87 −0 src/Nancy.BootStrappers.Windsor/HybridLifestyleManager.cs
  12. +74 −0 src/Nancy.BootStrappers.Windsor/Nancy.BootStrappers.Windsor.csproj
  13. +23 −0 src/Nancy.BootStrappers.Windsor/WindsorModuleKeyGenerator.cs
  14. +110 −0 src/Nancy.BootStrappers.Windsor/WindsorNancyAspNetBootstrapper.cs
  15. +5 −0 src/Nancy.BootStrappers.Windsor/packages.config
  16. BIN src/packages/Castle.Core.2.5.2/Castle.Core.2.5.2.nupkg
  17. +57 −0 src/packages/Castle.Core.2.5.2/lib/ASL - Apache Software Foundation License.txt
  18. +55 −0 src/packages/Castle.Core.2.5.2/lib/BreakingChanges.txt
  19. +145 −0 src/packages/Castle.Core.2.5.2/lib/Changes.txt
  20. +80 −0 src/packages/Castle.Core.2.5.2/lib/Committers.txt
  21. BIN src/packages/Castle.Core.2.5.2/lib/NET35/Castle.Core.dll
  22. +4,927 −0 src/packages/Castle.Core.2.5.2/lib/NET35/Castle.Core.xml
  23. BIN src/packages/Castle.Core.2.5.2/lib/NET40ClientProfile/Castle.Core.dll
  24. +4,927 −0 src/packages/Castle.Core.2.5.2/lib/NET40ClientProfile/Castle.Core.xml
  25. BIN src/packages/Castle.Core.2.5.2/lib/SL3/Castle.Core.dll
  26. +4,443 −0 src/packages/Castle.Core.2.5.2/lib/SL3/Castle.Core.xml
  27. BIN src/packages/Castle.Core.2.5.2/lib/SL4/Castle.Core.dll
  28. +4,443 −0 src/packages/Castle.Core.2.5.2/lib/SL4/Castle.Core.xml
  29. +8 −0 src/packages/Castle.Core.2.5.2/lib/releaseNotes.txt
  30. BIN src/packages/Castle.Windsor.2.5.3/Castle.Windsor.2.5.3.nupkg
  31. +57 −0 src/packages/Castle.Windsor.2.5.3/lib/ASL - Apache Software Foundation License.txt
  32. +303 −0 src/packages/Castle.Windsor.2.5.3/lib/BreakingChanges.txt
  33. +822 −0 src/packages/Castle.Windsor.2.5.3/lib/Changes.txt
  34. +80 −0 src/packages/Castle.Windsor.2.5.3/lib/Committers.txt
  35. BIN src/packages/Castle.Windsor.2.5.3/lib/NET35/Castle.Windsor.dll
  36. BIN src/packages/Castle.Windsor.2.5.3/lib/NET35/Castle.Windsor.pdb
  37. +7,741 −0 src/packages/Castle.Windsor.2.5.3/lib/NET35/Castle.Windsor.xml
  38. BIN src/packages/Castle.Windsor.2.5.3/lib/NET40-Client/Castle.Windsor.dll
  39. BIN src/packages/Castle.Windsor.2.5.3/lib/NET40-Client/Castle.Windsor.pdb
  40. +7,693 −0 src/packages/Castle.Windsor.2.5.3/lib/NET40-Client/Castle.Windsor.xml
  41. BIN src/packages/Castle.Windsor.2.5.3/lib/NET40/Castle.Windsor.dll
  42. BIN src/packages/Castle.Windsor.2.5.3/lib/NET40/Castle.Windsor.pdb
  43. +7,741 −0 src/packages/Castle.Windsor.2.5.3/lib/NET40/Castle.Windsor.xml
  44. BIN src/packages/Castle.Windsor.2.5.3/lib/SL3/Castle.Windsor.dll
  45. BIN src/packages/Castle.Windsor.2.5.3/lib/SL3/Castle.Windsor.pdb
  46. +7,027 −0 src/packages/Castle.Windsor.2.5.3/lib/SL3/Castle.Windsor.xml
  47. BIN src/packages/Castle.Windsor.2.5.3/lib/SL4/Castle.Windsor.dll
  48. BIN src/packages/Castle.Windsor.2.5.3/lib/SL4/Castle.Windsor.pdb
  49. +7,032 −0 src/packages/Castle.Windsor.2.5.3/lib/SL4/Castle.Windsor.xml
  50. +8 −0 src/packages/Castle.Windsor.2.5.3/lib/releaseNotes.txt
  51. BIN src/packages/FakeItEasy.1.7.4166.27/FakeItEasy.1.7.4166.27.nupkg
  52. BIN src/packages/FakeItEasy.1.7.4166.27/lib/NET40/FakeItEasy.dll
  53. +3,174 −0 src/packages/FakeItEasy.1.7.4166.27/lib/NET40/FakeItEasy.xml
  54. BIN src/packages/FakeItEasy.1.7.4166.27/lib/SL4/FakeItEasy-SL.dll
  55. +5 −0 src/packages/repositories.config
  56. BIN src/packages/xunit.1.8.0.1545/lib/xunit.dll
  57. +2,439 −0 src/packages/xunit.1.8.0.1545/lib/xunit.xml
  58. BIN src/packages/xunit.1.8.0.1545/xunit.1.8.0.1545.nupkg
@@ -0,0 +1,3 @@
+[submodule "dependencies/Nancy"]
+ path = dependencies/Nancy
+ url = https://github.com/NancyFx/Nancy
Submodule Nancy added at 3f8507
@@ -0,0 +1,49 @@
+How to build Nancy
+==================
+
+*NOTE* These instructions are *only* for building with Rake - if you just want to build Nancy manually you can do so just by loading the solution into Visual Studio 2010 and pressing build :-)
+
+Prerequisites
+-------------
+
+1. Download and install Ruby 1.8.7+ from http://www.ruby-lang.org/en/downloads
+2. At the command prompt run the following to update RubyGems to the latest version:
+
+ gem update --system
+
+3. You will need the albacore gem, install this at the command prompt with:
+
+ gem install albacore
+
+If you have already installed albacore, please update to the lastest version (0.2.6+):
+
+ gem update albacore
+
+
+Building Nancy
+--------------
+
+1. At the command prompt, navigate to the Nancy root folder (should contain rakefile.rb)
+2. To run the default build (which will compile, test and package Nancy) type the following command:
+
+ rake
+
+In addition, you can see the full list of all the build tasks by running:
+
+ rake -T
+
+To run a particular task ('test' for example), use the following command:
+
+ rake test
+
+You can run multiple tasks by listing them ('test' then 'nuget' for example):
+
+ rake test nuget_package
+
+After the build has completed, there will be a new folder in the root called "build". It contains the following folders:
+
+* binaries -> All the Nancy assembilies and their dependencies
+* packages -> Zip file containing the binaries (other configurations might be added in the future)
+* nuget -> NuGet packages generated from this build
+* documentation -> Generated documentation (todo)
+* coverage -> Test coverage reports (todo)
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (c) 2010 Andreas Håkansson, Steven Robbins and contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
@@ -0,0 +1,133 @@
+require 'rubygems'
+require 'albacore'
+require 'rake/clean'
+require 'rexml/document'
+
+NANCY_VERSION = "0.7.1"
+OUTPUT = "build"
+CONFIGURATION = 'Release'
+SHARED_ASSEMBLY_INFO = 'dependencies/Nancy/src/SharedAssemblyInfo.cs'
+SOLUTION_FILE = 'src/Nancy.Bootstrappers.Windsor.sln'
+
+Albacore.configure do |config|
+ config.log_level = :verbose
+ config.msbuild.use :net4
+ config.xunit.command = "dependencies/Nancy/tools/xunit/xunit.console.clr4.x86.exe"
+end
+
+desc "Compiles solution and runs unit tests"
+task :default => [:clean, :version, :compile, :xunit, :publish, :package]
+
+#Add the folders that should be cleaned as part of the clean task
+CLEAN.include(OUTPUT)
+CLEAN.include(FileList["src/**/#{CONFIGURATION}"])
+
+desc "Update shared assemblyinfo file for the build"
+assemblyinfo :version => [:clean] do |asm|
+ asm.version = NANCY_VERSION
+ asm.company_name = "Nancy"
+ asm.product_name = "Nancy.Bootstrappers.Windsor"
+ asm.title = "Nancy.Bootstrappers.Windsor"
+ asm.description = "A Windsor Bootstrapper for the Nancy web framework"
+ asm.copyright = "Copyright (C) Andreas Hakansson, Steven Robbins and contributors"
+ asm.output_file = SHARED_ASSEMBLY_INFO
+end
+
+desc "Compile solution file"
+msbuild :compile => [:version] do |msb|
+ msb.properties :configuration => CONFIGURATION
+ msb.targets :Clean, :Build
+ msb.solution = SOLUTION_FILE
+end
+
+desc "Gathers output files and copies them to the output folder"
+task :publish => [:compile] do
+ Dir.mkdir(OUTPUT)
+ Dir.mkdir("#{OUTPUT}/binaries")
+
+ FileUtils.cp_r FileList["src/**/#{CONFIGURATION}/*.dll", "src/**/#{CONFIGURATION}/*.pdb"].exclude(/obj\//).exclude(/.Tests/), "#{OUTPUT}/binaries"
+end
+
+desc "Executes xUnit tests"
+xunit :xunit => [:compile] do |xunit|
+ tests = FileList["src/**/#{CONFIGURATION}/Nancy.Bootstrappers.Windsor.Tests.dll"].exclude(/obj\//)
+ xunit.assemblies = tests
+end
+
+desc "Zips up the built binaries for easy distribution"
+zip :package => [:publish] do |zip|
+ Dir.mkdir("#{OUTPUT}/packages")
+
+ zip.directories_to_zip "#{OUTPUT}/binaries"
+ zip.output_file = "Nancy.Bootstrappers.Windsor-Latest.zip"
+ zip.output_path = "#{OUTPUT}/packages"
+end
+
+desc "Generates NuGet packages for each project that contains a nuspec"
+task :nuget_package => [:publish] do
+ Dir.mkdir("#{OUTPUT}/nuget")
+ nuspecs = FileList["src/nancy.bootstrappers.windsor/*.nuspec"]
+ root = File.dirname(__FILE__)
+
+ # Copy all project *.nuspec to nuget build folder before editing
+ FileUtils.cp_r nuspecs, "#{OUTPUT}/nuget"
+ nuspecs = FileList["#{OUTPUT}/nuget/nancy.bootstrappers.windsor.nuspec"]
+
+ # Update the copied *.nuspec files to correct version numbers and other common values
+ nuspecs.each do |nuspec|
+ update_xml nuspec do |xml|
+ # Override the version number in the nuspec file with the one from this rake file (set above)
+ xml.root.elements["metadata/version"].text = NANCY_VERSION
+
+ # Override the Nancy dependencies to match this version
+ nancy_dependencies = xml.root.elements["metadata/dependencies/dependency[contains(@id,'Nancy')]"]
+ nancy_dependencies.attributes["version"] = "[#{NANCY_VERSION}]" unless nancy_dependencies.nil?
+
+ # Override common values
+ xml.root.elements["metadata/authors"].text = "Andreas Hakansson, Steven Robbins and contributors"
+ xml.root.elements["metadata/summary"].text = "Nancy is a lightweight web framework for the .Net platform, inspired by Sinatra. Nancy aim at delivering a low ceremony approach to building light, fast web applications."
+ xml.root.elements["metadata/licenseUrl"].text = "https://github.com/NancyFx/Nancy.Bootstrappers.Windsor/blob/master/license.txt"
+ xml.root.elements["metadata/projectUrl"].text = "http://nancyfx.org"
+ end
+ end
+
+ # Generate the NuGet packages from the newly edited nuspec fileiles
+ nuspecs.each do |nuspec|
+ nuget = NuGetPack.new
+ nuget.command = "dependencies/Nancy/tools/nuget/nuget.exe"
+ nuget.nuspec = "\"" + root + '/' + nuspec + "\""
+ nuget.output = "#{OUTPUT}/nuget"
+ nuget.parameters = "-Symbols", "-BasePath \"#{root}\"" #using base_folder throws as there are two options that begin with b in nuget 1.4
+ nuget.execute
+ end
+end
+
+desc "Pushes the nuget packages in the nuget folder up to the nuget gallary and symbolsource.org. Also publishes the packages into the feeds."
+task :nuget_publish do
+ nupkgs = FileList["#{OUTPUT}/nuget/*#{NANCY_VERSION}.nupkg"]
+ nupkgs.each do |nupkg|
+ puts "Pushing #{nupkg}"
+ nuget_push = NuGetPush.new
+ nuget_push.command = "dependencies/Nancy/tools/nuget/nuget.exe"
+ nuget_push.package = "\"" + nupkg + "\""
+ nuget_push.create_only = false
+ nuget_push.execute
+ end
+end
+
+def update_xml(xml_path)
+ #Open up the xml file
+ xml_file = File.new(xml_path)
+ xml = REXML::Document.new xml_file
+
+ #Allow caller to make the changes
+ yield xml
+
+ xml_file.close
+
+ #Save the changes
+ xml_file = File.open(xml_path, "w")
+ formatter = REXML::Formatters::Default.new(5)
+ formatter.write(xml, xml_file)
+ xml_file.close
+end
@@ -0,0 +1,13 @@
+## Contributors
+
+* [Andreas Håkansson](http://github.com/thecodejunkie)
+* [Chris Nicola](http://github.com/lucisferre)
+* [Steven Robbins](http://github.com/grumpydev)
+
+## Copyright
+
+Copyright © 2010 Andreas Håkansson, Steven Robbins and contributors
+
+## License
+
+Nancy.Bootstrappers.Windsor is licensed under [MIT](http://www.opensource.org/licenses/mit-license.php "Read more about the MIT license form"). Refer to license.txt for more information.
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{C490CBDA-78BA-42BF-98F4-CCA06D09532D}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Nancy.BootStrappers.Windsor.Tests</RootNamespace>
+ <AssemblyName>Nancy.BootStrappers.Windsor.Tests</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Castle.Core">
+ <HintPath>..\packages\Castle.Core.2.5.2\lib\NET35\Castle.Core.dll</HintPath>
+ </Reference>
+ <Reference Include="Castle.Windsor">
+ <HintPath>..\packages\Castle.Windsor.2.5.3\lib\NET40\Castle.Windsor.dll</HintPath>
+ </Reference>
+ <Reference Include="FakeItEasy">
+ <HintPath>..\packages\FakeItEasy.1.7.4166.27\lib\NET40\FakeItEasy.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Web" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ <Reference Include="xunit">
+ <HintPath>..\packages\xunit.1.8.0.1545\lib\xunit.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="..\..\dependencies\Nancy\src\Nancy.Tests\Fakes\FakeNancyModuleWithBasePath.cs">
+ <Link>Fakes\FakeNancyModuleWithBasePath.cs</Link>
+ </Compile>
+ <Compile Include="..\..\dependencies\Nancy\src\Nancy.Tests\Fakes\FakeNancyModuleWithDependency.cs">
+ <Link>Fakes\FakeNancyModuleWithDependency.cs</Link>
+ </Compile>
+ <Compile Include="..\..\dependencies\Nancy\src\Nancy.Tests\ShouldExtensions.cs">
+ <Link>ShouldExtensions.cs</Link>
+ </Compile>
+ <Compile Include="WindsorNancyBootStrapperFixture.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Nancy.BootStrappers.Windsor\Nancy.Bootstrappers.Windsor.csproj">
+ <Project>{F4F084BE-E3B3-4BC3-925A-5EB4FC7FA46B}</Project>
+ <Name>Nancy.Bootstrappers.Windsor</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\dependencies\Nancy\src\Nancy\Nancy.csproj">
+ <Project>{34576216-0DCA-4B0F-A0DC-9075E75A676F}</Project>
+ <Name>Nancy</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="Properties\" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
Oops, something went wrong.

0 comments on commit 3cfcbbf

Please sign in to comment.