Bug 20634 - Microsof.Build.BuildEngine Condition parser does not support the new embedded clr property functions.
Summary: Microsof.Build.BuildEngine Condition parser does not support the new embedded...
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: Ms.Build ()
Version: master
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2014-06-16 19:37 UTC by jeremy
Modified: 2014-06-19 11:29 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Hacky fix to the tokenizer and parser. (3.14 KB, application/octet-stream)
2014-06-16 19:37 UTC, jeremy
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description jeremy 2014-06-16 19:37:17 UTC
Created attachment 7084 [details]
Hacky fix to the tokenizer and parser.

At least part of the problem is in the ConditionTokenizer and ConditionParser classes.

I've attached a patch that rather hackily adds the tokenizer and parser support. I suspect a proper fix would probably entail merging the Expression and ConditionExpression parsing though.

There is still an issue with the evaluation of the expressions in one of my builds that I haven't had a chance to figure out yet. That build is too big to upload here. If I can get a reproducible example that is small I'll upload it.
Comment 1 Marek Safar 2014-06-17 06:47:20 UTC
What condition syntax are you trying to fix?
Comment 2 jeremy 2014-06-17 10:17:40 UTC
An example syntax that fails:

Condition="$([System.String]::new('%(ReferencePath.Filename)'). StartsWith('AutoMapper.'))"

The embedded property syntax recently added works elsewhere just fine. But the Condition expressions have their own tokenization and parsing on top of the regular expression parsing.

This is a part of the Automapper nuget packages .targets file.
Comment 3 Marek Safar 2014-06-19 11:29:17 UTC
Fixed in master