Thursday, January 21, 2010

Visual representation of Ant target dependencies using tool Grand

Is your ant build file is more than 500 lines? Is your ant build file contains hundred's of targets? Then there is no doubt that you will definitely get lost in the process of understanding it. Fortunately there are tools which graphically represents Ant target dependencies. One such tool I recently used is Grand.

You can download Grand from http://www.ggtools.net/grand/. For windows, download grand-ui.zip file and extract it.
Then double click on grand-ui.bat, which opens up an editor. From the editor, open your ANT build file through File menu (File -> Quick open). Then it generates graph of all the target dependencies. It also identifies default target in different color (yellow). If a target (represented in oval )is clicked, it displays the code for that target in bottom frame.
Another good thing is that it also traverse targets present in the build files which are imported by parent build file.

This tool emphatically helps to understand complex Ant build files

Wednesday, January 20, 2010

fatal error C1902: Program database manager mismatch; please check your installation

Scenario: Ssh from Linux machine ( ex: build account) to Windows machine ( Ex: Adminisrator account) with the help of cygwin and compile some c/c++ code using Microsoft Visual studio 2005. It ends with the error
fatal error C1902: Program database manager mismatch; please check your installation

This seems to be bug in VS 2005 or may be security enhancement feature. But this problem never use to occur in older VC6 (VS98).

Solution: Since we are using "build" account in Linux machine and connecting with Administrator account to Windows, which resulting in this error. The solution is to use the same account as in Linux machine on Windows too.

Create "build" account on Windows machine and add it to administrator group. Install cygwin with build account itself, run ssh-host-config file, start sshd service (net start sshd).

Make sure "Cygwin sshd" service is started with build account. You can verify it by Right click on "My computer" -> Manage -> Services and Applications -> Services -> Cygwin sshd.
If it is not running with build account (it may be running with "Local SYSTEM" instead), then you need to follow the instructions given in below link to make it run under "build" account.
http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r1/index.jsp?topic=/com.ibm.websphere.ops.doc/info/odoe_task/tcimgr_sshwin.html


It resolved this problem for us.

You can also find the detailed explanation from my buddy's blog http://vijayk.blogspot.com/2010/01/fatal-error-c1902-program-database.html