Stephen Nesbitt wrote:
All:
I'm trying to figure out if something is possible or if I am just being
clueless.
I have written a couple of tasks using jython and scriptdef. Becuase they
are jython and white case is significant, the jython scripts are in files
referenced by the src attribute rather than included in the scripdef
itself.
I could make these available to builds that need them by using the import
mechanism. However it seems to me to be more elegant to use the antlib
mechanism.
However I can't figure out how to use the antlib mechanism with a
scriptdef element (or even if it is possible under 1.6.5). Does the
antlib.xml need to be in a jar? or can they live in an exploded
directory? How do I inform Ant where the implementing scripts live?
I have tried this by creating an jar having only a single antlib.xml. And
I can even get the build file to recognize it. But I am also seeing funny
results. For instance a single "print attributes" statment is invoked
twice with the attributes collection correct in the first invocation and
empty in the second.
Am I barking up the wrong tree here? What would be the best way to
distribute these scriptdef tasks?
The ideal way would be to bundle everything up into its own JAR. I dont
think Ant1.7 suppports that, but it is clearly something to work on. At
a guess, we'd need the scriptdef tasks to be resource aware, and take
files on the classpath as a source. Where that can cause problems is for
tasks that import relative stuff; I dont see them handling that easily.
-steve
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]