in DevOps by
Q:
Explain Using Ant And Give An Small Example?

1 Answer

0 votes
by
Before start using ANT, we should be clear about the project name and the .java files and most importantly, the path where the .class files are to be placed.

For example, we want the application HelloWorld to be used with ant. The Java source files are in a subdirectory called Dirhelloworld, and the .class files are to put into a sub directory called Helloworldclassfiles.

1. The build file by name build.xml is to be written. The script is as follows

<project name=”HelloWorld” default=”compiler” basedir=”.”>

<target name=”compiler”>

<mkdir dir = “Helloworldclassfiles”>

<javac srcdir=”Dirhelloworld” destdir=”Helloworldclassfiles”>

</target>

</project>

2. Now run the ant script to perform the compilation:

C :\> ant

Buildfile: build.xml

and see the results in the extra files and directory created:

c:\>dir Dirhelloworld

c:\>dir Helloworldclassfiles

All the .java files are in Dirhelloworld directory and all the corresponding .class are in Helloworldclassfiles directory.
Click here to read more about DevOps
Click here to read more about Insurance

Related questions

0 votes
asked Jan 2 in Python by SakshiSharma
0 votes
asked Jun 15, 2020 in C Plus Plus by Robindeniel
0 votes
asked Dec 28, 2019 in TOGAF by sharadyadav1986
0 votes
asked Oct 17, 2019 in Design Patterns by Robin
+1 vote
asked May 9, 2020 in DevOps by Robindeniel
...