Home » Modeling » EMF » Generated code and PDE API Baselines
| |
Re: Generated code and PDE API Baselines [message #1062261 is a reply to message #901362] |
Thu, 06 June 2013 19:38 |
Eric Rizzo Messages: 3070 Registered: July 2009 |
Senior Member |
|
|
Sorry to revive an old thread, but I just got around to trying this out. See comments below.
Ed Merks wrote on Sat, 11 August 2012 08:36Eric,
You should add those to the user-doc section, or specify them as
annotations in the model so they end up in the model-doc section.
So I took an existing .ecore with generated code and added a new attribute to one of the types. I then attached an EAnnotation to that attribute, like this:
<eStructuralFeatures xsi:type="ecore:EAttribute" name="foo" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="@since 2.0"/>
</eAnnotations>
</eStructuralFeatures>
When I re-generated code, it added the @since 2.0 to the model-doc section of the interface getter method, but did not include it in the setter method. Nor did it included it at all in the generated impl class or the Package interface or impl class.
However, in my case that's not nearly good enough because the API Baseline marks anything that's public as violating the baseline and thus an error until I add the @since tags manually.
Is there some way to get the EMF generator to apply the documentation EAnnotation more broadly for new attributes?
Thanks,
Eric
Quote:
On 11/08/2012 12:08 AM, Eric Rizzo wrote:
> I'm working on an RCP project that uses EMF generated code; recently
> we introduced a PDE API baseline to help track our API changes. The
> problem is, when the code is re-generated from the models, it loses
> all the @since tags that we've added to satisfy the API Baseline tooling.
>
> Is there some way to configure the genmodel or other trick to get it
> to not lose the manually inserted @since tags?
>
|
|
|
Re: Generated code and PDE API Baselines [message #1062267 is a reply to message #1062261] |
Thu, 06 June 2013 20:33 |
Ed Merks Messages: 33216 Registered: July 2009 |
Senior Member |
|
|
Eric,
No, only the getter is documented. You'd have to add it elsewhere manually.
On 06/06/2013 9:38 PM, Eric Rizzo wrote:
> Sorry to revive an old thread, but I just got around to trying this
> out. See comments below.
>
> Ed Merks wrote on Sat, 11 August 2012 08:36
>> Eric,
>>
>> You should add those to the user-doc section, or specify them as
>> annotations in the model so they end up in the model-doc section.
>
>
> So I took an existing .ecore with generated code and added a new
> attribute to one of the types. I then attached an EAnnotation to that
> attribute, like this:
>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="foo"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
> <details key="documentation" value="@since 2.0"/>
> </eAnnotations>
> </eStructuralFeatures>
>
>
> When I re-generated code, it added the @since 2.0 to the model-doc
> section of the interface getter method, but did not include it in the
> setter method. Nor did it included it at all in the generated impl
> class or the Package interface or impl class.
> However, in my case that's not nearly good enough because the API
> Baseline marks anything that's public as violating the baseline and
> thus an error until I add the @since tags manually.
>
> Is there some way to get the EMF generator to apply the documentation
> EAnnotation more broadly for new attributes?
>
> Thanks,
> Eric
>
>
> Quote:
>> On 11/08/2012 12:08 AM, Eric Rizzo wrote:
>> > I'm working on an RCP project that uses EMF generated code;
>> recently > we introduced a PDE API baseline to help track our API
>> changes. The > problem is, when the code is re-generated from the
>> models, it loses > all the @since tags that we've added to satisfy
>> the API Baseline tooling.
>> >
>> > Is there some way to configure the genmodel or other trick to get
>> it > to not lose the manually inserted @since tags?
>> >
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Generated code and PDE API Baselines [message #1062449 is a reply to message #1062267] |
Fri, 07 June 2013 19:02 |
Eric Rizzo Messages: 3070 Registered: July 2009 |
Senior Member |
|
|
Ed Merks wrote on Thu, 06 June 2013 16:33Eric,
No, only the getter is documented. You'd have to add it elsewhere manually.
OK, thanks. If I enter an enhancement request into bugzila do you see any change of it being adressed?
Eric
On 06/06/2013 9:38 PM, Eric Rizzo wrote:
> Sorry to revive an old thread, but I just got around to trying this
> out. See comments below.
>
> Ed Merks wrote on Sat, 11 August 2012 08:36
>> Eric,
>>
>> You should add those to the user-doc section, or specify them as
>> annotations in the model so they end up in the model-doc section.
>
>
> So I took an existing .ecore with generated code and added a new
> attribute to one of the types. I then attached an EAnnotation to that
> attribute, like this:
>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="foo"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
> <details key="documentation" value="@since 2.0"/>
> </eAnnotations>
> </eStructuralFeatures>
>
>
> When I re-generated code, it added the @since 2.0 to the model-doc
> section of the interface getter method, but did not include it in the
> setter method. Nor did it included it at all in the generated impl
> class or the Package interface or impl class.
> However, in my case that's not nearly good enough because the API
> Baseline marks anything that's public as violating the baseline and
> thus an error until I add the @since tags manually.
>
> Is there some way to get the EMF generator to apply the documentation
> EAnnotation more broadly for new attributes?
>
> Thanks,
> Eric
>
>
> Quote:
>> On 11/08/2012 12:08 AM, Eric Rizzo wrote:
>> > I'm working on an RCP project that uses EMF generated code;
>> recently > we introduced a PDE API baseline to help track our API
>> changes. The > problem is, when the code is re-generated from the
>> models, it loses > all the @since tags that we've added to satisfy
>> the API Baseline tooling.
>> >
>> > Is there some way to configure the genmodel or other trick to get
>> it > to not lose the manually inserted @since tags?
>> >
>
|
|
|
Re: Generated code and PDE API Baselines [message #1062518 is a reply to message #1062449] |
Sat, 08 June 2013 08:01 |
Ed Merks Messages: 33216 Registered: July 2009 |
Senior Member |
|
|
Eric,
Probably things like @since and @deprecated should have specialized
support so that all derived artifacts will be marked, e.g., including
the things in the package interface. There's
https://bugs.eclipse.org/bugs/show_bug.cgi?id=276954 open for quite a
while already. The two things seem quite closely related and need to be
generated in the same places for the similar reasons so it would make
sense to address both issues at once. To be honest, it's not likely to
be my highest priority...
On 07/06/2013 9:02 PM, Eric Rizzo wrote:
> Ed Merks wrote on Thu, 06 June 2013 16:33
>> Eric,
>>
>> No, only the getter is documented. You'd have to add it elsewhere
>> manually.
>
> OK, thanks. If I enter an enhancement request into bugzila do you see
> any change of it being adressed?
>
> Eric
>
>
>
> On 06/06/2013 9:38 PM, Eric Rizzo wrote:
>> Sorry to revive an old thread, but I just got around to trying this
>> out. See comments below.
>>
>> Ed Merks wrote on Sat, 11 August 2012 08:36
>>> Eric,
>>>
>>> You should add those to the user-doc section, or specify them as
>>> annotations in the model so they end up in the model-doc section.
>>
>>
>> So I took an existing .ecore with generated code and added a new
>> attribute to one of the types. I then attached an EAnnotation to that
>> attribute, like this:
>>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="foo"
>> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
>> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
>> <details key="documentation" value="@since 2.0"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>>
>>
>> When I re-generated code, it added the @since 2.0 to the model-doc
>> section of the interface getter method, but did not include it in the
>> setter method. Nor did it included it at all in the generated impl
>> class or the Package interface or impl class.
>> However, in my case that's not nearly good enough because the API
>> Baseline marks anything that's public as violating the baseline and
>> thus an error until I add the @since tags manually.
>>
>> Is there some way to get the EMF generator to apply the documentation
>> EAnnotation more broadly for new attributes?
>>
>> Thanks,
>> Eric
>>
>>
>> Quote:
>>> On 11/08/2012 12:08 AM, Eric Rizzo wrote:
>>> > I'm working on an RCP project that uses EMF generated code;
>>> recently > we introduced a PDE API baseline to help track our API
>>> changes. The > problem is, when the code is re-generated from the
>>> models, it loses > all the @since tags that we've added to satisfy
>>> the API Baseline tooling.
>>> >
>>> > Is there some way to configure the genmodel or other trick to get
>>> it > to not lose the manually inserted @since tags?
>>> >
>>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Goto Forum:
Current Time: Thu Sep 19 16:02:07 GMT 2024
Powered by FUDForum. Page generated in 0.03750 seconds
|