JaVa
   

Frequently Used Nested Parameters and Elements

Nested parameters can be used within certain tasks tags, as children. Some of the most frequent ones are listed below in order to shorten the definition a tasks, by avoiding repetition.

Classpath Element

The classpath task allows tasks to use paths and class paths efficiently:

<classpath path="[path]"/>


Nested Parameters

The above example includes all Java source except those with the substring “Test” in their filename.

Mapper Element

The mapper task simply maps a file to a target. Keep in mind that this task is used in conjunction with other tasks.

<mapper type="identity"/> 


In the above the to and from are ignored and the files are copied into a parallel subdirectory hierarchy as the source to the destination (e.g., c:\src\xptool\Hello.java copied to d:\backup\src\xptool\Hello.java).

<mapper type="flatten"/>


Unlike the first example, copy all the files from the source to the destination, but all in the source directory with no subdirectory hierarchy (e.g., c:\src\xptool\Hello.java copied to d:\backup\Hello.java).

<mapper type="glob" from="*.java" to="*.java.bak"/>


Copy *.java files to *.java.bak files (e.g., c:\src\xptool\Hello.java copied to d:\backup\src\xptool\ Hello.java.bak).

Parameters

Nested Parameters

Fileset Element

The fileset task defines groups of files in a branch of a directory structure:

<fileset dir="src/" >


Parameters

Nested Parameters

Patternset Element

The patternset task provides a way to group patterns for later use. It is commonly used nested in a fileset task:

<patternset id="junit.test.sources" >
<include name="**/*Test*.java" />
 <exclude name="**/AllTests.java" />
</patternset>


Parameters

Zipfileset Element

The zipfileset task defines groups of files in a branch of a directory structure:

<zipfileset dir="src/" >


Parameters


JaVa
   
Comments