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.
-
- policyChecks.step
- versionBuilder.step NOTE: If you include build.custom/versionBuilder.replace.step, the items below will not run.
- svn.step, tfs.step, or git.step (the custom tasks for these need to go in build.custom/versioners)
- generateBuildInfo.step
- compile.step
- environmentBuilder.step
- analyze.step NOTE: If you include build.custom/analyze.replace.step, the items below will not run.
- 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)
- ncover.step (the custom tasks for this need to go in build.custom/analyzers)
- ndepend.step (the custom tasks for this need to go in build.custom/analyzers)
- moma.step (the custom tasks for this need to go in build.custom/analyzers)
- package.step NOTE: If you include build.custom/package.replace.step, the items below will not run.
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
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.
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.