felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carsten Ziegeler <cziege...@apache.org>
Subject Re: Reimplementing the SCR Generator using annotation processing (FELIX-3550)
Date Fri, 15 Jun 2012 11:29:10 GMT
Hi Robert,

thanks for starting this discussion. It really would be nice to base
the implementation on the javax.annotation.proessing stuff.

2012/6/14 Robert Munteanu <rmuntean@adobe.com>:
> 1. Configuration
> There is a standard way of passing compiler arguments when invoking javac (-Akey=value
) but it would require configuring the compiler rather than the scr plugin. At least for maven
builds this is less convenient.

Yes, I guess this is one of the biggest challenges. Now, we might
simply pass the information through a static field in some common
class. However this would be problematic with parallel builds like
Maven. So we maybe could use a thread local which would only work if
the same thread is used. But I guess we could find a solution here. If
we are able to pass objects into the processor, we can use these
objects to pass back the result. For example, the Maven plugin is
creating a manifest header afterwards.

> 2. Incremental builds
> When performing a partial build ( for instance in Eclipse, but I think it also applies
to Maven ) not all annotated classes are passed to the processor so the SCR generator should
either only work on full builds by deign or be able to perform incremental builds.

Incremental builds should not pose a problem. Right now, all
descriptors are written into a single xml file, however we can change
this easily with generating a file for each component. This can easily
be updated incrementally (as long as we can handle deletes etc.)

But I see some problems in the general processing: right now the tool
is parsing two different kinds of classes: classes belonging to the
project and classes from dependencies as a project class might inherit
from a dependency and it might want to inherit the descriptors as
well.  I guess we would still need ASM for handling the dependencies.
The result of a component descriptor is the assembly of several
annotations and these annotations are pluggable and therefore are
processed by different processors. So we need a way to first assemble
all annotations and once all annotations of a particular class are
assembled, process them in one go. I'm not sure if this is possible.

Carsten Ziegeler

View raw message