Description

check-all-required task checks that all the jars in a path are required when executing a sequence of ant tasks. The ant tasks can be a compilation, a test execution or whatever tasks using a path.

The used approach is to execute the sequence of tasks multiple time with the path being replaced by a smaller path (a copy of the original path from which we have remove one element). All those executions are expected to fail. If the task sequence doesn't fail, check-all-required will fail.

The normal execution with the original path is execution after all execution with sub-path.

Attributes

AttributesDescriptionRequired
pathrefThe id of the path to check.True
Nested ElementDescriptionRequired
anycheck-all-required accept any task tag as sub element. This is the tasks that will be executed.True

Examples

The following example will try to compile some sources with different subpath of deps.jar.

Note that we delete the temporary directory before the execution of javac so that every execution run in a clean context.

<traget name="check-deps" depends="jar">
   <deco:check-all-required pathref="deps.jar">
        <delete dir="${tmpclass.dir}" includes="**/*.class"/>
        <javac srcdir="src" 
               destdir="${tmpclass.dir}"
               classpathref="deps.jar"
               includeAntRuntime="false"
        />
   </deco:check-all-required>
</target>