On 09/05/2011, at 5:49 PM, Marco Hunsicker wrote:

> Howdy,
> 
> as my plugin has been written in Java, I'm using the 
> org.gradle.api.tasks.ConventionValue interface for property mapping. Now, 
> this requires the import of a type that does not seem to be part of the 
> public API (org.gradle.api.internal.IConventionAware). Is this intentional?

It is. The convention mapping stuff is not really part of the public API yet. 
Mainly because it is not complete, and works only in rather specific cases. 
Hopefully we can finish it up enough to make it public soon.

You can use it if you like. It's definitely easier to use from Groovy rather 
than Java. If you do want to use it from Java, I'd suggest that you use a 
Callable, rather than a ConventionValue. ConventionValue will be removed at 
some point. That is, use something like:

jalopy.getConventionMapping().map("classpath", new Callable() { .... });



> Is there another supported way to achieve the same in pure Java? Thanks.
> 
> jalopy.getConventionMapping()
>      .map("classpath", new ConventionValue()
>          {
>              public Object getValue(
>                  Convention       rConvention,
>                  IConventionAware rTarget)
>              {
>                  LOG.debug("Inject classpath property {}",
>                      rSet.getCompileClasspath());
> 
>                   return rSet.getCompileClasspath();
>              }
>          });
> 
> Cheers,
> 
> Marco
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>   http://xircles.codehaus.org/manage_email
> 
> 


--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com

Reply via email to