-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use PDE API-Tools java-annotations instead of javadoc-annotations #1039
base: master
Are you sure you want to change the base?
Use PDE API-Tools java-annotations instead of javadoc-annotations #1039
Conversation
Created #1043 to track this further. |
I agree that having annotations instead of javadoc comments is good, in particular to ease static analysis. |
The (javadoc) annotations are only understood by PDE API Tools anyways ;-)
The annotation are class retention annotations and therefore not preserved at runtime and only required at build time. |
No it doesn't. The neither the annotation providing package nor the bundle is added to the Manifest (as you can verify in the changes of this PR). In the IDE PDE and in the build Tycho automatically adds the apitools.annotation bundle to the project classpath so it is not necessary to define any dependency. And besides what Christoph already mentioned, even if they would have retention policy runtime it would not be a problem. If an annotation's class cannot be loaded at runtime that annotation is simply ignored and no NoClassDefFoundError or alike is thrown. So in that regard this change is safe :) |
1777089
to
d53079d
Compare
How do you resolve the dependency on |
@HannesWell As long as
|
@Phillipus please use latest Platform SDK IDE: it will then resolve everything automatically, and Tycho is doing it already since a few releases, so yes remove |
@laeubi I'm using Eclipse 4.30 as IDE and a target platform of 4.31 (latest I build). I guess i need 4.31 as IDE. Thanks for the heads up. @HannesWell Please ignore comments above. @Phillipus Note to self - use latest IDE build as well as target platform when testing new features. ;-) |
In general this is right, but currently not for this PR because it uses the new annotation message values, which a.t.m. are only available in I-build. It looks like Tycho uses the latest release of the annotations at the time of tycho's release, when adding them automatically to the classpath. But I'm currently starting a three week vacation and when I'm back the next SimRel will happen soon. Furthermore at least I get a lot of API errors in my workspace when using the annotations. It locks like they are not discovered in some cases. Actually it should work since the generated Another part in this story is Oomph. If there is no dependency in the bundle Oomph does not add the apitools-annotations to the TP and I had to add it explicitly. Maybe Oomph could do that implicitly (as optional requirement) if a API-baseline task is defined. |
Tycho uses what is available from target platform and if nothing is found uses the latest from central. |
Then it was maybe a not updated cache or similar why I got compile errors in local builds. |
d53079d
to
c098f66
Compare
c098f66
to
64b245a
Compare
There are many conflicts with master now. Do you plan to finish this one or it should be abandoned? |
I plan to finish this one, altough it has currently not the highest priority. |
Using the java-annotations is more save/stable since the compiler can check them and would allow the SWT to get rid of the .api_description file (but at the moment it looks like apitools/the tycho apitools mojo still generates the entries in the description).
Furthermore this helps to fix (at least in my local build) the inconsistency in the generated
.api_description
for macos regarding theDisplay
class as found in #1011 (comment). On Macos the entry is currently<type name="Display" restrictions="0">
, while it is<type name="Display" restrictions="2">
on all other platforms. This probably leads to the error described in #1011 (comment).I assume somehow the existing
@noextend
javadoc annotation is currently not discovered, at least when running the build on Linux and Windows. On a mac it seems to be discovered. For other combinations of running platform and Display class platform-variant it works as expected. But I cannot tell why this is currently done wrong.At the moment one cannot specify a informational message for these annotations, but I have created eclipse-pde/eclipse.pde#1133 to add that possibility.
If there are not objections I'll apply this change to the remaining classes too.
Fixes #1043