Permalink
Browse files

Inital rake build complete

  • Loading branch information...
1 parent f89f4b1 commit 4c086ea41959d208589b5d79d81efe2eabb00f1d @andypike andypike committed Jan 25, 2011
View
@@ -21,22 +21,22 @@ If you have already installed albacore, please update to the lastest version (0.
Building Nancy
--------------
-1. At the command prompt, navigate to the Nancy root folder
-2. To run the default build, type the following command:
+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 (compile for example), use the following command:
+To run a particular task ('test' for example), use the following command:
- rake compile
+ rake test
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
-* documentation -> Generated documentation
-* coverage -> Test coverage reports
-* package -> Zip file containing the binaries
+* packages -> Zip file containing the binaries (other configurations might be added in the future)
+* documentation -> Generated documentation (todo)
+* coverage -> Test coverage reports (todo)
View
@@ -2,14 +2,19 @@
require 'albacore'
require 'rake/clean'
-NANCY_VERSION = "0.1.2.3"
+NANCY_VERSION = "0.1.0.0"
OUTPUT = "build"
CONFIGURATION = 'Release'
SHARED_ASSEMBLY_INFO = 'src/SharedAssemblyInfo.cs'
SOLUTION_FILE = 'src/Nancy.sln'
+Albacore.configure do |config|
+ config.log_level = :verbose
+ config.msbuild.use :net4
+end
+
desc "Compiles solution and runs unit tests"
-task :default => [:clean, :version, :compile, :publish]
+task :default => [:clean, :version, :compile, :test, :publish, :package]
desc "Executes all MSpec and Xunit tests"
task :test => [:mspec, :xunit]
@@ -19,56 +24,70 @@
CLEAN.include(FileList["src/**/#{CONFIGURATION}"])
desc "Update shared assemblyinfo file for the build"
-assemblyinfo :version do |asm|
+assemblyinfo :version => [:clean] do |asm|
asm.version = NANCY_VERSION
- asm.company_name = "a test company"
- asm.product_name = "a product name goes here"
- asm.title = "my assembly title"
- asm.description = "this is the assembly description"
+ asm.company_name = "NancyFx"
+ asm.product_name = "NancyFx"
+ asm.title = "NancyFx"
+ asm.description = "A Sinatra inspired web framework for the .NET platform"
asm.copyright = "Copyright (C) Andreas Hakansson and contributors"
asm.output_file = SHARED_ASSEMBLY_INFO
end
desc "Compile solution file"
-msbuild :compile do |msb|
+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 do
+task :publish => [:compile] do
Dir.mkdir(OUTPUT)
Dir.mkdir("#{OUTPUT}/binaries")
FileUtils.cp_r FileList["src/**/#{CONFIGURATION}/*.dll"].exclude(/obj\//).exclude(/.Tests/), "#{OUTPUT}/binaries"
end
desc "Executes MSpec tests"
-mspec :mspec do |mspec|
- tests = FileList["src/**/#{CONFIGURATION}/*.Tests.dll"].exclude(/obj\//)
-
+mspec :mspec => [:compile] do |mspec|
+ #This is a bit fragile but this is the only mspec assembly at present.
+ #Fails if passed a FileList of all tests. Need to investigate.
mspec.command = "tools/mspec/mspec.exe"
- mspec.assemblies tests
+ mspec.assemblies "src/Nancy.Tests/bin/Release/Nancy.Tests.dll"
end
-testAssemblies = FileList["src/**/#{CONFIGURATION}/*.Tests.dll"].exclude(/obj\//)
-testAssemblies.each do |testAssembly|
- desc "Executes xUnit tests"
- xunit :xunit do |xunit|
- xunit.command = "tools/xunit/xunit.console.clr4.x86.exe"
- xunit.assembly = testAssembly
- end
+desc "Executes xUnit tests"
+xunit :xunit => [:compile] do |xunit|
+ tests = FileList["src/**/#{CONFIGURATION}/*.Tests.dll"].exclude(/obj\//)
+
+ xunit.command = "tools/xunit/xunit.console.clr4.x86.exe"
+ 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 = "NancyFx-#{NANCY_VERSION}.zip"
+ zip.output_path = "#{OUTPUT}/packages"
end
+
#TODO:
#-----
-# 1. Copy dlls to build folder (not tests or demo files)
-# 2. Fix test tasks
-# 3. TeamCity integration
-# 4. Test coverage report (NCover?)
-# 5. Documemtation (docu?)
-# 5. Zip binaries with docs (named with version number)
-# 6. NuGet task (waiting for albacore pull)
-# 7. Git info into shared assemby info (see fubumvc sample, also psake sample in mefcontrib)
+# 6. TeamCity integration
+# 7. Documentation (docu?) - Started, seems to have trouble with .NET 4 assembilies. Needs investigation.
+# 8. Test coverage report (NCover?)
+# 9. NuGet task (waiting for albacore pull)
+# 10. Git info into shared assemby info (see fubumvc sample, also psake sample in mefcontrib)
+
+#DONE:
+#-----
+# 1. Copy dlls to build folder (not tests or demo files) - DONE
+# 2. Fix test tasks - DONE
+# 3. Set task dependencies - DONE
+# 4. Zip binaries with docs (named with version number) - DONE
+# 5. Create a how to build file - DONE
@@ -34,7 +34,8 @@
<Reference Include="FakeItEasy">
<HintPath>..\..\dependencies\fakeiteasy\FakeItEasy.dll</HintPath>
</Reference>
- <Reference Include="Machine.Specifications">
+ <Reference Include="Machine.Specifications, Version=0.3.0.0, Culture=neutral, PublicKeyToken=5c474de7a495cff1, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dependencies\mspec\Machine.Specifications.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
View
@@ -50,10 +50,6 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nancy.BootStrappers.Windsor.Tests", "Nancy.BootStrappers.Windsor.Tests\Nancy.BootStrappers.Windsor.Tests.csproj", "{C490CBDA-78BA-42BF-98F4-CCA06D09532D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{C83115E9-B3B9-4848-9312-5C298CC1B924}"
- ProjectSection(SolutionItems) = preProject
- How to build.txt = How to build.txt
- rakefile.rb = rakefile.rb
- EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
View
@@ -29,6 +29,8 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
+ <DocumentationFile>
+ </DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
Binary file not shown.
View
@@ -0,0 +1,10 @@
+Copyright (c) 2009, James Gregory
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ * The name of James Gregory may not be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
View
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
@@ -0,0 +1,68 @@
+# Formatter.NamespaceUrlFormat = "../{namespace}.htm";
+# Formatter.TypeUrlFormat = "../{type.namespace}/{type}.htm";
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <title>${h(Type.PrettyName)} - ${WriteProductName(Assemblies[0])} Documentation</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <link type="text/css" rel="stylesheet" href="../main.css" />
+ </head>
+ <body>
+ <namespaces />
+ <types />
+ <div class="header">
+ <p class="class"><strong>Type</strong> ${h(Type.PrettyName)}</p>
+ <p><strong>Namespace</strong> ${Namespace.Name}</p>
+ <p if="Type.ParentType != null && Type.ParentType.PrettyName != 'object'"><strong>Parent</strong> ${WriteReference(Type.ParentType)}</p>
+ <p if="Type.Interfaces.Count > 0"><strong>Interfaces</strong> ${WriteInterfaces(Type.Interfaces)}</p>
+ </div>
+ <div class="sub-header">
+ <if condition="Type.Summary.Count > 0">
+ <div id="summary">
+ ${WriteSummary(Type.Summary)}
+ </div>
+ </if>
+
+ <if condition="Type.Events.Count > 0">
+ <h3 class="section">Events</h3>
+ <ul>
+ <li each="var ev in Type.Events"><a href="#${ev.Name}" class="type">${h(ev.Name)}</a></li>
+ </ul>
+ </if>
+
+ <if condition="Type.Methods.Count > 0">
+ <h3 class="section">Methods</h3>
+ <ul>
+ <li each="var method in Type.Methods"><a href="#${method.Name}" class="type">${h(method.PrettyName)}</a></li>
+ </ul>
+ </if>
+
+ <if condition="Type.Properties.Count > 0">
+ <h3 class="section">Properties</h3>
+ <ul>
+ <li each="var property in Type.Properties"><a href="#${property.Name}" class="type">${h(property.Name)}</a></li>
+ </ul>
+ </if>
+
+ <if condition="Type.Fields.Count > 0">
+ <h3 class="section">Fields</h3>
+ <ul>
+ <li each="var field in Type.Fields"><a href="#${field.Name}" class="type">${h(field.Name)}</a></li>
+ </ul>
+ </if>
+ </div>
+
+ <events events="Type.Events" title="'Events'" />
+
+ <var publicInstanceMethods="Type.Methods.Where(x => x.IsPublic && !x.IsStatic)" />
+ <methods methods="publicInstanceMethods" title="'Public instance methods'" />
+
+ <var publicStaticMethods="Type.Methods.Where(x => x.IsPublic && x.IsStatic)" />
+ <methods methods="publicStaticMethods" title="'Public static methods'" />
+
+ <properties properties="Type.Properties" title="'Public properties'" />
+ <fields fields="Type.Fields" title="'Public fields'" />
+
+ <use file="../_footer" />
+ </body>
+</html>
@@ -0,0 +1,10 @@
+<if condition="events.Count() > 0">
+ <h3 class="section">${title}</h3>
+
+ <div id="${ev.Name}" class="method" each="var ev in events">
+ <h4><strong>${h(ev.Name)}</strong></h4>
+ <div class="content">
+ ${WriteSummary(ev.Summary)}
+ </div>
+ </div>
+</if>
@@ -0,0 +1,17 @@
+<if condition="fields.Count() > 0">
+ <h3 class="section">${title}</h3>
+
+ <div id="${field.Name}" class="method" each="var field in fields">
+ <h4>${h(field.ReturnType.PrettyName)} <strong>${h(field.Name)}</strong></h4>
+ <div class="content">
+ ${WriteSummary(field.Summary)}
+ <table>
+ <tr>
+ <td>
+ <code>return ${WriteReference(field.ReturnType)}</code>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</if>
@@ -0,0 +1,20 @@
+<if condition="methods.Count() > 0">
+ <h3 class="section">${title}</h3>
+
+ <div id="${method.Name}" class="method" each="var method in methods">
+ <h4>${h(method.ReturnType.PrettyName)} <strong>${h(method.PrettyName)}</strong>(${OutputMethodParams(method)})</h4>
+ <div class="content">
+ ${WriteSummary(method.Summary)}
+ <table>
+ <tr if="method.ReturnType.PrettyName != 'void'">
+ <td><code>return ${WriteReference(method.ReturnType)}</code></td>
+ <td></td>
+ </tr>
+ <tr each="var param in method.Parameters">
+ <td><code>${WriteReference(param.Reference)} ${param.Name}</code></td>
+ <td>${WriteSummary(param.Summary)}</td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</if>
@@ -0,0 +1,14 @@
+<div id="namespaces">
+ <h2 class="fixed">Namespaces</h2>
+ <div class="scroll">
+ <ul>
+ <li each="var ns in Namespaces">
+ <if condition="ns == Namespace">
+ <a href="../${ns.Name}/index.htm" class="current">${ns.Name}</a>
+ <else />
+ <a href="../${ns.Name}/index.htm">${ns.Name}</a>
+ </if>
+ </li>
+ </ul>
+ </div>
+</div>
@@ -0,0 +1,17 @@
+<if condition="properties.Count() > 0">
+ <h3 class="section">${title}</h3>
+
+ <div id="${property.Name}" class="method" each="var property in properties">
+ <h4>${h(property.ReturnType.PrettyName)} <strong>${h(property.Name)}</strong> <if condition="property.HasGet">get;</if> <if condition="property.HasSet">set;</if></h4>
+ <div class="content">
+ ${WriteSummary(property.Summary)}
+ <table>
+ <tr>
+ <td>
+ <code>return ${WriteReference(property.ReturnType)}</code>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</if>
@@ -0,0 +1,14 @@
+<div id="types">
+ <h2 class="fixed">Types</h2>
+ <div class="scroll">
+ <ul>
+ <li each="var type in Namespace.Types">
+ <if condition="type == Type">
+ <a href="../${type.Namespace.Name}/${type.Name}.htm" class="current">${h(type.PrettyName)}</a>
+ <else />
+ <a href="../${type.Namespace.Name}/${type.Name}.htm">${h(type.PrettyName)}</a>
+ </if>
+ </li>
+ </ul>
+ </div>
+</div>
@@ -0,0 +1,25 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <title>${Namespace.Name} - ${WriteProductName(Assemblies[0])} Documentation</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <link type="text/css" rel="stylesheet" href="../main.css" />
+ </head>
+ <body>
+ <namespaces />
+ <types />
+ <div class="header">
+ <p class="class"><strong>Namespace</strong> ${Namespace.Name}</p>
+ </div>
+ <div class="sub-header">
+ <h3 class="section">Types</h3>
+ <ul>
+ <for each="var type in Namespace.Types">
+ <li><a href="${type.Name}.htm">${h(type.PrettyName)}</a></li>
+ </for>
+ </ul>
+ </div>
+
+ <use file="../_footer" />
+ </body>
+</html>
Oops, something went wrong.

0 comments on commit 4c086ea

Please sign in to comment.