• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!



Page history last edited by ferventcoder 14 years, 3 months ago

How To Use Extension Points To Set Up Custom Tasks


UppercuT is designed so you never need to edit the files in the build folder. At a few points during the build operation, uppercut will call out to custom extension points (also known as hooks).


To add custom extensions, all you need to do is create them in a folder next to build called build.custom.


The Build Pipeline

Understand the BuildPipeline



Customizing the Build

Extensions are stored in a different folder than the build. It is meant to sit next to the build folder. The default name is build.custom. The items are called in this order: pre, replace, and post. NOTE: If you replace a step that has steps under it, those steps will not run unless you call them from your custom replacement step.


  • pre - the step runs these steps before it runs it's normal tasks. An example file would be build.custom/compile.pre.step
  • replace - the step runs these steps INSTEAD of it's normal tasks. An example would be build.custom/test.replace.step
  • post - the step runs these steps after it's normal tasks. An example would be build.custom/package.post.step



This is the order of where each pre, post, and replace extension point is called:


  • The start point is default.build. It calls build.custom/default.pre.build if it exists, then it runs build/default.build (normal tasks) OR build.custom/default.replace.build if it exists, and finally build.custom/default.post.build if it exists. Every step below runs with the same extension points but changes on the file name it is looking for. NOTE: If you include default.replace.build, nothing else will run because everything is called from default.build.
    1. policyChecks.step
    2. versionBuilder.step NOTE: If you include build.custom/versionBuilder.replace.step, the items below will not run.
      • svn.step, tfs.step, git.step, or hg.step (the custom tasks for these need to go in build.custom/versioners)
    3. generateBuildInfo.step
    4. compile.step
    5. environmentBuilder.step
    6. analyze.step NOTE: If you include build.custom/analyze.replace.step, the items below will not run.
      1. test.step (the custom tasks for this need to go in build.custom/analyzers) NOTE: If you include build.custom/analyzers/test.replace.step, the items below will not run.
        • mbunit2.step, gallio.step, or nunit.step (the custom tasks for these need to go in build.custom/analyzers)
      2. ncover.step (the custom tasks for this need to go in build.custom/analyzers)
      3. ndepend.step (the custom tasks for this need to go in build.custom/analyzers)
      4. moma.step (the custom tasks for this need to go in build.custom/analyzers)
    7. package.step NOTE: If you include build.custom/package.replace.step, the items below will not run.
      • deploymentBuilder.step



Keep in mind that your custom tasks can do just about anything, including calling off to other tasks or files that you want. 


Customize with NAnt


You can go into the build folder and open a command window and type customize.bat step type where step is the name of the step you want to customize and type is pre, post, or replace. This will create a file in the build.custom folder for you that has many of the properties already available so you can just start writing your tasks. The files are named as shown above.


Customize with PowerShell or Ruby

Now you don't have to use NAnt at all if you do not want to.



Image attribution to UppercuT logo, Microsoft, and Ruby Association.


Customize with PowerShell

If you want to customize any extension point with PowerShell, just add .ps1 to the end of any point shown above and write your custom tasks in PowerShell. For example, build.custom/compile.post.step.ps1.


In the settings/uppercut.config there is a setting   <property name="allow.powershell.unrestricted" value="false" overwrite="false" /> where the value must be set to true unless you are going to sign your scripts. This is a security risk, so understand you are making a change for the user that runs the build on any system that runs the build. The change will be permanent until it is changed by the user.



Customize with Ruby

If you want to customize any extension point with Ruby, just add .rb to the end of any point shown above and write your custom tasks in Ruby. For example, build.custom/compile.post.step.rb.


Comments (0)

You don't have permission to comment on this page.