TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

Automation

Apache Ant Build Tool

Overview

Apache ANT is a Java build automation tool. ANT stands for Another Neat Tool. The main use case of the Ant tool is to build Java applications. We can download the tool from the official website link.

Ant Official Website Link :  https://ant.apache.org/

Install

Install steps for popular operating systems:

Windows 10: https://www.testingdocs.com/download-and-install-ant-on-windows/

Ubuntu: https://www.testingdocs.com/install-ant-tool-on-ubuntu-linux/

build.xml

The default Ant build file is an XML file called build.xml. The build file has  a <project> tag. The project tag can have multiple <target> tags.

Project tag

<project name=”TDocsProject” default=”all” basedir=”.”>

Target tag

Sample target for compiling Java classes. The target name is build.

<!– Compile Java Files  –>
<target name=”build” >
<javac srcdir=”${src}” destdir=”${classdir}” includes=”**/*.java” includeantruntime=”false” classpathref=”build.classpath”/>
</target>

Dependencies

We can specify dependencies for the targets in the build file. We can use the attribute depends= to specify the dependencies. For example

<target name=”jar” depends=”build”>

Here the jar target depends on successful build target.

Properties

We can use variables in the build.xml.

<property name=”classdir” value=”${dirs.base}/bin”/>
<property name=”src” value=”${dirs.base}/src”/>
<property name=”lib” value=”${dirs.base}/lib”/>

The property value can be references using the ${}. For example to reference the src file path we can use,

${src}

Related Posts

Emma Tool

Automation /

Code Coverage Tools

Selenium 4 Automation Project

Automation /

Selenium 4 Project Setup on Ubuntu Linux

Testing webpage mobile-friendliness using a tool

Automation /

Testing webpage mobile-friendliness using a tool

Errors Code Testing Development

Automation /

Error Severity Metrics

Automation Environment Setup Verification

Automation /

Automation Environment Setup Verification

‹ Types of Functions in the C Language› Network Security Audit Tools

Recent Posts

  • MS Access Data Types
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version