Introduction of Apache Ant

Apache Ant is a software tool for automating software build processes. It is similar to Make but is implemented using the Java language, requires the Java platform, and is best suited to building Java projects.

The most immediately noticeable difference between Ant and Make is that Ant uses XML to describe the build process and its dependencies, whereas Make has its Makefile format. By default the XML file is named build.xml.

Ant is an Apache project. It is open source software, and is released under the Apache Software License.

Tagged : / / / / / / / /

Using Ant to build J2EE Applications

Apache Ant (Another Neat Tool) is a build tool, mainly for Java projects. A build tool can be used to automate certain repetitive tasks, e.g. compiling source code, running software tests, creating jar files, javadocs, etc.

A build process typically includes:

  • the compilation of the Java source code into Java bytecode
  • creation of the .jar file for the distribution of the code
  • creation of the Javadoc documentation

Ant uses a xml file for its configuration. This file is usually called “build.xml”. Within this build file you specify the targets for ant. A target is a step which ant will perform. You also can specific dependencies. If target A depends on target B, ant will first do B and then A. Also you specify the main target. This target is the target ant will try to execute per default. If this target depends on other targets then ant will automatically perform these task first and so on and so on.

Tagged : / / / / / /

Makefile – Makefile example – Makefile Guide

makefile-example

Note that this example Makefile is from an older software project, which specifies everything within each makefile rather than using any recursive or inclusion-based makefile hierarchy, and is presented here for the purposes of the C intro project only. It is modified from the original for the purposes of the C intro project.

CC=             gcc
CFLAGS=         -Wall -O2 
LFLAGS+=

SRCS= cas.c \
client.c \
hashtable_itr.c

OBJS= ${SRCS:.c=.o}

all: libmarquis.a libmarquis.so

clean:
rm -f libmarquis.a libmarquis.so *.o

libmarquis.a: ${OBJS}
ar -r $@ ${OBJS}

libmarquis.so:${OBJS}
${CC} -shared ${CFLAGS} -fPIC -Wl,-soname,libmarquis.so -o $@ \
${OBJS}

.c.o:
${CC} ${CFLAGS} -c $<
—————

Tagged : / / / / / / / / /

What is Apache Ant? – Apache ant Overview

apache-ant

What is an apache ant?
Apache Ant is a Java-based build tool. In theory, it is kind of like Make, but without Make’s wrinkles.

Why another build tool when there is already make, gnumake, nmake, jam, and others?
Because all those tools have limitations that Ant’s original author couldn’t live with when developing software across multiple platforms.
Make-like tools are inherently shell-based — they evaluate a set of dependencies, and then execute commands not unlike what you would issue in a shell. This means that you can easily extend these tools by using or writing any program for the OS that you are working on. However, this also means that you limit yourself to the OS, or at least the OS type such as UNIX, that you are working on.
Makefiles are inherently evil as well. Anybody who has worked on them for any time has run into the dreaded tab problem. “Is my command not executing because I have a space in front of my tab!!!” said the original author of Ant way too many times.
Tools like Jam took care of this to a great degree, but still have yet another format to use and remember.
Ant is different. Instead of a model where it is extended with shell-based commands, Ant is extended using Java classes. Instead of writing shell commands, the configuration files are XML-based, calling out a target tree where various tasks get executed. Each task is run by an object that implements a particular Task interface.
Granted, this removes some of the expressive power that is inherent by being able to construct a shell command such as `find . -name foo -exec rm {}`, but it gives you the ability to be cross platform — to work anywhere and everywhere. And hey, if you really need to execute a shell command, Ant has an task that allows different commands to be executed based on the OS that it is executing on.

Tagged : / / / / / / / / / / / / / /