<terp.init> - a framework task
<terp.init> task requires that the
ant-terp.jar file be available to ant and that the task be registered via a <taskdef> statement:
<taskdef name="terp.init" classname="com.codemesh.terp.ant.Initializer"/>
Please note that you could use any value for the
name attribute that you wish; you are not limited to
terp.init. All our examples and documentation use the
terp.init name and use a name prefix of
terp. to signal that they originate with and rely on the terp framework.
<terp.init> task is a
terp framework task that can be used to register terp extensions with the terp framework when running in ANT. When you use terp extensions with the terp launcher the extensions are automatically registered with the framework. The terp launcher inspects all jar files for
Terp-Activator manifest entries. If found, the entry's value is interpreted as the name of a type implementing the
TerpInitializer interface. The type's
init() method will then be invoked and perform all initializations for the extension module.
When you use a terp extension module in ANT, the terp launcher is not in control of class loading and therefore cannot perform the initializations described above. There really is no fully automatic way to initialize the terp extension module in this mode. You do not have to worry about this problem for the terp core functionality because every terp ANT task knows about the terp core features and how to initialize them.
Not having a fully automatic way to initialize terp extensions in ANT puts the burden on you, the user. You have to somehow tell terp about the extensions you intend to use. You can use the
<terp.init> task for that purpose. The
<terp.init> task supports the following attributes:
|classname||String||Optional attribute specifying the name of a type implementing the TerpActivator interface.|
|path||String||Optional attribute specifying a path that will be inspected for TerpActivator types.|