Print out help message : Message « Ant « Java

Print out help message

<?xml version="1.0"?>

<!-- You can document the buildfile using XML comments -->
<project name="My Big Project" default="help" basedir=".">
  <description>Shows how to provide help in an Ant buildfile.</description>

  <property name="dir.src" value="src"/>

  <target name="help">
    <echo message="This buildfile shows how to get help."/>
    <echo>(Type 'ant -projecthelp' for more info)</echo>
       Here is a block of text
       that you want to format
       in a very specific way!</echo>

  <!-- Here is an example of a subtarget -->
  <target name="prepare">
    <mkdir dir="${}"/>
    <mkdir dir="${dir.dist}"/>

  <!-- Here is an example of a main target -->
  <target name="clean"
          description="Remove all generated files.">
    <delete dir="${}"/>
    <delete dir="${dir.dist}"/>

  <target name="compile" depends="prepare"
          description="Compile all source code.">
    <javac srcdir="${dir.src}" destdir="${}"/>



Related examples in the same category

1.Echo message out