Skip to main content

Analysis and Generation of Ant Build File

A tool that helps analyze and generate a testable Ant build file for J2EE and SCA projects developed using Eclipse, Rational, or WebSphere IDEs.

Date Posted: August 7, 2008

alphaworks tab navigation

 

What is Analysis and Generation of Ant Build File?

Development teams building applications using J2EE™ or Service Component Architecture (SCA) generally use an Integrated Development Environment (IDE) to help manage the build. However, some parts necessarily must be built and tested outside the IDE; this is often a time-consuming process. One of the identifiable parts built outside the IDE is the Ant build file, which is written in XML format.

This tool, Analysis and Generation of Ant Build File, helps developers to easily create Apache Ant or WebSphere® Ant build files that can quickly compile and package sources that lie outside of the IDE, such as those needed when using

Using the tool, one is able to automatically analyze the project structure, report any errors, and create the Ant build file in XML format in mere seconds. The generated build file can then be further customized as needed to accommodate any special requirements; this feature saves time in a task that is often error-prone and tedious.

The package includes the tool and documentation, which includes screenshots showing an example of J2EE and SCA project structure.

How does it work?

Analysis and Generation of Ant Build File works in the following stages:

  1. Document open stage: The user opens the tool in Microsoft® Word with the Enable Macros button selected. The "Document Open" event is fired up and will fill the dropdown list with the project module short names.
  2. User input stage: The user puts the base path of the J2EE or SCA Windows® folder into the tool (opened in Word) and clicks on the appropriate button below the input box. Upon clicking of the J2EE button, the buildJ2EEgen procedure will be called. Upon clicking of the SCA button, the buildSCAgen procedure will be called.
  3. Analysis stage: The system checks to see whether the base path entered by user is a valid path. For a J2EE module, the system also checks for existence of a .project file in the base path and reads that .project file by picking each sub-project names from that file. The system goes to the sub-project folder and picks the .classpath file for further analysis. After analyzing the .classpath file, the system reports any errors. For SCA modules, the system similarly checks for existence of the sca.module file in the base path.
  4. Build file generation stage: In case of no errors reported during the analysis stage, the system starts creating an XML document with neat formatting.

Microsoft Word is required in order to use this technology. Code is written using the Microsoft Visual Basic Editor, which comes with Word. To open the Visual Basic Editor, press Alt + F11 or, from the menu, select Tools > Macro > Visual Basic Editor. The Microsoft XML tool that comes with the Windows operating system is used to generate the XML file. To check the XML tool that is being used in the tool, choose Tools > References from the menu in the Visual Basic Editor.

A mini-guide provides set-up and usage information: Analyse_and_Generate_Build_File.pdf.

About the technology author(s)

Perala R. Chakrapani works as the build manager of the Application Development Unit under IBM Global Business Services in Pune, India. He graduated in 1996, earned his masters degree in computer applications in 2001, and joined IBM in 2006 as technical team lead.

Trademarks