Shared Flashcard Set

Details

ANT Interview Qs
n/a
8
Computer Science
Undergraduate 1
06/08/2013

Additional Computer Science Flashcards

 


 

Cards

Term

Why do we need ANT?

Definition
ANT is platform independent.
Term

What is a “target” in ANT?

Definition
It is a task or unit of work in ANT. ANT build scripts contain a series of targets to be executed.
Term

How do you import files in ANT?

Definition

Use the import tag outside the target.

import file = “${base.dir}/common.xml”

Term

What is the syntax for compiling Java classes in ANT?

Definition

- The <javac> tag invokes the compiler in build.xml. The srcdir and destdir attributes of this tag set the locations for the java files and the resulting .class files.

- The <classpath> subtag sets the locations of the dependencies needed for compilation through its <fileset> subtag.

Term

How do you JAR a Java project in ANT?

Definition

The <jar> tag creates a jar file. It's important attributes are: basedir, destdir, excludes, and includes.

Wildcards and commas are allowed in the 'includes' and 'excludes' attributes.

Term

What does “depends” do in ANT?

Definition
In the build.xml, if the attribute of the <target> tag is used as in depends=”targetY”, then the task will not be executed until targetY completes.
Term

Explain inheritance in ANT.

Definition
<antcall> and <ant> invoke inheritance. The ant task is used to invoke a target located in another build file. It makes a project scalable by allowing a growing a project to be split into child modules (build.xmls) , which are controlled by a master build file.
Term

How do you use an IF statement in ANT?

Definition
IF logic is not part of ANT's core tasks; however, it can be easily added by using a third-party task. Declare the namespace for the third-party library in the project tag then use the namespace with the appropriate logic tag wherever it is needed.
Supporting users have an ad free experience!