Open fred-r opened 1 year ago
@cparata
@fred-r, we have discussed that in our team in the past. We found that useful to have a "one of" expression. However have not decided on how to implement it in a way that supports backward and forward compatibility. The major problem is adding a new tag. Older tools will simply ignore those elements. Adding an attribute to an accept expression won't work either, because:
Another option is to add an "exclusive" attribute to a condition. This will be also ignored by older tools, but I think it could be tolerated.
Do you have any other suggestion how to implement it?
Please also note that currently we have three options for exclusivity that can be used instead of condition:
@edriouk is this what you have in mind?
<condition id="Exclusive RTOS" exclusive="true">
<accept Cclass="CMSIS" Cgroup="RTOS2" Csub="RTX5" />
<accept Cclass="CMSIS" Cgroup="RTOS2" Csub="FreeRTOS" />
</condition>
If "exclusive" attribute is set, then the body must only contain <accept>
elements describing component attributes (Cvendor, Cbundle, Cclass, Cgroup, Csub, Cvariant, Cversion).
@jkrech , yes that is my suggestion.
It looks a nice way to bring the feature.
Is this not duplicating a feature that already exists with exclusive=1
at
I believe this does effectively the same:
<condition id="RTOS2">
<accept Cclass="CMSIS" Cgroup="RTOS2" />
</condition>
@ReinhardKeil the exclusive
attribute you refer to applies only on APIs. IMO, it does not match the original topic.
An alternative approach could be to introduce accept-one
to indicate that just one of the options is accepted.
Today with the conditions we have 3 possibilities:
accept1 | At least one accept must be true to signal a true for the complete condition (OR-Rule) | FilterType | 0..* -- | -- | -- | -- require1 | All require must be true to signal a true for the complete condition (AND-Rule). | FilterType | 0..* deny1 | If one deny is true the complete condition becomes false. This element overrules require and accept (AND-NOT-Rule). | FilterType | 0..*ACCEPT is an OR so both options can be selected at the same time. Would it be useful to have an XOR: N possibilities but only 1 can be selected.