Yves Martin <[EMAIL PROTECTED]> writes:
> Hello,
>
> I have a issue in the following context:
>
> A project 'A' call my task 'plugin' that creates a sub-project 'B' 'B' can
> see task definitions from 'A'.
>
> But when 'B' has done its job, I would like to "propagate" task definitions
> (for instance antlib:mydomain:mytask) from 'B' into 'A' (to be usable in
> 'A') in my Java code for 'plugin'.
>
>
> I have done may trials with ComponentHelper:
>
> - copy reference of 'ant.ComponentHelper' => failure with project location
> ???
>
> - read DataTypeDefinitions from child component helper to add them in 'A'.
> But
> I do not find 'antlib:mydomain:mytask' in my log ???
>
> What's the best way to implement such a mechanism ?
I answer to myself, I have found a simple way to do init. Reverse the usage of
'initSubProject' with the child/parent component helper.
// Propagate AntLib definitions
ComponentHelper namespace =
(ComponentHelper) getProject().getReference("ant.ComponentHelper");
ComponentHelper childNamespace =
(ComponentHelper) project.getReference("ant.ComponentHelper");
if (namespace != null && childNamespace != null) {
namespace.initSubProject(childNamespace);
}
Regards
--
Yves Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]