Hi Tom
This first issue was a nasty one. I think I've sorted it out. What I've
discovered is this ...
The classpath used for taskdef defines the set of visible classes
available to the classloader for that task. Files that would match the
classpath pattern, but aren't present at time of taskdef are not visible
to the classloader of the task.
This means, if you perform the taskdef prior to compiling the spec
classes, the task will not successfully execute Class.forName on any
spec class files it finds. This is unfortunate because the
MarkedMethodFileChecker uses Class.forName to check for @Specification
annotations but fails silently when Class.forName throws an exception.
To get around this I instantiate a new AntClassLoader in the task and
pass it all the way down to the file checker. It's just a
does-it-work-kinda-hack right now, so I'm not ready to check in, but it
seems to work.
I believe the taskdef needs the instinct jar and all dependencies. Is
this what you meant when you said the instinct jar is all you should
need? I might be wrong but I tried it with instinct jar only and I got a
clear error from Ant that dependencies were missing. Seems sensisble. My
memory of two days ago is now fuzzy so I might try it again to be sure.
But yes, in the current version you would need to have the spec class
files compiled and present in the taskdef classpath if you want any
chance of their being executed.
My eyes are a mite bleary right now, so if I haven't made complete sense
just shout out.
As for the second issue ... I haven't looked at it yet. :)
Cheers
Jem
Tom Adams wrote:
> 1) The classpath isn't always passed down to the task correctly. If you
> define the task with the right classpath, everything is OK, however if
> you define the task with just the instinct Jar (all you should need) and
> then pass in the correct runtime classpath to the task, it doesn't work.
> I've taken a couple of cracks at this, but never appear to crack it
> properly.
>
> 2) The failure property does not get set on failure, so failing builds
> pass.
>
> Just checked the issues list and it doesn't look like they've been logged.
>
> Tom
>
>
> On 15/11/2008, at 5:44 PM, Jeremy Mawson wrote:
>
>>
>> Thanks again Tom,
>>
>> I'd love to have some people work with it before a release. Perhaps some
>> people would be happy to try breaking it.
>>
>> What are the other Ant issues?
>>
>> Cheers
>> Jem
>>
>>
>>
>>
>> Tom Adams wrote:
>>> Nice work!
>>>
>>> Are you thinking this is stable enough to do a new release? Or would you
>>> like more time for people to play with it?
>>>
>>> If you're thinking of waiting there's a couple of other Ant issues that
>>> would be good to resolve also, but I'm not fussed either way.
>>>
>>> Cheers,
>>> Tom