Newsletter

Crawler-Lib Build Tools

Build tools are a agile PowerShell based toolbox for automating the software build, test and integration process. It can be customized and extended in several ways. The commands can be executed from the PowerShell console, the NuGet console in Visual Studio and from any continuous integration server with PowerShell installed.
Free

The Crawler-Lib Build Tools are a build automation, tesing and integration toolbox made with PowerShell. It works with any PowerShell host, even the NuGet package manager console in Visual Studio and on nearly every continious integration server under Windows. 

Agile Build Tools

Crawler-Lib provides several projects with very different needs in the build process which aren’t satisfied that good by the existing tools. The powershell based build tools are made to become more flexible and agile in the build process and are used in all of our projects.   

Build Automation

The Build Tools are designed to work in conjunction with the typical build automation software on the .NET platform like MSBuild, NAnt and PSake. By executing a buld sequence the external build tools can be triggered, the build can be validated and tested with the typical unit test frameworks and can be packaged. In conjunction with the PowerShell ISE (which is in fact installed on every Windows machine) the build sequence can be debugged step by step. 

Continious Integration

A Build Tools build sequence can perform the complete integration on the desktop machine of the developer. So the design developement and test of the integration process can be made on a standard configured developer machine. This is a triggered or one-shot integration process. To make the integration continious, the build sequence can be simply triggered on any kind of continious integration server that is able to execute PowerShell.

Private Build

Every developer machine becomes a build machine. So it is possible to pre-test the changes before a commit or a sync is performed. A gated commit can also be implemented with ease, using different branches on the VCS. Special support from the CI server is not needed. This reduces significantly the chance that trivial changes break the build.  

Agile Software Developement

The developement of the integration (building, testing, packaging, deploying, …) is not a question of tools and processes, it is about people knowing the product best. Everyone can forge the code and extend the build sequences because the build process is decentralized. Developers can interact and discuss different aspects of the integration process.

Due to the mix of easy to read XML build configurations and inline PowerShell code the integration process needs nearly no documentation. It is self explanatory. Collaboration with the customer is easier because the integration process can be discussed and extended on normal developer machines. No build server is needed to test new steps. It is easy to respond to changes, because the integration can be altered on the developer machine and simply be distributed to the build server by merging the codebase in the baseline. By taking the credentials out of the build process, developers can work against a sandboxed test and deployment environment.      

Download and Installation

Prerequisites

Before the Build-Tools can be installed, The execution of scripts on the local machine must bne activated:

Set-ExecutionPolicy RemoteSigned 

The PowerShell Build-Tools need the following prerequisites installed:

  • Powershell Community Extensions (PSCX)
    https://pscx.codeplex.com/ 
  • Powershell-Zip Commandlet
    http://powershellzip.codeplex.com/
  • Versioning Controlled Build
    http://www.codeproject.com/Articles/5851/Versioning-Controlled-Build
  • NuGet Command Line (Bootstrapper)
    https://nuget.codeplex.com/releases/view/58939

 

Installation

The newest Build tools release can be found at Build Tools Downloads.

After downloading the build tools, execute Install.cmd with Administrator rights. This will install the Build tools in 32 Bit and 64 Bit Powershell if available.

Configuration  

To enable IntelliSense in Visual Studio go to Tools > Options > Text Editor > XML > Miscellaneous and enable Network > Automatically download DTDs and schemas to allow the XML schema download.  After that store the XML below under BuildConfig.xml in your new project:  

<?xml version="1.0" encoding="utf-8"?>
<!-- Build Configuration for -->
<BuildConfig xmlns="http://www.crawler-lib.net/build-tools"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.crawler-lib.net/build-tools http://download.crawler-lib.net/BuildTools/BuildConfig.xsd?action=view">
  <!-- Specify the artifacts and current build XML file location and name-->
  <CurrentBuild/>
  <!-- Specify the label generation mechanism for new builds -->
  <Label>
    <BuildRevisionTimestamp/>
  </Label>
  <!-- Specify credentials (passwords, keys, URLs, ...) to use in the build steps with $($context.Creadentails.KeyName) -->
  <Credentials>
  </Credentials>
  <Solutions>
    <!-- Solution to build -->
    <Solution Name="">
      <!-- Specify the version generation mechanism for new builds -->
      <Version>
        <!-- AppendLabel appends the build label to create the version. The build label must be in the format Build.Revision -->
        <AppendLabel>1.0</AppendLabel>
      </Version>
      <!-- Build Sequences are lists of build steps that can be executed. It is a good practice to implement the sequences New-Build, Test-Build, Complete-Build and Publish-Build -->
      <BuildSequences>
        <!-- Specify the build steps to perform a new build -->
        <BuildSequence Name="New-Build">
        </BuildSequence>
        <!-- Specify the build steps to test the current build -->
        <BuildSequence Name="Test-Build" NewBuild="false" Depends="New-Build">
        </BuildSequence>
        <!-- Specify the build steps to complete the current build -->
        <BuildSequence Name="Complete-Build" NewBuild="false" Depends="Test-Build">
        </BuildSequence>
        <!-- Specify the build steps to publish the current build -->
        <BuildSequence Name="Publish-Build" NewBuild="false" Depends="Complete-Build">
        </BuildSequence>
      </BuildSequences>
    </Solution>
  </Solutions>
</BuildConfig>

 IntellSense should become available.

You may also look at Build Tools Configuration and Samples 

 

Product tags