<target name="compile" description="Compile the File">
<echo>Compile the File </echo>
<mkdir dir="${compilation-dir}" />
<javac srcdir="." classpath="another2" destdir="${compilation-dir}" />
</target>
I want to echo the description of the target. Is there a better way of doing this other than duplicating it?
Echoes a message to the current loggers and listeners which means System. out unless overridden. A level can be specified, which controls at what logging level the message is filtered at.
An Ant target is a sequence of tasks to be executed to perform a part (or whole) of the build process. Ant targets are defined by the user of Ant. Thus, what tasks an Ant target contains depends on what the user of Ant is trying to do in the build script.
To run the ant build file, open up command prompt and navigate to the folder, where the build. xml resides, and then type ant info. You could also type ant instead. Both will work,because info is the default target in the build file.
the default target to use when no target is supplied. No; however, since Ant 1.6. 0, every project includes an implicit target that contains any and all top-level tasks and/or types. This target will always be executed as part of the project's initialization, even when Ant is run with the -projecthelp option.
I guess this is not a perfect solution, but at least you avoid duplicate descriptions.
<property name="testing.desc" value="this is the desc" />
<target name="testing" description="${testing.desc}">
<echo message="${testing.desc}" />
</target>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With