- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
compile time annotation processing tool for Scala?
Tue, 2010-01-05, 23:48
I need to interface to a Java library that provides custom annotations
and AnnotationProcessor & AnnotationProcessorFactory
implementations to process them.
If you interface to it from java you run apt or "javac -processor".
How would you process such annotations in scala code.
It seems that this would be a recurring problem.
I would do this by writing a compiler plugin that can
apply a AnnotationProcessor & AnnotationProcessorFactory
to annotations in Scala sources.
Has anybody done this? Or is there a better way?
thanks
Daniel
Wed, 2010-01-06, 17:57
#2
Re: compile time annotation processing tool for Scala?
Hi Lukas,
Is this also true of javax.annotation.processing.Processor?
thanks
Daniel
On 1/6/10, Lukas Rytz wrote:
> The Scala compiler does not support java Annotation Processors.
> It would need to map scala declarations to the interfaces in
> com.sun.mirror.declarations somehow,
> http://java.sun.com/j2se/1.5.0/docs/guide/apt/mirror/com/sun/mirror/decl...
>
> I don't think anybody is working on that.
>
> Lukas
>
>
> On Tue, Jan 5, 2010 at 23:48, Daniel Mahler wrote:
>
>> I need to interface to a Java library that provides custom annotations
>> and AnnotationProcessor & AnnotationProcessorFactory
>> implementations to process them.
>> If you interface to it from java you run apt or "javac -processor".
>> How would you process such annotations in scala code.
>> It seems that this would be a recurring problem.
>> I would do this by writing a compiler plugin that can
>> apply a AnnotationProcessor & AnnotationProcessorFactory
>> to annotations in Scala sources.
>> Has anybody done this? Or is there a better way?
>>
>> thanks
>> Daniel
>>
>
Wed, 2010-01-06, 18:17
#3
Re: compile time annotation processing tool for Scala?
I don't know, I'm actually completely unfamiliar with Java'sannotation processors..
Cheers: Lukas
On Wed, Jan 6, 2010 at 17:50, Daniel Mahler <dmahler [at] gmail [dot] com> wrote:
Cheers: Lukas
On Wed, Jan 6, 2010 at 17:50, Daniel Mahler <dmahler [at] gmail [dot] com> wrote:
Hi Lukas,
Is this also true of javax.annotation.processing.Processor?
thanks
Daniel
On 1/6/10, Lukas Rytz <lukas [dot] rytz [at] epfl [dot] ch> wrote:
> The Scala compiler does not support java Annotation Processors.
> It would need to map scala declarations to the interfaces in
> com.sun.mirror.declarations somehow,
> http://java.sun.com/j2se/1.5.0/docs/guide/apt/mirror/com/sun/mirror/declaration/package-summary.html
>
> I don't think anybody is working on that.
>
> Lukas
>
>
> On Tue, Jan 5, 2010 at 23:48, Daniel Mahler <dmahler [at] gmail [dot] com> wrote:
>
>> I need to interface to a Java library that provides custom annotations
>> and AnnotationProcessor & AnnotationProcessorFactory
>> implementations to process them.
>> If you interface to it from java you run apt or "javac -processor".
>> How would you process such annotations in scala code.
>> It seems that this would be a recurring problem.
>> I would do this by writing a compiler plugin that can
>> apply a AnnotationProcessor & AnnotationProcessorFactory
>> to annotations in Scala sources.
>> Has anybody done this? Or is there a better way?
>>
>> thanks
>> Daniel
>>
>
I don't think anybody is working on that.
Lukas
On Tue, Jan 5, 2010 at 23:48, Daniel Mahler <dmahler [at] gmail [dot] com> wrote: