[Ant]How to build a property file (Build.property)

How to name the property file:
   It is easy and simple to setup a property file for Ant build. Normally, the name of property file is build.properties, but it could be named as build.properties.dev or build.properties.test based on the same deployment environments to be run in different settings. The benefits of using suffix as .xxx are:
  1. The build file can be reused for different execution environment with different property setting, such as developing, testing or release.
  2. Only the name of property file needs to be changed in the build.xml file while the target or source changed. It could reduce the typing error and time cost.


How to setup the properties:
    Each property is illustrated by a name and a value connected by a equals sign (=) in a line.

    For example:

  src=c:\source file
  target.dir=d:\testing

    In this case, dot symbol (.) could be a part of the name. It could be used to classify the properties into a group.

How to comment in the property file:
    Hash character (#) is used as the symbol to make a line as a comment.

    For example:

  ######################
  # This is Header
  #####################

  #Set soruce folder
  src.dir=c:\source file

  #Set destination folder
  target.dir=d:\testing

[Reference]
  1. Ant - Property Files
  2. How do I use a build.properties file

No comments:

Post a Comment

Build docker image from multiple build contexts

Build docker image from multiple build contexts ...