I'd like to define targlets that are shared by multiple streams in my
project setup, and to that end I'd like to use variable substitution
in the version attributes of some requirements to let streams specify
different version ranges. Something like this:

However, attempting to do this results in exceptions in the property
sheet as it appears that the value fails to parse as a literal OSGi
version range.

Is there some way to use variables in the version range of a targlet
requirement? Perhaps an annotation that I don't know about?

If not, I can work around this by splitting out the dependencies that
would need different versions into separate targlets that I repeat in
each stream. Perhaps that's the better way to do it anyways. Any
recommendations?

On 05/07/2014 5:03 PM, Christian W. Damus wrote:
> Hi,
>
> I'd like to define targlets that are shared by multiple streams in my
> project setup, and to that end I'd like to use variable substitution
> in the version attributes of some requirements to let streams specify
> different version ranges. Something like this:
>
> Targlets
> My Dependencies
> org.eclipse.emf.sdk versionRange=[${dep.emf.min},${dep.emf.max})
>
> However, attempting to do this results in exceptions in the property
> sheet as it appears that the value fails to parse as a literal OSGi
> version range.
Yes.
>
> Is there some way to use variables in the version range of a targlet
> requirement? Perhaps an annotation that I don't know about?
Not yet, but we had planned to be able to use annotations to replace the
value of an attribute that's not a String and hence can't be specified
with a variable. Please open an enhancement request and we'll promptly
implement that. (It's already working in the "templates" we use for the
new project wizard.)
>
> If not, I can work around this by splitting out the dependencies that
> would need different versions into separate targlets that I repeat in
> each stream. Perhaps that's the better way to do it anyways. Any
> recommendations?
Using a variable definitely seems like the best way, so if we, in
general, support an annotation that targets a specific feature of the
annotated instance, once the variable is evaluated, we can use the
string value to create an instance of the feature's data type.
>
> Thanks,
>
> Christian
>

> Christian,
>
> Comments below.
>
> On 05/07/2014 5:03 PM, Christian W. Damus wrote:
>> Hi,
>>
>> I'd like to define targlets that are shared by multiple streams in my
>> project setup, and to that end I'd like to use variable substitution
>> in the version attributes of some requirements to let streams specify
>> different version ranges. Something like this:
>>
>> Targlets
>> My Dependencies
>> org.eclipse.emf.sdk versionRange=[${dep.emf.min},${dep.emf.max})
>>
>> However, attempting to do this results in exceptions in the property
>> sheet as it appears that the value fails to parse as a literal OSGi
>> version range.
> Yes.
>>
>> Is there some way to use variables in the version range of a targlet
>> requirement? Perhaps an annotation that I don't know about?
> Not yet, but we had planned to be able to use annotations to replace
> the value of an attribute that's not a String and hence can't be
> specified with a variable. Please open an enhancement request and
> we'll promptly implement that. (It's already working in the
> "templates" we use for the new project wizard.)
>>
>> If not, I can work around this by splitting out the dependencies that
>> would need different versions into separate targlets that I repeat in
>> each stream. Perhaps that's the better way to do it anyways. Any
>> recommendations?
> Using a variable definitely seems like the best way, so if we, in
> general, support an annotation that targets a specific feature of the
> annotated instance, once the variable is evaluated, we can use the
> string value to create an instance of the feature's data type.
>>
>> Thanks,
>>
>> Christian