findclasspath task

Description

The task is designed to locate the right version of a SDK (for groovy / scala, but maybe for others SDK like android etc...).
Implementation is based on a chain of responsability pattern.

Really basic sample :
<ea:findclasspath org="org.codehaus.groovy" module="groovy-all" revision="1.0"/>
By default if you do not specify anything inside the findclasspath task, easyant will use the default strategies :

Using additional strategy

You can define (or override) the default behavior and plug your own strategy.
By default, EasyAnt came with an additional strategy : environment strategy.

This strategy can be referenced as a nested element of .
If you choose to use additionnal strategy you need to define the whole chain (ordered). This allow you to interfer with the two default strategies

Say for example you want to :
  • check project dependencies
  • if not found check environment variables
  • if not found use the specified version in findclasspath argument
The task will looks like this :
<ea:findclasspath org="org.codehaus.groovy" module="groovy-all" revision="1.0">
<project-dependency-strategy/>
<environment-strategy env="GROOVY_HOME"/>
<basic-configuration-strategy/>
</ea:findclasspath>

Arguments

Parameter name Description Mandatory
pathid name of the path id to fill true
organisation organisation name to search (used by nested strategies extending BasicConfigurationStrategy)
module module name to search (used by nested strategies extending BasicConfigurationStrategy)
revision revision number to search (used by nested strategies extending BasicConfigurationStrategy)
conf configuration name (used by nested strategies extending BasicConfigurationStrategy)
Default: default

Nested Elements

This task can have nested elements extending org.apache.easyant.tasks.findclasspathAbstractFindClassPathStrategy.
By default it comes with three implementation :

Example

Really basic sample :
<ea:findclasspath org="org.codehaus.groovy" module="groovy-all" revision="1.0"/>
Using nested strategies :
<ea:findclasspath org="org.codehaus.groovy" module="groovy-all" revision="1.0">
<project-dependency-strategy/>
<environment-strategy env="GROOVY_HOME"/>
<basic-configuration-strategy/>
</ea:findclasspath>