Books
in black and white
Main menu
Share a book About us Home
Books
Biology Business Chemistry Computers Culture Economics Fiction Games Guide History Management Mathematical Medicine Mental Fitnes Physics Psychology Scince Sport Technics
Ads

Java Tools for Extreme programming mastering open source tools including - Hightower R.

Hightower R. Java Tools for Extreme programming mastering open source tools including - Wiley publishing , 2002. - 417 p.
ISBN: 0-471-20708
Download (direct link): javatoolsforextremeprog2002.pdf
Previous << 1 .. 107 108 109 110 111 112 < 113 > 114 115 116 117 118 119 .. 159 >> Next

301
? <ANT antfile="[ant file] dir="[location of ant file]"/>
target A specific target to be run, located in the Ant file:
<ANT antfile="[ant file] target="[target]"/>
? output A file to hold the output of the Ant script:
? <ANT antfile="[ant file] output="[log file]"/>
Antcall Task
The antcall task executes an Ant target:
<antcall target="[target]"/>
All of the dependent Ant targets will execute, followed by the specific target specified.
Parameters
? target* The target name that antcall will execute.
Nested Parameters
? param A property to be set before running the tasks in the target.
? name Name of a property to be assigned a value.
? value Value to assign to the property.
This example will set a property to a value when the antcall task is executed:
<antcall target="[target name]">
<param name="[property]" value="[property value]"/>
</antcall>
Available Task
You can use the available task to determine if a file, class, or Java Virtual Machine (JVM) system property is available. If it is not present, the task sets the value of a given property to "false" (the value defaults to "true").
In the following example, if the file is not available, the property will be set to "false":
<available file="[resource]" property="[property]"/>
Parameters
? property* Name of the property to set, as defined by the property task.
? value The text that will be assigned to the property if the resource is available. The default
value is "true":
? <available file="[file name]" property="[property]" value="[property
? value]"/>
? classname Name of a class file; used to determine if the class file is available:
? <available classname="[class file]" property="[property]"/>
? resource Name of a JVM resource; used to determine if the resource is available:
? <available resource ="[JVM Resource]" property="[property]"/>
? file* Name of a file; used to determine if the file is available.
? classpath A class path to use when looking up class files with the classname attribute:
? <available classpath="[class path]" classname="[class file]"/>
? classpathref A classpathref is used to look into a classpath that has already been defined with a path element demonstrated in the buildfile snippet below.
The following example will determine if a class file within a given path exists, by using the property that references a path:
<project...
<path id="[property]">
<pathelement path="[path]/"/>
</path>
302
<task...
<available classname="[class file]" classpathref="[property of path]"/>
</task>
Nested Parameter
? classpath Allows tasks to use paths and class paths efficiently (see section "Frequently
Used Nested Parameters and Elements" at the end of this chapter).
Echo Task
The echo task sends message to Ant's system output or to a specified file:
<echo message="Hello world"/>
<echo>
This is a longer message stretching over two lines.
</echo>
Parameters
? message* Text of the message to display.
? file Name of a file to direct output to.
? append Boolean value of "true" or "false". When set to "true", output will beappended to a file specified by the file element. Defaults to "false".
Fail Task
The fail task stops execution of the current build:
<fail/>
Parameter
? message Text of a message to be displayed when the fail task is executed Property Task
The property task creates properties by assigning values to names. Properties set outside the current Ant project cannot be reassigned in the current Ant project:
<property name="[property]" value="[property value]"/>
Parameters
? name* A name to be assigned to a name/value pair
? value* A value to be assigned to a name/value pair
? refid A name used in referring to an attribute specified by the "id" parameter of a path
structure (see the path element in the section "Ant Parent Elements"):
? <property refid="[property]"/>
? file A reference to an external properties file in which each line specifies a new key value pair:
? <property file="[file name]"/>
? location A reference to an external properties file with an absolute path, in which each line specifies a new key value pair in the file:
? <property location="[absolute path]"/>
? environment A prefix to be assigned to the property used to get the current systems properties:
? <property environment="[property]"/>
303
The following line will return the value of the system property:
<echo message="[environment property].[system property]"
? classpath The class path used to determine the properties file for the java.util.Properties class in Sun's JDK
? classpathref The class path defined in Ant's path element that is used todetermine the properties file for the java.util.Properties class in Sun's JDK
Nested Parameter
? classpath Allows tasks to use paths and class paths efficiently (see section "Frequently
Used Nested Parameters and Elements" at the end of this chapter).
Taskdef Task
The taskdef task creates a custom task by executing Java classes:
<taskdef name="[task]" classname="[java class]"/>
Previous << 1 .. 107 108 109 110 111 112 < 113 > 114 115 116 117 118 119 .. 159 >> Next