EGL Development User Group

EGL Development User Group

EGL Development User Group

The EGL Development User Group is dedicated to sharing news, knowledge, and insights regarding the EGL language and Business Developer product. Consisting of IBMers, HCL, and users, this community collaborates to advance the EGL ecosystem.

 View Only

Headless Hint: Build And Generate Project With Ant

By Jiyong Huang posted Wed April 01, 2020 09:19 PM

  
Apache Ant™ is a Java-based build tool that uses XML-based configuration files to describe build tasks.  Rational Business Developer (RBD), is built on the Eclipse platform, which supports running Ant builds from the IDE Run as menus or from a command file.   

Eclipse also supports the ability for plug-ins to contribute IDE build tasks to Ant using extension points.  RBD includes tasks contributed by the Eclipse and Rational Application Developer (RAD) teams that can used to perform a complete Eclipse project build.

Example:  Building and generating an EGL project
This example shows how to run an Ant build file to perform a build of an EGL project from a command file.   The build file will:
  • Compile the EGL source (.egl) files into EGL intermediate representation (.ir) files
  • Generate the files if there is a default build descriptor specified for the associated source file and if the EGL generation preference "Generate after build" is selected for the workspace.
 
To run the example:
1. Download headlessProjectBuildFiles.zip and unzip the following files into a temporary file directory:
  • setRBDEnvironment.cmd - identifies workspace and RDB jar files for running IDE in headless mode
  • runAntInIDE.cmd - launches Eclipse Ant runner in your workspace
  • runProjectBuild.cmd - runs runEclipseProjectBuild.xml Ant file in your workspace
  • RunEclipseProjectBuild.xml - Ant file:  runs Eclipse build on specified project and writes results to the console

2. Edit setRBDEnvironment.cmd and change variable settings as necessary to be correct for you installation of RBD.

3. Set workspace build preference "Build automatically" off so that only the project builds explicitly started by the Ant file will run.
4. Set EGL generation preference "Generate after build" on for each generator you want to run automatically after the .ir files are built for the project.  
5. In a command prompt window, set current location to the directory that contains the command files you unzipped and enter command:
 
runProjectBuild myProjectName
 
Things to think about
1. The current version of RBD will hang if you attempt to generate programs from more than one project.  Avoid this problem by:
  • Ensuring workspace build preference "Build automatically" is off so that no extra project builds get triggered in the workspace.
  • Building only one EGL source project in each invocation of Ant
2.  If you are generating Java files, you will want to run the Java builder to compile the generated Java files. A best practice for command file builds is to use the genProject build option to generate the Java files into a Java project that is different than the EGL source project.   You could add a step to the Ant file to build the Java project after building the EGL source project.
 
More information on Ant and Ant in Eclipse

Paul

0 comments
29 views

Permalink