Posts

Showing posts with the label generic ant build code

Creating a project builder - Ant buildfile

Image
Creating a project builder Ant buildfile To see how project builders work, we will create a simple project with a single source file and an Ant buildfile that jars up the single class file. Though this example uses Java, it should be noted that project builders are available for all projects, Java or otherwise. Create a Java project named  HW . Create a Java source file named  HelloWorld  with a main method. Put a single  System.out.println()  statement in the main method, and make it print a greeting of your choice. Save changes. Create a file named  projectBuilder.xml , open the  Ant editor  on it, enter the following content, and save changes. <?xml version="1.0" encoding="UTF-8"?> <project name="HW.makejar" default="makejar" basedir="."> <target name ="makejar" description="Create a jar for the HW project"> <jar jarfile="HelloWorld.jar" includes="*.class"...