eclipse-platform / eclipse.platform

https://eclipse.dev/eclipse/
Eclipse Public License 2.0
84 stars 113 forks source link

Use RetentionPolicy CLASS in new 'ServiceContextKey' OSGi property type #1587

Closed HannesWell closed 1 month ago

HannesWell commented 1 month ago

And permit only types as target.

If the RetentionPolicy is only SOURCE Tycho does not recognize the annotation because the underlying BND library only operates on compiled classes and not on sources.

RetentionPolicy.CLASS is the default, but I still declared it to be specific in this case.

github-actions[bot] commented 1 month ago

Test Results

 1 758 files  ±0   1 758 suites  ±0   1h 33m 7s :stopwatch: + 6m 32s  4 170 tests ±0   4 148 :white_check_mark: ±0   22 :zzz: ±0  0 :x: ±0  13 107 runs  ±0  12 943 :white_check_mark: ±0  164 :zzz: ±0  0 :x: ±0 

Results for commit f246856d. ± Comparison against base commit e14565e5.

laeubi commented 1 month ago

Probably PDE should warn if a property type is using source retention even though the spec only says

To be used in this way, the component property type must be annotated with the ComponentPropertyType meta-annotation so that, at build time, the annotation is recognized as a component property type.

there is really no benefit in using SOURCE retention type and it actually limits the usefulness with other tools (e.g. bnd/tycho).