New Account Helpful Tips
  Common Project - BDA
  BDA Template Scripts - build.xml
Added by Steven Saksa, last edited by Paul Duvall on Nov 21, 2008  (view change)

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.

BDA Template Scripts - build.xml

Ant Target Flow

Target Names in bold are targets users may call. Targets name not in bold are generally supporting targets and users will probably never call them
If a target has no documentation then it was probably documented on some line above your current line.

build.xml

Build Targets

The build targets wrap the sub-project build scripts, calling them to produce their artifacts. The remainder of the build uses those artifacts to install the application

  • build:all
    • clean - cleans up working/artifact directories
    • init - creates working/artifact directories
    • ivy:clean - cleans project level, bda and sub-project ivy caches.
    • build:generic-webapp - calls sub-project web-app build
      • build:generic-api - calls sub-project api build (dependent of web-app, since its artifacts are used by webapp)

Distribution Targets (dist)

The distribution targets package up the files as needed for distribution. The deploy:local targets use the directory that is packaged up to do the install from. The deploy:remote targets generate a zip file, copy to the remote system, extract it and install it. The 'dist' target produces a zip to be used at a cancer center or customer site.

  • dist - builds all distribution types
    • build:all
    • dist:installer
    • dist:upgrader
    • dist:src
  • dist:installer - creates installer dist zip
    • dist:installer:prep - prepares installer area (can be built directly from as in deploy:local:*). Two things to not about this target, it copies install.xml to the target area and renames it to build.xml. Also it edits the install.xml changing the project's default build target to install and changes the properties.file property to install.properties.
      • dist:tools:retrieve - retrieve binaries and such from urls
        • init
        • dist:tools:retrieve:tomcat - retrieves tomcat based on props in project.properties
        • dist:tools:retrieve:jboss - retrieves jboss based on props in project.properties
  • dist:upgrader - creates upgrader dist zip
    • dist:upgrader:prep - prepares upgrader area (can be built directly from as in deploy:local:*) (will have to customize to package your resource files). Two things to not about this target, it copies install.xml to the target area and renames it to build.xml. Also it edits the install.xml changing the project's default build target to upgrade and changes the properties.file property to upgrade.properties.
      • dist:tools:retrieve - retrieve binaries and such from urls
        • init
        • dist:tools:retrieve:tomcat - retrieves tomcat based on props in project.properties
        • dist:tools:retrieve:jboss - retrieves jboss based on props in project.properties

Deploy Targets

The deploy targets handle installing/upgrading locally/remotely.

  • deploy:local:install - prepares local distribution area, exec's ant build with required command line options (assumes build:all has been completed)
    • dist:installer:prep
  • deploy:local:upgrade - prepares local distribution area, exec's ant build with required command line options (assumes build:all has been completed)
    • dist:upgrader:prep
  • deploy:remote:install - compiles code, builds distribution, copies distribution to remote servers, extracts distributions and then exec's ant build with required command line options
    • build:all
    • dist:installer
  • deploy:remote:upgrade - compiles code, builds distribution, copies distribution to remote servers, extracts distributions and then exec's ant build file with required command line options
    • build:all
    • dist:upgrader

Static analysis targets

Since all project should already have static-analysis targets in their scripts and since static-analysis is generally focused on sub-projects we decided to not include testing targets in the master-project build templates. Instead we just call the sub-project static-analysis targets. If static-analysis needs to be added to the project root-level build script they can be.

  • static-analysis:all - calls testing targets for all sub-projects
    • static-analysis:generic-api
    • static-analysis:generic-webapp

Testing Targets

Since all project should already have testing targets in their scripts and since tests are generally focused on sub-projects we decided to not include testing targets in the master project build templates. Instead we just call the sub-project test targets. If testing needs to be added to the project root-level build script they can be.

  • test:all - calls testing targets for all sub-projects
    • test:generic-api
    • test:generic-webapp

Utility Targets

  • svn:co - svn checkout target that can be used by new target that would then build checked out code
  • report:grand - Runs grand report and stores in projectroot/software/common/grand (must be customized to include grand calls for each build file)
  • ivy:module:add2repo - Adds a module to ivy.

Macros

For any action that requires being called multiple times a macro has been written to eliminate code duplication and ease maintenance of build script.

  • deploy-files - In anticipation of the deploy process requiring sending the distribution file to multiple servers and running different container installs on different machines, we decided to turn the copy and extraction piece of the install into a macro. The deploy:local:install:* (jboss, tomcat, ect??)can then call this to transfer and extract the files and then execute the ssh command to do the install.

Selenium

  • test:selenium - Downloads selenium libraries from ivy, runs selenium tasks, stops selenium-server
    • ivy-test-selenium - Downloads ivy selenium module from the ivy repository, into its own directory to avoid conflicts with other static-analysis tools
      • init:ivy - sets ivy settings and ivy module definition file
    • test:selenium:init - creates directories
    • test:selenium:run - runs selenium tests
    • test:seleniumrc:stop - stop selenium-sever

Database Targets

  • database:prep - Prepares environment for other database targets
  • database:gencl - Generates a liquibase change log from an existing database.
  • database:diff - Generates a text based and changelog based diff of two databases.
  • database:doc - Generates java doc like documentation of a database.


CONTACT US PRIVACY NOTICE DISCLAIMER ACCESSIBILITY APPLICATION SUPPORT
National Cancer Institute Department of Health and Human Services National Institutes of Health USA.gov