Description
Recommended usage:
<antlib>
<init>
Put initialization code here, like:
<echo> Library initialized</echo>
</init>
</antlib>
Initialize an antlib, by setting common properties and executing the nested tasks, while making sure the execution is done
one-time, no matter how many times the antlib is loaded. This task could be used only in <antlib> - it deliberately does not
run in <project> to avoid proliferation of quite similar in use/meaning ways to do the same things like project's
initialization (setup).
Convention:
- The properties this task sets have a common (unique) prefix, calculated as follows:
- take the location of the of the antlib calling this task
- strip any references to the jar it might have been found in
- strip any line number
- strip the trailing .xml
- replace / with .
The result is referred as (unique) namespace of the special properties for the antlib calling this task. Examples:
- net.mdatools.modelant.util.antlib
- net.mdatools.modelant.uml13.reverse.antlib
- The properties this task sets:
- <namespace>.dir -> the absolute path were the antlib file is loaded from or the .jar containing it is
- <namespace>.initialized -> true indicating that the initialization of the antib is done and will not be repeated
- <namespace>.classpath -> the string as CLASSPATH the using library was loaded with.
NOTE: This task allows using <import> tasks, which would not be possible by deafault.
Implementation class
net.mdatools.modelant.util.task.AntLibInitTask
Nested elements
Element |
Description |
Any task |
The tasks to execute for AntLib initialization |
Use <typedef resource="net/mdatools/modelant/util/antlib.xml"/>
Documentation generated by ant.doc Ant macro from ModelAnt by MDA Tools |