• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/8

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

8 Cards in this Set

  • Front
  • Back

Why do we need ANT?

ANT is platform independent! The same build.xml file will run on Windows or UNIX machines without modification. Therefore, developers running Windows can conduct weekly builds along side testers running Windows, and production personnel doing deployments in Linux.

What is a "target"?

A target is a task or unit of work in ANT. ANT build scripts contain a series of targets to be executed. In build.xml, the tag defines the user created tasks to be performed.

How do you import files?

Use the import tag outside any target. EXAMPLE: <import file="${base.dir}/common.xml"/>

What is the syntax for compiling Java classes?

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, respectively. The <classpath> subtag sets the locations of the dependencies needed for compilation through its subtag.

How do you JAR a Java project?

The <jar> tag creates a jar file. Its important attributes are: basedir, destdir, excludes, and includes, respectively.




EXAMPLE:


<jar destfile=Full path of resulting jar file.


basedir= Full path of directory containing files to be JARed.


includes= Files to include in the JAR.


excludes= Files to exclude from the JAR. />






Wildcards and commas allowed in the "includes" and "excludes" attributes.

What does "depends" do?

In the build.xml if the attribute of the tag is used as in depends="targetY" then the task will not be executed until targetY completes.

Explain inheritance in ANT.

The following tasks involve inheritance: <antcall> and <ant>. The ant task is used to invoke a target located in another build file. It makes a project scalable by allowing a growing project to be split into child modules (build.xmls), which are controlled by a master build file. These child modules can inherit properties defined in the master build file as controlled by the inheritAll attribute of <ant>.




inheritAll = "true" means all the properties in the master build file are passed down to the child builds. inheritAll = "false" means only those properties defined inside the ant tag and the command line are passed down to the child builds.

How do you use an IF statement in ANT?

IF logic is not part of ANT's core tasks; however, it can be easily added by using thrid-party tasks such as SourceForge's "ANT-contrib" jar. Declare the namespace for the third- party library in the project tag then use the namespace with the appropriate logic tag (if, then else, or, nor, for) where ever needed in the project.




EXAMPLE:




<project name="define-ac">


<taskdef resource="net/sf/antcontrib/antcontrib.properties"


<uri="http://antcontrib.sf.net"/>


</project>




Inside a target use:


<ac:if>


<condition>


<ac:then>


do something


</ac:then>


</ac:if>