Search code examples
eclipsetemplatesantbuild.xml

Difference between private and public targets in ant scripts


I've recently discovered that there are several useful templates (in Eclipse) that can be added to the script. And among them "public target" and "private target". And here the templates:

public target

    <!-- ================================= 
          target: name              
         ================================= -->
    <target name="name" depends="depends" description="description">

    </target>

private target

    <!-- - - - - - - - - - - - - - - - - - 
          target: name                      
         - - - - - - - - - - - - - - - - - -->
    <target name="name">

    </target>

And i don't get it. What is the main difference? And what does the private target mean? Is it some specific feature in ant scripts or just code beautifying?

Just interesting.


Solution

  • A target which has a description is public because it appears when you execute

    ant -projecthelp
    

    The others are considered private because they don't appear by default.