New FinalBuilder Custom Action: Check Required Variables

I’ve been using FinalBuilder for a while now. It’s icon based scripting language for creating build scripts. It reminds me me of a multimedia language I used a long time ago called IconAuthor. Initially I had resisted the tool because I thought it might be too easy. But really when you think about creating build scripts, a good portion of it is creating thin wrappers around existing utilities. FinalBuilder does a good job of this and is flexible enough to create build script engines that have their own configuration and work with whatever process you come up with.

To create a ‘subroutine’ or function in FinalBuilder, you have a few options. I like creating new stand alone FinalBuilder project files that are included by my main project. For instance, I’ve created a project that figures out if there have been any changes in the source control since the last build and creates a changelog. This is functionality I can use in any build script. Rather than cutting and pasting it in, I can just reference the project ‘subroutine’ I created for it.

One limitation to this method is there is no such thing as function signature. If your subroutine project requires the parent project to define some variables, you need to add your own logic if you want to make sure some variable has been defined. If you don’t do this, you can get unexpected results and you’ll need to debug what went wrong. “Oh I forgot to define the BuildDirectory variable in my parent script!”

What I decided to do is create some pre-canned functionality to just check to make sure the specified required variables exist and have non-empty value. I actually initially wrote this as a separate FinalBuilder project. I thought about it for a while and decided this might be better as it’s own custom action. FinalBuilder supports developer created actions and even provides a nice IDE to help author them. You have the option of using VBScript, JavaScript, Powershell, and .NET. I went with JavaScript since this action didn’t need to be too complicated.

Along with the Custom Action I built a simple example and an attempt at unit testing the action. There is no built in way to do unit testing in FinalBuilder, but I took at a stab at creating a simple structure to support it. I have 8 tests which are included in a single FinalBuilder project file.

I’ve hosted the project and source at https://launchpad.net/wolf-fbcustomactions. The first release can be downloaded from http://www.wolfplusplus.com/projects/WolfFBCustomActions-0.1.7z.

This entry was posted in General. Bookmark the permalink.

One Response to New FinalBuilder Custom Action: Check Required Variables

  1. Brent says:

    “Initially I had resisted the tool because I thought it might be too easy.” haha that gave me a good laugh. ๐Ÿ™‚ I’ve heard of devs who are resisting a visual tool because of fears about extensibility etc. but I’ve never heard of someone resisting because it might make things too easy! haha

    Nice action/project also. I’ll blog about them later to let people know they are available. If you like, you can also upload them to the FinalBuilder Community Downloads section on the website. ๐Ÿ™‚

Leave a Reply

Your email address will not be published. Required fields are marked *