Define custom property based on existing properties : Properties « Ant « Java






Define custom property based on existing properties

 
<?xml version="1.0"?>

<project name="Apache Ant Properties Project" default="properties.custom" basedir=".">

  <target name="properties.custom">
    <property name="fs" value="${file.separator}"/>
    <property name="ps" value="${path.separator}"/>

    <echo message="File: ${basedir}${fs}build.xml"/>
    <echo message="Path: ${basedir}${fs}build.xml${ps}${basedir}${fs}build.properties"/>
  </target>

</project>

           
         
  








AntBasicTags.zip( 2 k)

Related examples in the same category

1.Value in the properties file overwrite the value in the build.xml
2.Redefine property in the children target
3.Redefine property in the children target 2
4.Load file through URL
5.Referrence property: basedir
6.Custom properties
7.Ant buildin properties
8.Separate two values
9.Reference ant.project.name
10.In init target set the properties
11.Define and reference property