[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [cdt-dev] Setting the value of an option according to another option's value in MBS
|
Hello,
Sorry, the test case given in my previous msg had incorrect category ids
in the options. Here is a revised version:
<optionCategory
id="toolchain.optionCategory.testing"
name="Testing Options">
</optionCategory>
<option
category="toolchain.optionCategory.testing"
id="OptionA"
isAbstract="false"
name="OptionA (Master)"
resourceFilter="all"
valueType="enumerated">
<enumeratedOptionValue
id="OptionA.enumValue1"
name="OptionA.enumValue1">
</enumeratedOptionValue>
<enumeratedOptionValue
id="OptionA.enumValue2"
name="OptionA.enumValue2">
</enumeratedOptionValue>
</option>
<option
category="toolchain.optionCategory.testing"
id="OptionB"
isAbstract="false"
name="OptionB (Slave)"
resourceFilter="all"
valueType="string">
<enablement
attribute="value"
type="CONTAINER_ATTRIBUTE"
value="The value of Option A is OptionA.enumValue1">
<checkOption
isRegex="false"
optionId="OptionA"
value="OptionA.enumValue1">
</checkOption>
</enablement>
<enablement
attribute="value"
type="CONTAINER_ATTRIBUTE"
value="The value of Option A is OptionA.enumValue2">
<checkOption
isRegex="false"
optionId="OptionA"
value="OptionA.enumValue2">
</checkOption>
</enablement>
</option>
Again, why is OptionB's adjusted value being reset by MBS? Is this
approach incorrect?
I am seeing a similar behavior even when using an
IManagedOptionValueHandler to programmatically set the value of OptionB
according to OptionA's value. The handler class works as expected but
OptionB's value is overwrittien afterwards by an old value...
Thanks,
/Mario
-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
On Behalf Of Mario Pierro
Sent: den 22 april 2009 15:06
To: CDT General developers list.
Subject: [cdt-dev] Setting the value of an option according to
anotheroption's value in MBS
Hello,
I am struggling with a problem in Managed Build System, which regards
enablement expressions for options. I am using v200902130801.
I have defined a custom toolchain in MBS using the buildDefinitions
extension point. I am trying to establish a dependency between two
options OptionA, OptionB so that the value of OptionB is determined from
the value of OptionA.
To do so, the OptionB has several enablement expressions with type
CONTAINER_ATTRIBUTE, which set its value.
Every enablement's value is determined by a checkOption expression.
Here is a test case:
<toolchain id="myToolchain">
<optionCategory
id="toolchain.optionCategory.testing"
name="Testing Options">
</optionCategory>
<option
category="iar.r32c.toolchain.optionCategory.testing"
id="OptionA"
isAbstract="false"
name="OptionA (Master)"
resourceFilter="all"
valueType="enumerated">
<enumeratedOptionValue
id="OptionA.enumValue1"
name="OptionA.enumValue1">
</enumeratedOptionValue>
<enumeratedOptionValue
id="OptionA.enumValue2"
name="OptionA.enumValue2">
</enumeratedOptionValue>
</option>
<option
category="iar.r32c.toolchain.optionCategory.testing"
id="OptionB"
isAbstract="false"
name="OptionB (Slave)"
resourceFilter="all"
valueType="string">
<enablement
attribute="value"
type="CONTAINER_ATTRIBUTE"
value="The value of Option A is OptionA.enumValue1">
<checkOption
isRegex="false"
optionId="OptionA"
value="OptionA.enumValue1">
</checkOption>
</enablement>
<enablement
attribute="value"
type="CONTAINER_ATTRIBUTE"
value="The value of Option A is OptionA.enumValue2">
<checkOption
isRegex="false"
optionId="OptionA"
value="OptionA.enumValue2">
</checkOption>
</enablement>
</option>
.
.
(tools declarations, project types, configurations, etc...)
.
.
</toolChain>
In the BuildSettings tab, when the value of OptionA is changed, the
value of OptionB does not change (it keeps its initial value).
This also happens when the "Apply" button is pressed.
I tried to debug into the ToolSettingsTab class after having clicked
Apply.
An instance of OptionB is properly adjusted by evaluating and applying
its enablement expressions.
Eventually, the
ToolSettingsTab.setOption(IOption op1, IOption op2, IHoldsOptions dst,
IResourceInfo res)
method is called with the previous and the adjusted instances of
OptionB.
Apparently, the adjusted instance is reset to the old value in
ManagedBuildManager.setOption(IResourceInfo resConfig, IHoldsOptions
holder, IOption option, String value)
Also, other types of enablement (such as UI_ENABLEMENT) work as
expected; the problem is only with CONTAINER_ATTRIBUTE enablements.
Is this a bug? What is the correct way of declaring two dependent
options in MBS?
Thanks for the help!
/Mario
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev