Solutions    |    Downloads    |    License    |    Documentation    |    Training    |    Support    |    Customers    |    About Us

Building NServiceBus From Source Files

Last Updated: Jan 01, 2013 11:53AM IST

If you would like to build NServiceBus from its sources files, you can do it after downloading the source files from github , getting the latest unstable build, or you can have the latest stable build source code from the downloads page.

Building NServiceBus

You can build NServiceBus by either typing .\build.ps1 in a powershell command line or by executing the build.bat from the command line.
Both files will execute the default.ps1 which is a powershell script file that builds NServiceBus.

Default.ps1 is based on psake build automation tool, you can read about psake, here.

Default.ps1 Has 5 Major Logical Entry Points or Main Tasks:

  1. Default No need to call explicitly it calls ReleaseNServiceBus task

  2. ReleaseNServiceBus

    1. Compiles all the source code in order

    2. Runs the unit tests

    3. Prepares the binaries and Core-only binaries

    4. Creates and publishes the packages to Nuget gallery  (access key required)

    5. Archives release artifacts in zip

  3. JustPrepareBinaries was created to shorten build time.

    1. Compiles all the source code

    2. Prepares the binaries

  4. PrepareBinaries

    1. Compiles all the source code in order

    2. Runs the unit tests

    3. Prepares the binaries and Core-only binaries

  5. PrepareReleaseWithoutSamples

    1. Compiles all the source code except samples

    2. Runs the unit tests

    3. Prepares the binaries and Core-only binaries

Some more entry points to ease the build activity for development:

  1. CompileMain - Build NServiceBus.dll and keeps the output in \binaries

  2. TestMain - Build NServiceBus.dll, keeps the output in \binaries

  3. CompileCore - Build NServiceBus.Core.dll and keeps the output in \binaries

  4. TestCore - Build NServiceBus.Core.dll and keeps the output in \binaries

  5. CompileContainers - Builds the container dlls for autofac, castle, ninject, spring, structuremap and MS unity and keeps the output in respective folders in binaries\containers

  6. TestContainers - Builds the container dlls for autofac, castle, ninject, spring, structuremap and MS unity and keeps the output in respective folders in binaries\containers and unit tests the same

  7. CompileWebServicesIntegration - Builds NServiceBus.Integration.WebServices.dll and keeps the output in \binaries

  8. CompileNHibernate - Builds NServiceBus.NHibernate.dll and keeps the output in \binaries

  9. TestNHibernate - Builds NServiceBus.NHibernate.dll, keeps the output in \binaries  and unit tests the same

  10. CompileHosts - Builds NServiceBus.Host.exe and keeps the output in \binaries

  11. CompileHosts32 - Builds NServiceBus.Host32.exe and keeps the output in \binaries

  12. CompileAzure - Builds NServiceBus.Azure.dll and keeps the output in \binaries

  13. TestAzure - Builds NServiceBus.Azure.dll, keeps the output in \binaries

  14. CompileAzureHosts - Builds NServiceBus.Hosting.Azure.dll and NServiceBus.Hosting.Azure.HostProcess.exe and keeps the output in \binaries

  15. CompileTools - Builds the tools like XsdGenerator.exe, runner.exe and ReturnToSourceQueue.exe and unit tests the same.

  16. CompileSamples - Compiles all the sample projects

  17. CompileSamplesFull - Compiles all the sample projects after compiling the Source.

Build.ps1

Build.ps1 is a power shell script that is used to execute default.ps1 NServiceBus build script.

The following are examples for executing Build.ps1 script:

  1. Array of strings which takes the names of the tasks to be executed.
    An example of using it can be for a developer working on a sample, making some modifications in one of the NServiceBus main libraries and to see the effect of the change the developer may execute the following:
    NServiceBus> .\build.ps1 @("CompileMain", "CompileSamples")

    or just
    NServiceBus> .\build.ps1 CompileMain
    to build the NServiceBus main libraries

  2. $properties = @{} this will enable to pass the properties value when invoking default.ps1 for example:
    NServiceBus> .\build.ps1 @("InstallDependentPackages","CompileSamples") @{DownloadDependentPackages=$true}

  3. $desc, pass this parameter to see a description of the task, for example:
    NServiceBus> .\build.ps1 -desc

All the examples assumes that user is executing from NServiceBus root folder from Powershell command prompt or Package Manager console of VisualStudio

Build.bat

Build.bat is added to allow users easy way to execute NServiceBus building processes. Usage Examples
> build.bat "@(\"CompileMain\",\"CompileSamples\")"
    > build.bat "@(\"InstallDependentPackages\",\"CompileSamples\") @{DownloadDependentPackages=$true}"

About NServiceBus    |    Contact Us    |    Privacy    |    Follow us on:   
Copyright 2010-2013 NServiceBus. All rights reserved
NSB_Y@yahoo.com
http://assets1.desk.com/r1046ffeaa2233e531563a32d7edef6677d8a78b5/javascripts/
nservicebus
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
true
Invalid characters found
/customer/portal/articles/autocomplete
There was an error contacting Get Satisfaction
View All
0
discussions
replies
Questions
Ideas
Problems
Praise