Evaluate (EvaluationType.Choose);
}
- void Evaluate (EvaluationType type)
+ internal void Evaluate (EvaluationType type)
{
BuildItemGroup big;
BuildPropertyGroup bpg;
- Import import;
LinkedListNode <object> evaluate_iterator;
if (type == EvaluationType.Property) {
while (evaluate_iterator != null) {
if (evaluate_iterator.Value is BuildPropertyGroup) {
bpg = (BuildPropertyGroup) evaluate_iterator.Value;
- if (ConditionParser.ParseAndEvaluate (bpg.Condition, project))
- bpg.Evaluate ();
+ project.PushThisFileProperty (bpg.DefinedInFileName);
+ try {
+ if (ConditionParser.ParseAndEvaluate (bpg.Condition, project))
+ bpg.Evaluate ();
+ } finally {
+ project.PopThisFileProperty ();
+ }
}
// if it wasn't moved by adding anything because of evaluating a Import shift it
while (evaluate_iterator != null) {
if (evaluate_iterator.Value is BuildItemGroup) {
big = (BuildItemGroup) evaluate_iterator.Value;
- if (ConditionParser.ParseAndEvaluate (big.Condition, project))
- big.Evaluate ();
+ project.PushThisFileProperty (big.DefinedInFileName);
+ try {
+ if (ConditionParser.ParseAndEvaluate (big.Condition, project))
+ big.Evaluate ();
+ } finally {
+ project.PopThisFileProperty ();
+ }
}
evaluate_iterator = evaluate_iterator.Next;
while (evaluate_iterator != null) {
if (evaluate_iterator.Value is BuildChoose) {
BuildChoose bc = (BuildChoose)evaluate_iterator.Value;
- bool whenUsed = false;
- foreach (BuildWhen bw in bc.Whens) {
- if (ConditionParser.ParseAndEvaluate (bw.Condition, project)) {
- bw.Evaluate ();
- whenUsed = true;
- break;
+ project.PushThisFileProperty (bc.DefinedInFileName);
+ try {
+ bool whenUsed = false;
+ foreach (BuildWhen bw in bc.Whens) {
+ if (ConditionParser.ParseAndEvaluate (bw.Condition, project)) {
+ bw.Evaluate ();
+ whenUsed = true;
+ break;
+ }
}
- }
- if (!whenUsed && bc.Otherwise != null &&
- ConditionParser.ParseAndEvaluate (bc.Otherwise.Condition, project)) {
- bc.Otherwise.Evaluate ();
+ if (!whenUsed && bc.Otherwise != null &&
+ ConditionParser.ParseAndEvaluate (bc.Otherwise.Condition, project)) {
+ bc.Otherwise.Evaluate ();
+ }
+ } finally {
+ project.PopThisFileProperty ();
}
}