View source | Discuss this page | Page history | Printable version   

DRBP Ant

Contents

Ant tasks

Most common ant tasks

ant update.database

As you should know, the information included in the application dictionary (Windows, tabs, fields, Tables, references, preferences, etc.) is stored in XML files (DB XML Model) which are used to generate the DB. The aim of update.database task is to write into the database the information stored in the XML files.

When update.database is executed, it will check if the information stored in the XML files match with the information of the DB. If differences are found the action will not be done.

DRBP ANT UpdateDatabase.png

Bulbgraph.png   Note: Force argument skips the check to find differences between local files and database. It will just overwrite the database with the information provided by XML files. This argument shouldn't be used without being completely sure about what are you doing.

ant export.database

This task works like update.database but in the other direction, exporting the information of the modules which are marked as InDevelopment. Based on the information stored in the database, DB XML Model is updated. By default they are only exported in case there are modifications in the database. In addition performs database validations for the modules which are exported.

After execute this command you can check which stuff has changed in your environment (using Mercurial's hg diff command).

DRBP ANT ExportDatabase.png

ant smartbuild

This task makes an incremental build of the application, it means, all the modified classes are compiled and deployed to tomcat.

A very common task is to perform an update.database and then build the application (smartbuild). To do it in just one step ant smartbuild -Dlocal=no can be executed.

If you want to be faster ant smartbuild -Dtr=no can be executed. This argument skip the translation process.

Other tasks

ant compile.complete

This task first removes all the generated files and then:

ant generate.entities

Reading the application dictionary (AD_TABLE & AD_COLUMN), this task generates the mapping between entities and DB tables. Then Java classes for each entity are generated in src-gen directory and compiled. These entities are used by DAL to access to the database information.

ant setup

This task is just required to create development environments or to create new instances. This task will download an executable file called setup-properties-[OS_NAME].[EXT] in config subdirectory. It should be executed to configure the instance.

Some Real Situations During Development Cycle Tasks

I've changed a PL in the database. what should I do?

  1. Mark your module as "In Development"
  2. Export your changes from database executing ant export.database
  3. Check that your changes are there using mercurial hg st ||| hg diff
  4. Make sure that you are committing just the changes that you want.
  5. Do Commit indicating the purpose of that in the message (hg ci -m "Fixed problem in PL XYZ because a wrong select")
  6. Check that ant smartbuild works fine
  7. Push (hg push)

I've changed a java file what should I do?

  1. Check that your changes are there using mercurial hg st ||| hg diff
  2. Make sure that you are committing just the changes that you want.
  3. Do Commit indicating the purpose of that in the message (hg ci -m "your message")
  4. Make sure that there are not errors in java (check it in eclipse or performing ant smartbuild)
  5. Push (hg push)

I'm going to start a new development and I need to update my local environment

  1. update your local repository (hg pull)
  2. update your local files (hg up)[hg pull -u will do this task and previous one]
  3. perform ant update.database in order to update your database with the last changes of the repository.
  4. rebuild the application executing ant smartbuild [ant smartbuild -Dlocal=no will do both tasks]

If you are completely sure that database changes can be removed

ant smartbuild -Dlocal=no -Dforce=yes

Retrieved from "http://wiki.openbravo.com/wiki/DRBP_Ant"

This page has been accessed 6,063 times. This page was last modified on 29 April 2014, at 12:21. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.