Ant

From WinMerge

Jump to: navigation, search

Apache Ant is a build tool for Java programs. It can be used for C/C++ building with additional tasks.

Prerequisites:

  • Java version 1.4.2 or later

[edit] Installing

Installing Ant + C/C++ tasks requires some manual work. Follow the instructions below.

[edit] Ant

Download Ant binary distribution from http://ant.apache.org/. Unzip it to own folder (e.g. C:/Tools/ant/.

Create a batch file to setup Java + Ant environment:

set ANT_HOME=C:\Tools\apache-ant-1.7.1
set JAVA_HOME=C:/Program Files/Java/jdk1.6.0_06/
set PATH=%PATH%;%ANT_HOME%\bin

where ANT_HOME is your Ant installation folder and JAVA_HOME is Java installation folder.

To run Ant files, open Command Prompt and run this batch file first.

[edit] Ant C/C++ task

Download "cc compilation task" source distribution from http://ant-contrib.sourceforge.net/. Note that it is separate distribution from ant-contrib files.

Unzip the sources to some proper folder (e.g. C:/Code/Ant-cc-task/).

To build cc-task:

  • open Command Prompt
  • run the Ant setup batch file (created above when installing Ant)
  • CD to cc-task source folder
  • type command: ant (That's right, just ant, it'll runs the (build) script from current folder)

Copy generated cpptasks.jar file from /target/lib/ subfolder to Ant's lib/ subfolder.

Personal tools
Ads: