Difference between revisions of "User:Minooz/Ant"

From CDOT Wiki
Jump to: navigation, search
(Tutorials)
(Tutorials)
Line 7: Line 7:
 
==Tutorials==
 
==Tutorials==
 
* [http://individual.utoronto.ca/kia/ Eclipse based Tutorial ]
 
* [http://individual.utoronto.ca/kia/ Eclipse based Tutorial ]
* Notes from Joran Anastasiade tutorial
+
* Notes from [[User:JAnastasiade| Jordan Anastasiade]]tutorial
 
: Ant is a Java-based build tool. Instead of a model where it is extended with shell-based commands, ant is extended using Java classes
 
: Ant is a Java-based build tool. 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.
 
:Instead of writing shell commands, the configuration files are XML-based, calling out a target tree where various tasks get executed.

Revision as of 09:08, 14 October 2010

ANT

Apache Website

Manual
Index of Manual/Tasks
JUnit Task

Tutorials

Ant is a Java-based build tool. 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.
Installing Ant :
Add the bin directory to your path. Set the ANT_HOME environment variable to the directory where you installed Ant. Assume ant is installed in c:\ant\. The following sets up the environment:
set ANT_HOME=c:\ant
set JAVA_HOME=...
set PATH=%PATH%;%ANT_HOME%\bin
ant buildfiles are written in XML – build.xml. Each buildfile contains one project and at least one (default) target. Targets contain task elements
<?xml version="1.0"?>
<!-- compile java files from all subdirectories -->
  <project name="First" default="build" basedir=".">
    <target name="build" >
      <javac srcdir="."
        debug="false"
        optimize="false"
        includes="**/*.java"
      />
    </target>
  </project>