397 references to ExpanderOptions
Microsoft.Build (165)
BackEnd\Components\RequestBuilder\IntrinsicTasks\ItemGroupIntrinsicTask.cs (15)
71
ExpanderOptions
.ExpandAll,
86
var keepMetadataEvaluated = bucket.Expander.ExpandIntoStringListLeaveEscaped(child.KeepMetadata,
ExpanderOptions
.ExpandAll, child.KeepMetadataLocation).ToList();
95
var removeMetadataEvaluated = bucket.Expander.ExpandIntoStringListLeaveEscaped(child.RemoveMetadata,
ExpanderOptions
.ExpandAll, child.RemoveMetadataLocation).ToList();
104
var matchOnMetadataEvaluated = bucket.Expander.ExpandIntoStringListLeaveEscaped(child.MatchOnMetadata,
ExpanderOptions
.ExpandAll, child.MatchOnMetadataLocation).ToList();
177
ExpanderOptions
.ExpandAll,
185
ExpanderOptions
expanderOptions =
ExpanderOptions
.ExpandAll;
191
expanderOptions |=
ExpanderOptions
.LogOnItemMetadataSelfReference;
213
ExpanderOptions
.ExpandAll,
331
ExpanderOptions
.ExpandAll,
339
string evaluatedValue = bucket.Expander.ExpandIntoStringLeaveEscaped(metadataInstance.Value,
ExpanderOptions
.ExpandAll, metadataInstance.Location);
394
string evaluatedInclude = expander.ExpandIntoStringLeaveEscaped(originalItem.Include,
ExpanderOptions
.ExpandPropertiesAndMetadata, originalItem.IncludeLocation);
405
string evaluatedExclude = expander.ExpandIntoStringLeaveEscaped(originalItem.Exclude,
ExpanderOptions
.ExpandAll, originalItem.ExcludeLocation);
432
ExpanderOptions
.ExpandItems,
562
var specificationPieces = expander.ExpandIntoStringListLeaveEscaped(specification,
ExpanderOptions
.ExpandAll, specificationLocation);
BackEnd\Components\RequestBuilder\IntrinsicTasks\PropertyGroupIntrinsicTask.cs (2)
65
ExpanderOptions
.ExpandAll,
85
string evaluatedValue = bucket.Expander.ExpandIntoStringLeaveEscaped(property.Value,
ExpanderOptions
.ExpandAll, property.Location);
BackEnd\Components\RequestBuilder\TargetEntry.cs (12)
361
ExpanderOptions
.ExpandPropertiesAndItems,
378
string expanded = _expander.ExpandIntoStringAndUnescape(_target.Condition,
ExpanderOptions
.ExpandPropertiesAndItems |
ExpanderOptions
.LeavePropertiesUnexpandedOnError |
ExpanderOptions
.Truncate, _target.ConditionLocation);
404
var dependencies = _expander.ExpandIntoStringListLeaveEscaped(_target.DependsOnTargets,
ExpanderOptions
.ExpandPropertiesAndItems, _target.DependsOnTargetsLocation);
618
ExpanderOptions
.ExpandPropertiesAndItems,
638
targetOutputItemsList = bucket.Expander.ExpandIntoTaskItemsLeaveEscaped(targetReturns,
ExpanderOptions
.ExpandAll, targetReturnsLocation).ToList();
642
targetOutputItemsList.AddRange(bucket.Expander.ExpandIntoTaskItemsLeaveEscaped(targetReturns,
ExpanderOptions
.ExpandAll, targetReturnsLocation));
653
targetOutputItems = new HashSet<TaskItem>(batchingBuckets[0].Expander.ExpandIntoTaskItemsLeaveEscaped(targetReturns,
ExpanderOptions
.ExpandAll, targetReturnsLocation)).ToArray();
660
IList<TaskItem> itemsToAdd = bucket.Expander.ExpandIntoTaskItemsLeaveEscaped(targetReturns,
ExpanderOptions
.ExpandAll, targetReturnsLocation);
710
ExpanderOptions
.ExpandPropertiesAndItems,
718
var errorTargets = _expander.ExpandIntoStringListLeaveEscaped(errorTargetInstance.ExecuteTargets,
ExpanderOptions
.ExpandPropertiesAndItems, errorTargetInstance.ExecuteTargetsLocation);
BackEnd\Components\RequestBuilder\TargetUpToDateChecker.cs (3)
412
var targetInputs = bucket.Expander.ExpandIntoStringListLeaveEscaped(TargetInputSpecification,
ExpanderOptions
.ExpandPropertiesAndMetadata, _targetToAnalyze.InputsLocation);
413
var targetOutputs = bucket.Expander.ExpandIntoStringListLeaveEscaped(TargetOutputSpecification,
ExpanderOptions
.ExpandPropertiesAndMetadata, _targetToAnalyze.OutputsLocation);
817
IList<ProjectItemInstance> itemVectorContents = bucket.Expander.ExpandSingleItemVectorExpressionIntoItems(item, itemFactory,
ExpanderOptions
.ExpandItems, true /* include null entries from transforms */, out bool isTransformExpression, elementLocation);
BackEnd\Components\RequestBuilder\TaskBuilder.cs (15)
379
ExpanderOptions
.ExpandAll,
524
string msbuildArchitecture = expander.ExpandIntoStringAndUnescape(_taskNode.MSBuildArchitecture ?? String.Empty,
ExpanderOptions
.ExpandAll, _taskNode.MSBuildArchitectureLocation ?? ElementLocation.EmptyLocation);
525
string msbuildRuntime = expander.ExpandIntoStringAndUnescape(_taskNode.MSBuildRuntime ?? String.Empty,
ExpanderOptions
.ExpandAll, _taskNode.MSBuildRuntimeLocation ?? ElementLocation.EmptyLocation);
615
string expanded = bucket.Expander.ExpandIntoStringAndUnescape(_targetChildInstance.Condition,
ExpanderOptions
.ExpandAll |
ExpanderOptions
.LeavePropertiesUnexpandedOnError |
ExpanderOptions
.Truncate, _targetChildInstance.ConditionLocation);
692
string expandedValue = bucket.Expander.ExpandIntoStringAndUnescape(continueOnErrorAttribute,
ExpanderOptions
.ExpandAll, _taskNode.ContinueOnErrorLocation); // expand embedded item vectors after expanding properties and item metadata
1000
settingString = bucket.Expander.ExpandIntoStringAndUnescape(_taskNode.ContinueOnError,
ExpanderOptions
.ExpandAll, _taskNode.ContinueOnErrorLocation); // expand embedded item vectors after expanding properties and item metadata
1078
ExpanderOptions
.ExpandAll,
1097
outputTargetName = bucket.Expander.ExpandIntoStringAndUnescape(taskOutputItemInstance.ItemType,
ExpanderOptions
.ExpandAll, taskOutputItemInstance.ItemTypeLocation);
1115
outputTargetName = bucket.Expander.ExpandIntoStringAndUnescape(taskOutputPropertyInstance.PropertyName,
ExpanderOptions
.ExpandAll, taskOutputPropertyInstance.PropertyNameLocation);
1129
taskParameterName = bucket.Expander.ExpandIntoStringAndUnescape(taskParameterName,
ExpanderOptions
.ExpandAll, taskOutputSpecification.TaskParameterLocation);
1190
var outputItemSpecs = bucket.Expander.ExpandIntoStringListLeaveEscaped(taskParameterAttribute,
ExpanderOptions
.ExpandPropertiesAndMetadata, taskItemInstance.TaskParameterLocation);
1195
ICollection<ProjectItemInstance> items = bucket.Expander.ExpandIntoItemsLeaveEscaped(outputItemSpec, itemFactory,
ExpanderOptions
.ExpandItems, taskItemInstance.TaskParameterLocation);
1205
string taskParameterValue = bucket.Expander.ExpandIntoStringAndUnescape(taskParameterAttribute,
ExpanderOptions
.ExpandAll, taskPropertyInstance.TaskParameterLocation);
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (5)
1148
IList<TaskItem> finalTaskItems = _batchBucket.Expander.ExpandIntoTaskItemsLeaveEscaped(parameterValue,
ExpanderOptions
.ExpandAll, parameterLocation);
1164
_batchBucket.Expander.ExpandIntoStringAndUnescape(parameterValue,
ExpanderOptions
.ExpandAll, parameterLocation),
1180
string expandedParameterValue = _batchBucket.Expander.ExpandIntoStringAndUnescape(parameterValue,
ExpanderOptions
.ExpandAll, parameterLocation);
1203
_batchBucket.Expander.ExpandIntoStringAndUnescape(parameterValue,
ExpanderOptions
.ExpandAll, parameterLocation),
1267
IList<TaskItem> finalTaskItems = _batchBucket.Expander.ExpandIntoTaskItemsLeaveEscaped(parameterValue,
ExpanderOptions
.ExpandAll, parameterLocation);
Definition\Project.cs (4)
3262
string result = _data.Expander.ExpandIntoStringAndUnescape(unexpandedValue,
ExpanderOptions
.ExpandPropertiesAndItems, ProjectFileLocation);
3449
string evaluatedExistingInclude = _data.Expander.ExpandIntoStringLeaveEscaped(candidateExistingItemXml.Include,
ExpanderOptions
.ExpandProperties, candidateExistingItemXml.IncludeLocation);
3503
string evaluatedValueEscaped = _data.Expander.ExpandIntoStringLeaveEscaped(unevaluatedValue,
ExpanderOptions
.ExpandProperties, propertyLocation);
3560
string evaluatedValueEscaped = _data.Expander.ExpandIntoStringLeaveEscaped(unevaluatedValue,
ExpanderOptions
.ExpandAll, metadataLocation);
Definition\ProjectItem.cs (1)
507
value = expander.ExpandIntoStringLeaveEscaped(metadatum.EvaluatedValueEscaped,
ExpanderOptions
.ExpandBuiltInMetadata, metadatum.Location);
Definition\Toolset.cs (1)
1043
ExpanderOptions
.ExpandProperties,
Definition\ToolsetReader.cs (1)
582
return expander.ExpandIntoStringAndUnescape(property.Value,
ExpanderOptions
.ExpandProperties, property.Source);
Evaluation\ConditionEvaluator.cs (5)
186
ExpanderOptions
expanderOptions,
219
ExpanderOptions
expanderOptions,
391
private readonly
ExpanderOptions
_expanderOptions;
423
ExpanderOptions
expanderOptions,
451
expression = _expander.ExpandIntoStringAndUnescape(expression, _expanderOptions |
ExpanderOptions
.BreakOnNotEmpty, ElementLocation);
Evaluation\Evaluator.cs (32)
371
string evaluatedIncludeEscaped = expander.ExpandIntoStringLeaveEscaped(unevaluatedIncludeEscaped,
ExpanderOptions
.ExpandProperties, itemElement.IncludeLocation);
382
IList<I> itemsFromSplit = expander.ExpandSingleItemVectorExpressionIntoItems(includeSplitEscaped, itemFactory,
ExpanderOptions
.ExpandItems, false /* do not include null expansion results */, out throwaway, itemElement.IncludeLocation);
736
ExpanderOptions
.ExpandPropertiesAndItems,
865
var initialTargets = _expander.ExpandIntoStringListLeaveEscaped(currentProjectOrImport.InitialTargets,
ExpanderOptions
.ExpandProperties, currentProjectOrImport.InitialTargetsLocation);
870
foreach (string propertyName in _expander.ExpandIntoStringListLeaveEscaped(currentProjectOrImport.TreatAsLocalProperty,
ExpanderOptions
.ExpandProperties, currentProjectOrImport.TreatAsLocalPropertyLocation))
951
string expanded = _expander.ExpandIntoStringLeaveEscaped(currentProjectOrImport.DefaultTargets,
ExpanderOptions
.ExpandProperties, currentProjectOrImport.DefaultTargetsLocation);
979
if (EvaluateConditionCollectingConditionedProperties(propertyGroupElement,
ExpanderOptions
.ExpandProperties, ParserOptions.AllowProperties))
994
if (EvaluateCondition(itemDefinitionGroupElement,
ExpanderOptions
.ExpandProperties, ParserOptions.AllowProperties))
1011
bool itemGroupConditionResult = lazyEvaluator.EvaluateConditionWithCurrentState(itemGroupElement,
ExpanderOptions
.ExpandPropertiesAndItems, ParserOptions.AllowPropertiesAndItemLists);
1056
var beforeTargets = _expander.ExpandIntoStringListLeaveEscaped(targetElement.BeforeTargets,
ExpanderOptions
.ExpandPropertiesAndItems, targetElement.BeforeTargetsLocation);
1057
var afterTargets = _expander.ExpandIntoStringListLeaveEscaped(targetElement.AfterTargets,
ExpanderOptions
.ExpandPropertiesAndItems, targetElement.AfterTargetsLocation);
1291
if (!EvaluateConditionCollectingConditionedProperties(propertyElement,
ExpanderOptions
.ExpandProperties, ParserOptions.AllowProperties))
1302
string evaluatedValue = _expander.ExpandIntoStringLeaveEscaped(propertyElement.Value,
ExpanderOptions
.ExpandProperties, propertyElement.Location);
1312
bool itemConditionResult = lazyEvaluator.EvaluateConditionWithCurrentState(itemElement,
ExpanderOptions
.ExpandPropertiesAndItems, ParserOptions.AllowPropertiesAndItemLists);
1348
if (EvaluateCondition(itemDefinitionElement,
ExpanderOptions
.ExpandPropertiesAndMetadata, ParserOptions.AllowPropertiesAndCustomMetadata))
1358
if (EvaluateCondition(metadataElement,
ExpanderOptions
.ExpandPropertiesAndMetadata, ParserOptions.AllowPropertiesAndCustomMetadata))
1360
string evaluatedValue = _expander.ExpandIntoStringLeaveEscaped(metadataElement.Value,
ExpanderOptions
.ExpandPropertiesAndCustomMetadata, itemDefinitionElement.Location);
1414
if (EvaluateConditionCollectingConditionedProperties(importGroupElement,
ExpanderOptions
.ExpandProperties, ParserOptions.AllowProperties, _projectRootElementCache))
1438
if (EvaluateConditionCollectingConditionedProperties(whenElement,
ExpanderOptions
.ExpandProperties, ParserOptions.AllowProperties))
1588
if (!EvaluateConditionCollectingConditionedProperties(importElement, newExpandedCondition,
ExpanderOptions
.ExpandProperties, ParserOptions.AllowProperties,
1685
if (!EvaluateConditionCollectingConditionedProperties(importElement,
ExpanderOptions
.ExpandProperties,
1691
string expanded = _expander.ExpandIntoStringAndUnescape(importElement.Condition,
ExpanderOptions
.ExpandProperties |
ExpanderOptions
.LeavePropertiesUnexpandedOnError |
ExpanderOptions
.Truncate, importElement.ConditionLocation);
1761
const
ExpanderOptions
Options =
ExpanderOptions
.ExpandProperties;
1973
string importExpressionEscaped = _expander.ExpandIntoStringLeaveEscaped(unescapedExpression,
ExpanderOptions
.ExpandProperties, importElement.ProjectLocation);
2376
private bool EvaluateCondition(ProjectElement element,
ExpanderOptions
expanderOptions, ParserOptions parserOptions)
2381
private bool EvaluateCondition(ProjectElement element, string condition,
ExpanderOptions
expanderOptions, ParserOptions parserOptions)
2404
private bool EvaluateConditionCollectingConditionedProperties(ProjectElement element,
ExpanderOptions
expanderOptions, ParserOptions parserOptions, ProjectRootElementCacheBase projectRootElementCache = null)
2412
private bool EvaluateConditionCollectingConditionedProperties(ProjectElement element, string condition,
ExpanderOptions
expanderOptions, ParserOptions parserOptions, ProjectRootElementCacheBase projectRootElementCache = null)
2485
ExpanderOptions
.ExpandProperties, importElement.ProjectLocation);
Evaluation\Expander.cs (45)
475
internal string ExpandIntoStringAndUnescape(string expression,
ExpanderOptions
options, IElementLocation elementLocation)
489
internal string ExpandIntoStringLeaveEscaped(string expression,
ExpanderOptions
options, IElementLocation elementLocation)
510
internal object ExpandPropertiesLeaveTypedAndEscaped(string expression,
ExpanderOptions
options, IElementLocation elementLocation)
529
internal SemiColonTokenizer ExpandIntoStringListLeaveEscaped(string expression,
ExpanderOptions
options, IElementLocation elementLocation)
531
ErrorUtilities.VerifyThrow((options &
ExpanderOptions
.BreakOnNotEmpty) == 0, "not supported");
542
internal IList<TaskItem> ExpandIntoTaskItemsLeaveEscaped(string expression,
ExpanderOptions
options, IElementLocation elementLocation)
557
internal IList<T> ExpandIntoItemsLeaveEscaped<T>(string expression, IItemFactory<I, T> itemFactory,
ExpanderOptions
options, IElementLocation elementLocation)
584
if ((itemsToAdd == null /* broke out early non empty */ || (itemsToAdd.Count > 0)) && (options &
ExpanderOptions
.BreakOnNotEmpty) != 0)
630
internal IList<T> ExpandSingleItemVectorExpressionIntoItems<T>(string expression, IItemFactory<I, T> itemFactory,
ExpanderOptions
options, bool includeNullItems, out bool isTransformExpression, IElementLocation elementLocation)
645
string expression,
ExpanderOptions
options, IElementLocation elementLocation)
652
ExpanderOptions
options, bool includeNullEntries, out bool isTransformExpression, IElementLocation elementLocation)
663
ExpanderOptions
options,
695
private static bool IsTruncationEnabled(
ExpanderOptions
options)
697
return (options &
ExpanderOptions
.Truncate) != 0 && !Traits.Instance.EscapeHatches.DoNotTruncateConditions;
930
internal static string ExpandMetadataLeaveEscaped(string expression, IMetadataTable metadata,
ExpanderOptions
options, IElementLocation elementLocation, LoggingContext loggingContext = null)
934
if ((options &
ExpanderOptions
.ExpandMetadata) == 0)
1049
private
ExpanderOptions
_options;
1060
ExpanderOptions
options,
1065
_options = options & (
ExpanderOptions
.ExpandMetadata |
ExpanderOptions
.Truncate |
ExpanderOptions
.LogOnItemMetadataSelfReference);
1069
ErrorUtilities.VerifyThrow(options !=
ExpanderOptions
.Invalid, "Must be expanding metadata of some kind");
1094
(isBuiltInMetadata && ((_options &
ExpanderOptions
.ExpandBuiltInMetadata) != 0)) ||
1095
(!isBuiltInMetadata && ((_options &
ExpanderOptions
.ExpandCustomMetadata) != 0)))
1099
if ((_options &
ExpanderOptions
.LogOnItemMetadataSelfReference) != 0 &&
1151
ExpanderOptions
options,
1187
ExpanderOptions
options,
1192
if (((options &
ExpanderOptions
.ExpandProperties) == 0) || String.IsNullOrEmpty(expression))
1345
ExpanderOptions
options,
1448
catch (Exception) when (options.HasFlag(
ExpanderOptions
.LeavePropertiesUnexpandedOnError))
1833
Expander<P, I> expander, string expression, IItemProvider<S> items, IItemFactory<S, T> itemFactory,
ExpanderOptions
options,
1851
string expression,
ExpanderOptions
options, IElementLocation elementLocation)
1853
if (((options &
ExpanderOptions
.ExpandItems) == 0) || (expression.Length == 0))
1887
ExpanderOptions
options, bool includeNullEntries, out bool isTransformExpression, IElementLocation elementLocation)
1998
ExpanderOptions
options,
2039
if ((item.EvaluatedIncludeEscaped.Length > 0) && (options &
ExpanderOptions
.BreakOnNotEmpty) != 0)
2054
if (!string.IsNullOrEmpty(itemTuple.Key) && (options &
ExpanderOptions
.BreakOnNotEmpty) != 0)
2079
internal static string ExpandItemVectorsIntoString<T>(Expander<P, I> expander, string expression, IItemProvider<T> items,
ExpanderOptions
options, IElementLocation elementLocation)
2082
if ((options &
ExpanderOptions
.ExpandItems) == 0 || expression.Length == 0)
2105
if ((options &
ExpanderOptions
.BreakOnNotEmpty) != 0)
2182
ExpanderOptions
options)
2770
object result = function.Execute(item.Key, expander._properties,
ExpanderOptions
.ExpandAll, elementLocation);
3443
internal object Execute(object objectInstance, IPropertyProvider<T> properties,
ExpanderOptions
options, IElementLocation elementLocation)
3584
if (options.HasFlag(
ExpanderOptions
.LeavePropertiesUnexpandedOnError))
3655
if (options.HasFlag(
ExpanderOptions
.LeavePropertiesUnexpandedOnError))
Evaluation\ItemSpec.cs (3)
123
ExpanderOptions
.ExpandItems,
189
ExpanderOptions
.ExpandProperties,
273
ExpanderOptions
.ExpandItems,
Evaluation\LazyItemEvaluator.cs (9)
65
public bool EvaluateConditionWithCurrentState(ProjectElement element,
ExpanderOptions
expanderOptions, ParserOptions parserOptions)
73
ExpanderOptions
expanderOptions,
561
string evaluatedExclude = _expander.ExpandIntoStringLeaveEscaped(itemElement.Exclude,
ExpanderOptions
.ExpandProperties, itemElement.ExcludeLocation);
590
string evaluatedmatchOnMetadata = _expander.ExpandIntoStringLeaveEscaped(itemElement.MatchOnMetadata,
ExpanderOptions
.ExpandProperties, itemElement.MatchOnMetadataLocation);
599
string metadataExpanded = _expander.ExpandIntoStringLeaveEscaped(matchOnMetadataSplit,
ExpanderOptions
.ExpandPropertiesAndItems, itemElement.MatchOnMetadataLocation);
633
const
ExpanderOptions
expanderOptions =
ExpanderOptions
.ExpandProperties |
ExpanderOptions
.LeavePropertiesUnexpandedOnError;
677
expression,
ExpanderOptions
.ExpandItems, elementLocation);
Evaluation\LazyItemEvaluator.IncludeOperation.cs (2)
49
string excludeExpanded = _expander.ExpandIntoStringLeaveEscaped(exclude,
ExpanderOptions
.ExpandPropertiesAndItems, _itemElement.ExcludeLocation);
71
ExpanderOptions
.ExpandItems,
Evaluation\LazyItemEvaluator.LazyItemOperation.cs (2)
196
const
ExpanderOptions
metadataExpansionOptions =
ExpanderOptions
.ExpandAll;
Instance\ProjectInstance.cs (2)
2240
string result = expander.ExpandIntoStringAndUnescape(unexpandedValue,
ExpanderOptions
.ExpandPropertiesAndItems, ProjectFileLocation);
2262
ExpanderOptions
.ExpandPropertiesAndItems,
Instance\ProjectItemInstance.cs (1)
1340
return expander.ExpandIntoStringLeaveEscaped(metadatum.EvaluatedValueEscaped,
ExpanderOptions
.ExpandBuiltInMetadata, ElementLocation.EmptyLocation);
Instance\TaskRegistry.cs (5)
257
ExpanderOptions
expanderOptions,
291
ExpanderOptions
expanderOptions,
1612
internal void ExpandUsingTask<P, I>(ProjectUsingTaskElement projectUsingTaskXml, Expander<P, I> expander,
ExpanderOptions
expanderOptions)
1638
private void EvaluateTaskBody<P, I>(Expander<P, I> expander, ProjectUsingTaskBodyElement taskElement,
ExpanderOptions
expanderOptions)
1674
private void ParseUsingTaskParameterGroupElement<P, I>(UsingTaskParameterGroupElement usingTaskParameterGroup, Expander<P, I> expander,
ExpanderOptions
expanderOptions)
Microsoft.Build.Engine.UnitTests (232)
BackEnd\BatchingEngine_Tests.cs (10)
73
bucket.Expander,
ExpanderOptions
.ExpandAll,
78
Assert.Equal("a.doc;b.doc;c.doc;d.doc;e.doc", bucket.Expander.ExpandIntoStringAndUnescape("@(doc)",
ExpanderOptions
.ExpandItems, MockElementLocation.Instance));
79
Assert.Equal("unittests.foo", bucket.Expander.ExpandIntoStringAndUnescape("$(bogus)$(UNITTESTS)",
ExpanderOptions
.ExpandPropertiesAndMetadata, MockElementLocation.Instance));
82
Assert.Equal("a.foo", buckets[0].Expander.ExpandIntoStringAndUnescape("@(File)",
ExpanderOptions
.ExpandItems, MockElementLocation.Instance));
83
Assert.Equal(".foo", buckets[0].Expander.ExpandIntoStringAndUnescape("@(File->'%(Extension)')",
ExpanderOptions
.ExpandItems, MockElementLocation.Instance));
84
Assert.Equal("obj\\a.ext", buckets[0].Expander.ExpandIntoStringAndUnescape("$(obj)\\%(Filename).ext",
ExpanderOptions
.ExpandPropertiesAndMetadata, MockElementLocation.Instance));
87
Assert.Equal(String.Empty, buckets[0].Expander.ExpandIntoStringAndUnescape("%(Extension)",
ExpanderOptions
.ExpandAll, MockElementLocation.Instance));
90
items = buckets[0].Expander.ExpandIntoItemsLeaveEscaped("@(file)", factory,
ExpanderOptions
.ExpandItems, MockElementLocation.Instance);
100
items = buckets[0].Expander.ExpandSingleItemVectorExpressionIntoItems("@(file)$(unitests)", factory,
ExpanderOptions
.ExpandItems, false /* no nulls */, out throwAway, MockElementLocation.Instance);
110
items = buckets[0].Expander.ExpandIntoItemsLeaveEscaped("@(file, ',')", factory,
ExpanderOptions
.ExpandItems, MockElementLocation.Instance);
BackEnd\TaskRegistry_Tests.cs (12)
1134
string expandedtaskName = RegistryExpander.ExpandIntoStringAndUnescape(taskElement.TaskName,
ExpanderOptions
.ExpandPropertiesAndItems, taskElement.TaskNameLocation);
1135
string expandedAssemblyName = RegistryExpander.ExpandIntoStringAndUnescape(taskElement.AssemblyName,
ExpanderOptions
.ExpandPropertiesAndItems, taskElement.AssemblyNameLocation);
1136
string expandedAssemblyFile = RegistryExpander.ExpandIntoStringAndUnescape(taskElement.AssemblyFile,
ExpanderOptions
.ExpandPropertiesAndItems, taskElement.AssemblyFileLocation);
1137
string expandedTaskFactory = RegistryExpander.ExpandIntoStringAndUnescape(taskElement.TaskFactory,
ExpanderOptions
.ExpandPropertiesAndItems, taskElement.TaskFactoryLocation);
1191
string expandedtaskName = RegistryExpander.ExpandIntoStringAndUnescape(taskElement.TaskName,
ExpanderOptions
.ExpandPropertiesAndItems, taskElement.TaskNameLocation);
1192
string expandedAssemblyName = RegistryExpander.ExpandIntoStringAndUnescape(taskElement.AssemblyName,
ExpanderOptions
.ExpandPropertiesAndItems, taskElement.AssemblyNameLocation);
1193
string expandedAssemblyFile = RegistryExpander.ExpandIntoStringAndUnescape(taskElement.AssemblyFile,
ExpanderOptions
.ExpandPropertiesAndItems, taskElement.AssemblyFileLocation);
1697
string expandedOutput = RegistryExpander.ExpandIntoStringAndUnescape(filledOutAttributesParameter.Output,
ExpanderOptions
.ExpandPropertiesAndItems, filledOutAttributesParameter.OutputLocation);
1698
string expandedRequired = RegistryExpander.ExpandIntoStringAndUnescape(filledOutAttributesParameter.Required,
ExpanderOptions
.ExpandPropertiesAndItems, filledOutAttributesParameter.RequiredLocation);
1699
string expandedType = RegistryExpander.ExpandIntoStringAndUnescape(filledOutAttributesParameter.ParameterType,
ExpanderOptions
.ExpandPropertiesAndItems, filledOutAttributesParameter.ParameterTypeLocation);
1794
string expandedBody = RegistryExpander.ExpandIntoStringAndUnescape(body,
ExpanderOptions
.ExpandPropertiesAndItems, bodyElement.Location);
2192
ExpanderOptions
.ExpandPropertiesAndItems,
Evaluation\Evaluator_Tests.cs (2)
4473
ExpanderOptions
.ExpandProperties,
4491
ExpanderOptions
.ExpandProperties,
Evaluation\Expander_Tests.cs (201)
49
IList<TaskItem> itemsOut = expander.ExpandIntoTaskItemsLeaveEscaped("",
ExpanderOptions
.ExpandProperties, null);
60
IList<TaskItem> itemsOut = expander.ExpandIntoTaskItemsLeaveEscaped("foo",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
71
IList<TaskItem> itemsOut = expander.ExpandIntoTaskItemsLeaveEscaped("foo;bar",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
102
IList<TaskItem> itemsOut = expander.ExpandIntoTaskItemsLeaveEscaped("foo;bar;@(compile);@(resource)",
ExpanderOptions
.ExpandPropertiesAndItems, MockElementLocation.Instance);
123
IList<TaskItem> itemsOut = expander.ExpandIntoTaskItemsLeaveEscaped("foo$(a);$(b);$(c)",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
148
IList<ProjectItemInstance> itemsOut = expander.ExpandIntoItemsLeaveEscaped("foo$(a);$(b);$(c);$(d", itemFactory,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
164
string result = expander.ExpandIntoStringLeaveEscaped("$()",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
179
IList<ProjectItemInstance> items = expander.ExpandIntoItemsLeaveEscaped("@(i)", itemFactory,
ExpanderOptions
.ExpandItems, MockElementLocation.Instance);
199
IList<ProjectItemInstance> items = expander.ExpandIntoItemsLeaveEscaped("@(i)", itemFactory,
ExpanderOptions
.ExpandItems, MockElementLocation.Instance);
219
IList<ProjectItemInstance> itemsTrue = expander.ExpandIntoItemsLeaveEscaped("@(i->AnyHaveMetadataValue('Even', 'true'))", itemFactory,
ExpanderOptions
.ExpandItems, MockElementLocation.Instance);
225
IList<ProjectItemInstance> itemsFalse = expander.ExpandIntoItemsLeaveEscaped("@(i->AnyHaveMetadataValue('Even', 'goop'))", itemFactory,
ExpanderOptions
.ExpandItems, MockElementLocation.Instance);
239
IList<ProjectItemInstance> itemsEmpty = expander.ExpandIntoItemsLeaveEscaped("@(unsetItem->AnyHaveMetadataValue('Metadatum', 'value'))", itemFactory,
ExpanderOptions
.ExpandItems, MockElementLocation.Instance);
257
IList<ProjectItemInstance> itemsTrue = expander.ExpandIntoItemsLeaveEscaped("@(i->Metadata('Meta0')->DirectoryName()->Distinct())", itemFactory,
ExpanderOptions
.ExpandItems, MockElementLocation.Instance);
263
IList<ProjectItemInstance> itemsDir = expander.ExpandIntoItemsLeaveEscaped("@(i->Metadata('Meta9')->DirectoryName()->Distinct())", itemFactory,
ExpanderOptions
.ExpandItems, MockElementLocation.Instance);
283
IList<ProjectItemInstance> itemsTrue = expander.ExpandIntoItemsLeaveEscaped("@(i->Metadata('Meta0')->Directory())", itemFactory,
ExpanderOptions
.ExpandItems, MockElementLocation.Instance);
289
itemsTrue = expander.ExpandIntoItemsLeaveEscaped("@(i->Metadata('Meta0')->Filename())", itemFactory,
ExpanderOptions
.ExpandItems, MockElementLocation.Instance);
295
itemsTrue = expander.ExpandIntoItemsLeaveEscaped("@(i->Metadata('Meta0')->Extension())", itemFactory,
ExpanderOptions
.ExpandItems, MockElementLocation.Instance);
311
string result = expander.ExpandIntoStringLeaveEscaped("[@(type->'%($(a)), '%'')]",
ExpanderOptions
.ExpandAll, MockElementLocation.Instance);
325
string result = expander.ExpandIntoStringLeaveEscaped("[@(i->'%(Meta9))']",
ExpanderOptions
.ExpandAll, MockElementLocation.Instance);
341
string result = expander.ExpandIntoStringLeaveEscaped("@(i->'%(Meta0)'->'%(Directory)'->Distinct())",
ExpanderOptions
.ExpandItems, MockElementLocation.Instance);
357
string result = expander.ExpandIntoStringLeaveEscaped("[@(i->'%(Meta0)'->'%(Directory)'->Distinct())]",
ExpanderOptions
.ExpandItems, MockElementLocation.Instance);
371
string result = expander.ExpandIntoStringLeaveEscaped("@(i->'%(MetaBlank)'->'%(Directory)'->Distinct())",
ExpanderOptions
.ExpandItems, MockElementLocation.Instance);
656
IList<ProjectItemInstance> itemsTrue = expander.ExpandIntoItemsLeaveEscaped("@(i->'%(Meta0)'->'%(Directory)')", itemFactory,
ExpanderOptions
.ExpandItems, MockElementLocation.Instance);
662
itemsTrue = expander.ExpandIntoItemsLeaveEscaped("@(i->'%(Meta0)'->'%(Filename)')", itemFactory,
ExpanderOptions
.ExpandItems, MockElementLocation.Instance);
668
itemsTrue = expander.ExpandIntoItemsLeaveEscaped("@(i->'%(Meta0)'->'%(Extension)'->Distinct())", itemFactory,
ExpanderOptions
.ExpandItems, MockElementLocation.Instance);
674
itemsTrue = expander.ExpandIntoItemsLeaveEscaped("@(i->'%(Meta0)'->'%(Filename)'->Substring($(Val)))", itemFactory,
ExpanderOptions
.ExpandItems, MockElementLocation.Instance);
694
IList<ProjectItemInstance> itemsTrue = expander.ExpandIntoItemsLeaveEscaped("@(i->Metadata('Meta0')->DirectoryName())", itemFactory,
ExpanderOptions
.ExpandItems, MockElementLocation.Instance);
714
IList<ProjectItemInstance> items = expander.ExpandIntoItemsLeaveEscaped("@(i->Metadata('Meta10')->DirectoryName())", itemFactory,
ExpanderOptions
.ExpandItems, MockElementLocation.Instance);
734
IList<ProjectItemInstance> items = expander.ExpandIntoItemsLeaveEscaped("@(i->ClearMetadata())", itemFactory,
ExpanderOptions
.ExpandItems, MockElementLocation.Instance);
1425
ExpanderOptions
.ExpandAll, MockElementLocation.Instance);
1457
expander.ExpandIntoStringAndUnescape(stringToExpand,
ExpanderOptions
.ExpandAll, MockElementLocation.Instance));
1462
expander.ExpandIntoStringAndUnescape(stringToExpand,
ExpanderOptions
.ExpandAll, MockElementLocation.Instance));
1467
expander.ExpandIntoStringAndUnescape(stringToExpand,
ExpanderOptions
.ExpandAll, MockElementLocation.Instance));
1472
expander.ExpandIntoStringAndUnescape(stringToExpand,
ExpanderOptions
.ExpandAll, MockElementLocation.Instance));
1477
expander.ExpandIntoStringAndUnescape(stringToExpand,
ExpanderOptions
.ExpandAll, MockElementLocation.Instance));
1482
expander.ExpandIntoStringAndUnescape(stringToExpand,
ExpanderOptions
.ExpandAll, MockElementLocation.Instance));
1487
expander.ExpandIntoStringAndUnescape(stringToExpand,
ExpanderOptions
.ExpandAll, MockElementLocation.Instance));
1492
expander.ExpandIntoStringAndUnescape(stringToExpand,
ExpanderOptions
.ExpandAll, MockElementLocation.Instance));
1512
expander.ExpandIntoStringAndUnescape(xmlattribute.Value,
ExpanderOptions
.ExpandAll, MockElementLocation.Instance));
1518
expander.ExpandIntoStringAndUnescape(xmlattribute.Value,
ExpanderOptions
.ExpandAll, MockElementLocation.Instance));
1540
expander.ExpandIntoStringAndUnescape(xmlattribute.Value,
ExpanderOptions
.ExpandAll, MockElementLocation.Instance));
1561
expander.ExpandIntoStringLeaveEscaped(xmlattribute.Value,
ExpanderOptions
.ExpandAll, MockElementLocation.Instance));
1620
Assert.Equal(expected, expander.ExpandIntoStringAndUnescape(xmlattribute.Value,
ExpanderOptions
.ExpandAll |
ExpanderOptions
.Truncate, MockElementLocation.Instance));
1643
string expandedString = expander.ExpandIntoStringLeaveEscaped(xmlattribute.Value,
ExpanderOptions
.ExpandAll, MockElementLocation.Instance);
1667
Assert.Equal(@"@(Resource->'%(Filename)') ; @(Content) ; @(NonExistent) ; ; %(NonExistent) ; \jk ; l\mno%3bpqr\stu ; @(IntermediateAssembly->'%(RelativeDir)') ; %(Language)_%(Culture)", expander.ExpandIntoStringAndUnescape(value,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance));
1669
Assert.Equal(@"@(Resource->'%(Filename)') ; @(Content) ; @(NonExistent) ; ; ; \jk ; l\mno%3bpqr\stu ; @(IntermediateAssembly->'%(RelativeDir)') ; english_abc%3bdef;ghi", expander.ExpandIntoStringAndUnescape(value,
ExpanderOptions
.ExpandPropertiesAndMetadata, MockElementLocation.Instance));
1671
Assert.Equal(@"string$(p);dialogs%3b ; splash.bmp ; ; ; ; \jk ; l\mno%3bpqr\stu ; subdir1" + Path.DirectorySeparatorChar + ";subdir2" + Path.DirectorySeparatorChar + " ; english_abc%3bdef;ghi", expander.ExpandIntoStringAndUnescape(value,
ExpanderOptions
.ExpandAll, MockElementLocation.Instance));
1673
Assert.Equal(@"string$(p);dialogs%3b ; splash.bmp ; ; $(NonExistent) ; %(NonExistent) ; $(OutputPath) ; $(TargetPath) ; %(Language)_%(Culture)", expander.ExpandIntoStringAndUnescape(value,
ExpanderOptions
.ExpandItems, MockElementLocation.Instance));
1691
IList<string> expanded = expander.ExpandIntoStringListLeaveEscaped(value,
ExpanderOptions
.ExpandAll, MockElementLocation.Instance).ToList();
1730
string result = expander.ExpandIntoStringLeaveEscaped(@"$(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\VSTSDB@VSTSDBDirectory)",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
1746
string result = expander.ExpandIntoStringLeaveEscaped(@"$(Solutions.VSVersion)",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
1764
expander.ExpandIntoStringLeaveEscaped(@"$(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\VSTSDB@XXXXDBDirectory)",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
1781
expander.ExpandIntoStringLeaveEscaped(@"$(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\VSTSDB@VSTSDBDirectoryX)",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
1797
string result = expander.ExpandIntoStringLeaveEscaped(@"$(Registry:HKEY_CURRENT_USER\Software\Microsoft\MSBuild_test@Value)",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
1822
string result = expander.ExpandIntoStringLeaveEscaped(@"$(Registry:HKEY_CURRENT_USER\Software\Microsoft\MSBuild_test@Value)",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
1844
string result = expander.ExpandIntoStringLeaveEscaped(@"$(Registry:HKEY_CURRENT_USER\Software\Microsoft\MSBuild_test@Value)",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
1867
string result = expander.ExpandIntoStringLeaveEscaped(@"$(Registry:HKEY_CURRENT_USER\Software\Microsoft\MSBuild_test@Value)",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
1889
string result = expander.ExpandIntoStringLeaveEscaped(@"$(Registry:HKEY_CURRENT_USER\Software\Microsoft\MSBuild_test@Value)",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
1911
string result = expander.ExpandIntoStringLeaveEscaped(@"$(Registry:HKEY_CURRENT_USER\Software\Microsoft\MSBuild_test@Value)",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2004
string result = expander.ExpandIntoStringLeaveEscaped("$([System.Convert]::ChangeType('null',$(SomeStuff.GetTypeCode())))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2020
string result = expander.ExpandIntoStringLeaveEscaped("$([System.Environment]::GetEnvironmentVariable(`_NonExistentVar`))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2024
result = expander.ExpandIntoStringLeaveEscaped("prefix_$([System.Environment]::GetEnvironmentVariable(`_NonExistentVar`))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2039
string result = expander.ExpandIntoStringLeaveEscaped("$(SomeStuff.ToUpperInvariant())",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2055
string result = expander.ExpandIntoStringLeaveEscaped("$(FileName.Trim())",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2071
string result = expander.ExpandIntoStringLeaveEscaped("$(SomeStuff.Length)",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2087
string result = expander.ExpandIntoStringLeaveEscaped("$(SomeStuff.get_Length())",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2103
string result = expander.ExpandIntoStringLeaveEscaped("$(SomeStuff.ToLowerInvariant())_goop",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2119
string result = expander.ExpandIntoStringLeaveEscaped("$(SomeStuff.SubString(13))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2135
string result = expander.ExpandIntoStringLeaveEscaped("$(SomeStuff.SubString(8))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2152
string result = expander.ExpandIntoStringLeaveEscaped("$(MyPath.SubString($(RootPath.Length)))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2169
string result = expander.ExpandIntoStringLeaveEscaped("$(SomeStuff.SubString(1$(Value)))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2186
string result = expander.ExpandIntoStringLeaveEscaped(@"$(PathRoot2.Endswith(" + Path.DirectorySeparatorChar + "))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2188
result = expander.ExpandIntoStringLeaveEscaped(@"$(PathRoot.Endswith(" + Path.DirectorySeparatorChar + "))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2204
string result = expander.ExpandIntoStringLeaveEscaped("$(SomeStuff.SubString(1$(Value)).ToLowerInvariant().SubString($(Value)))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2222
string result = expander.ExpandIntoStringLeaveEscaped("$(SomeStuff.ToUpperInvariant().ToLowerInvariant())",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2238
string result = expander.ExpandIntoStringLeaveEscaped("$(SomeStuff.SubString($(Value.get_Length())))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2253
string result = expander.ExpandIntoStringLeaveEscaped("$([MSBuild]::__GetListTest())",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2269
string result = expander.ExpandIntoStringLeaveEscaped("$(List.Split(-))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2286
string result = expander.ExpandIntoStringLeaveEscaped("$([System.Environment]::GetEnvironmentVariables())",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ToUpperInvariant();
2304
string result = expander.ExpandIntoStringLeaveEscaped("$(List.Split($(Splitter.ToCharArray())))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2326
ExpanderOptions
.ExpandProperties,
2336
ExpanderOptions
.ExpandProperties,
2357
expander.ExpandIntoStringLeaveEscaped("[$(SomeStuff($(Value)))]",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2375
expander.ExpandIntoStringLeaveEscaped("[$(SomeStuff.Lgg)]",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2392
expander.ExpandIntoStringLeaveEscaped("$(SomeStuff.ToUpperInvariant().Foo)",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2409
expander.ExpandIntoStringLeaveEscaped("[$(SomeStuff($(System.DateTime.Now)))]",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2426
expander.ExpandIntoStringLeaveEscaped("$(SomeStuff.ToLowerInvariant()_goop)",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2442
expander.ExpandIntoStringLeaveEscaped("[$(SomeStuff.Substring(HELLO!))]",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2458
expander.ExpandIntoStringLeaveEscaped("[$(SomeStuff.Substring(-10))]",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2473
expander.ExpandIntoStringLeaveEscaped("$(([System.DateTime]::Now).ToString(\"MM.dd.yyyy\"))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2486
string result = expander.ExpandIntoStringLeaveEscaped("[%(LowerLetterList.Identity.ToUpper())]",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2502
string result = expander.ExpandIntoStringLeaveEscaped("$(System)",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2521
string result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::MakeRelative($(ParentPath), `$(FilePath)`))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2538
string result = expander.ExpandIntoStringLeaveEscaped(@"$([System.IO.Path]::Combine($(Drive), `$(File)`))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2554
object result = expander.ExpandPropertiesLeaveTypedAndEscaped(@"$([System.Version]::new($(ver1)))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2578
string result = expander.ExpandIntoStringLeaveEscaped(@"$([System.Version]::new($(ver1)).CompareTo($([System.Version]::new($(ver2)))))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2599
string result = expander.ExpandIntoStringLeaveEscaped("$([System.Type]::GetType(`System.Type`))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2626
string result = expander.ExpandIntoStringLeaveEscaped("$([System.Diagnostics.Process]::GetCurrentProcess().Id)",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2655
Assert.Throws<InvalidProjectFileException>(() => expander.ExpandIntoStringLeaveEscaped("$([Microsoft.FOO.FileIO.FileSystem]::CurrentDirectory)",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance));
2656
Assert.Throws<InvalidProjectFileException>(() => expander.ExpandIntoStringLeaveEscaped("$([Foo.Baz]::new())",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance));
2657
Assert.Throws<InvalidProjectFileException>(() => expander.ExpandIntoStringLeaveEscaped("$([Foo]::new())",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance));
2658
Assert.Throws<InvalidProjectFileException>(() => expander.ExpandIntoStringLeaveEscaped("$([Foo.]::new())",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance));
2659
Assert.Throws<InvalidProjectFileException>(() => expander.ExpandIntoStringLeaveEscaped("$([.Foo]::new())",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance));
2660
Assert.Throws<InvalidProjectFileException>(() => expander.ExpandIntoStringLeaveEscaped("$([.]::new())",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance));
2661
Assert.Throws<InvalidProjectFileException>(() => expander.ExpandIntoStringLeaveEscaped("$([]::new())",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance));
2683
string result = expander.ExpandIntoStringLeaveEscaped(@"$([System.IO.Path]::Combine(`" + s_rootPathPrefix + "`, `$(File)`))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2701
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2719
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2736
Path.Combine(s_rootPathPrefix, "foo baz") + @" `, `$(File)`))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2752
string result = expander.ExpandIntoStringLeaveEscaped("$([System.DateTime]::Parse(" + dateTime + ").ToString(\"yyyy/MM/dd HH:mm:ss\"))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2767
string result = expander.ExpandIntoStringLeaveEscaped("$([System.DateTime]::Parse(" + dateTime + ").ToString(\"MM.dd.yyyy\"))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2782
string result = expander.ExpandIntoStringLeaveEscaped("$([System.DateTime]::Now.ToString(\"MM.dd.yyyy\"))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2800
@"`, $([System.IO.Path]::Combine(`foo`,`file.txt`))))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2817
string result = expander.ExpandIntoStringLeaveEscaped(@"$([System.Text.RegularExpressions.Regex]::IsMatch(`-42`, `^-?\d+(\.\d{2})?$`, `RegexOptions.IgnoreCase,RegexOptions.Singleline`))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2822
result = expander.ExpandIntoStringLeaveEscaped(@"$([System.Text.RegularExpressions.Regex]::IsMatch(`-42`, `^-?\d+(\.\d{2})?$`, System.Text.RegularExpressions.RegexOptions.IgnoreCase|RegexOptions.Singleline))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2826
result = expander.ExpandIntoStringLeaveEscaped(@"$([System.Text.RegularExpressions.Regex]::IsMatch(`100 GBP`, `^-?\d+(\.\d{2})?$`))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2841
string result = expander.ExpandIntoStringLeaveEscaped(@"$([System.DateTime]::Parse(" + dateTime + ").ToString(`yyyy/MM/dd HH:mm:ss`))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2856
string result = expander.ExpandIntoStringLeaveEscaped(@"$([System.Environment]::GetFolderPath(SpecialFolder.System))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2893
var result = expander.ExpandIntoStringLeaveEscaped(propertyFunction,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
2915
expander.ExpandIntoStringLeaveEscaped(propertyFunction,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe(expected);
2937
expander.ExpandIntoStringLeaveEscaped(propertyFunction,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe(expected);
2953
expander.ExpandIntoStringLeaveEscaped(propertyFunction,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe(expected);
2969
expander.ExpandIntoStringLeaveEscaped(propertyFunction,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe(expected);
2987
expander.ExpandIntoStringLeaveEscaped(propertyFunction,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe(expected);
3003
expander.ExpandIntoStringLeaveEscaped(propertyFunction,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe(expected);
3022
expander.ExpandIntoStringLeaveEscaped(propertyFunction,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe(expected);
3038
expander.ExpandIntoStringLeaveEscaped(propertyFunction,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe(expected);
3057
expander.ExpandIntoStringLeaveEscaped(propertyFunction,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe(expected);
3070
expander.ExpandIntoStringLeaveEscaped(propertyFunction,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe(expected);
3082
expander.ExpandIntoStringLeaveEscaped(propertyFunction,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe(expected);
3093
expander.ExpandIntoStringLeaveEscaped(propertyFunction,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe(expected);
3106
expander.ExpandIntoStringLeaveEscaped(propertyFunction,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe(expected);
3117
expander.ExpandIntoStringLeaveEscaped(propertyFunction,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe(expected);
3129
expander.ExpandIntoStringLeaveEscaped(propertyFunction,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe(expected);
3140
expander.ExpandIntoStringLeaveEscaped(propertyFunction,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe(expected);
3153
expander.ExpandIntoStringLeaveEscaped(propertyFunction,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe(expected);
3164
expander.ExpandIntoStringLeaveEscaped(propertyFunction,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe(expected);
3177
expander.ExpandIntoStringLeaveEscaped(propertyFunction,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe(expected);
3200
expander.ExpandIntoStringLeaveEscaped(propertyFunction,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe(expectedExpansion);
3211
var result = expander.ExpandIntoStringLeaveEscaped($"$([MSBuild]::IsOsPlatform({osPlatformLowerCase}))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3348
ExpanderOptions
.ExpandProperties,
3358
ExpanderOptions
.ExpandProperties,
3374
string result = expander.ExpandIntoStringLeaveEscaped("$([System.String]::Equals(`a`, `A`, StringComparison.OrdinalIgnoreCase))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3397
string result = expander.ExpandIntoStringAndUnescape(@"$([MSBuild]::GetDirectoryNameOfFileAbove($(StartingDirectory), $(FileToFind)))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3401
result = expander.ExpandIntoStringAndUnescape(@"$([MSBuild]::GetDirectoryNameOfFileAbove($(StartingDirectory), Hobbits))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3431
string result = expander.ExpandIntoStringAndUnescape(@"$([MSBuild]::GetPathOfFileAbove($(FileToFind)))",
ExpanderOptions
.ExpandProperties, mockElementLocation);
3435
result = expander.ExpandIntoStringAndUnescape(@"$([MSBuild]::GetPathOfFileAbove('Hobbits'))",
ExpanderOptions
.ExpandProperties, mockElementLocation);
3474
expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::GetPathOfFileAbove($(FileWithPath)))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3493
string result = expander.ExpandIntoStringLeaveEscaped(@"$([System.Globalization.CultureInfo]::new(`en-US`).ToString())",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3509
string result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::Add(40, 2))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3524
string result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::Add(39.9, 2.1))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3539
string result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::ValueOrDefault('', '42'))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3543
result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::ValueOrDefault('42', '43'))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3560
string result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::ValueOrDefault('$(DifferentTargetsPath)', '42'))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3566
result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::ValueOrDefault('$(DifferentTargetsPath)', '43'))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3616
expander.ExpandIntoStringAndUnescape(@"$([MSBuild]::NormalizeDirectory($(MyPath)))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance));
3620
expander.ExpandIntoStringAndUnescape(@"$([MSBuild]::NormalizeDirectory($(MyPath), $(MySecondPath)))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance));
3635
expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::DoesTaskHostExist('ASDF', 'CurrentArchitecture'))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3710
string result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::BitwiseAnd(32,$([System.IO.File]::GetAttributes(" + tempFile + "))))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3731
string result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::Add(39.9, 2.1))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3735
result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::Add(40, 2))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3739
result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::Subtract(44, 2))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3743
result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::Subtract(42.9, 0.9))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3747
result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::Multiply(21, 2))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3751
result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::Multiply(84.0, 0.5))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3755
result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::Divide(84, 2))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3759
result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::Divide(84.4, 2.0))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3763
result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::Modulo(85, 2))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3767
result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::Modulo(2345.5, 43))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3782
expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::BitwiseOr(40, 2))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe((40 | 2).ToString());
3783
expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::BitwiseAnd(42, 2))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe((42 & 2).ToString());
3784
expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::BitwiseXor(213, 255))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe((213 ^ 255).ToString());
3785
expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::BitwiseNot(-43))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe((~-43).ToString());
3786
expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::LeftShift(1, 2))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe((1 << 2).ToString());
3787
expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::RightShift(-8, 2))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe((-8 >> 2).ToString());
3788
expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::RightShiftUnsigned(-8, 2))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance).ShouldBe((-8 >>> 2).ToString());
3802
string result = expander.ExpandIntoStringLeaveEscaped(@"$( SomeStuff )",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3821
string result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::GetRegistryValue('HKEY_CURRENT_USER\Software\Microsoft\MSBuild_test', '$(SomeProperty)'))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3845
string result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::GetRegistryValue('HKEY_CURRENT_USER\Software\Microsoft\MSBuild_test', null))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3869
string result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::GetRegistryValueFromView('HKEY_CURRENT_USER\Software\Microsoft\MSBuild_test', null, null, RegistryView.Default, RegistryView.Default))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3893
string result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::GetRegistryValueFromView('HKEY_CURRENT_USER\Software\Microsoft\MSBuild_test', null, null, Microsoft.Win32.RegistryView.Default))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
3924
string result = expander.ExpandIntoStringLeaveEscaped(@"$([System.IO.Path]::Combine($(SomePath),%(Compile.Identity)))",
ExpanderOptions
.ExpandAll, MockElementLocation.Instance);
3944
string result = expander.ExpandIntoStringLeaveEscaped($"$([System.String]::new(%({metadatumName})))",
ExpanderOptions
.ExpandAll, MockElementLocation.Instance);
3973
expander.ExpandPropertiesLeaveTypedAndEscaped($"$([MSBuild]::StableStringHash('{toHash}'{hashTypeString}))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance))
4013
object hashValue = expander.ExpandPropertiesLeaveTypedAndEscaped($"$([MSBuild]::StableStringHash('FooBar'{hashTypeString}))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
4026
string intermediate = expander.ExpandPropertiesLeaveTypedAndEscaped($"$([MSBuild]::ConvertToBase64('{testCase}'))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance) as string;
4028
string original = expander.ExpandPropertiesLeaveTypedAndEscaped($"$([MSBuild]::ConvertFromBase64('{intermediate}'))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance) as string;
4040
string intermediate = expander.ExpandPropertiesLeaveTypedAndEscaped($"$([MSBuild]::ConvertToBase64('{plaintext}'))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance) as string;
4052
string original = expander.ExpandPropertiesLeaveTypedAndEscaped($"$([MSBuild]::ConvertFromBase64('{base64}'))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance) as string;
4299
result = expander.ExpandIntoStringLeaveEscaped(validTests[i][0],
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
4323
result = expander.ExpandIntoStringLeaveEscaped(errorTests[i],
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
4353
string result = expander.ExpandIntoStringLeaveEscaped($"$([MSBuild]::EnsureTrailingSlash('{path}'))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
4358
result = expander.ExpandIntoStringLeaveEscaped("$([MSBuild]::EnsureTrailingSlash($(SomeProperty)))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
4378
string result = expander.ExpandIntoStringLeaveEscaped(propertyFunction,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
4424
string result = expander.ExpandIntoStringLeaveEscaped("$([System.Guid]::NewGuid())",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
4436
var result = expander.ExpandIntoStringLeaveEscaped($"$([MSBuild]::CheckFeatureAvailability({featureName}))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
4448
var result = expander.ExpandIntoStringLeaveEscaped($"$([MSBuild]::SubstringByAsciiChars({featureName}, {start}, {length}))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
4749
string result = expander.ExpandIntoStringLeaveEscaped(expression,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
5143
.ExpandIntoStringLeaveEscaped(methodInvocationMetadata,
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
5178
.ExpandIntoStringLeaveEscaped($"$([MSBuild]::RegisterBuildCheck({dummyAssemblyFile.Path}))",
ExpanderOptions
.ExpandProperties, MockElementLocation.Instance);
ExpressionTree_Tests.cs (4)
115
ExpanderOptions
.ExpandAll,
338
ExpanderOptions
.ExpandAll,
447
ExpanderOptions
.ExpandAll,
483
ExpanderOptions
.ExpandAll,
ExpressionTreeExpression_Tests.cs (3)
441
ExpanderOptions
.ExpandAll,
465
ExpanderOptions
.ExpandAll,
497
ExpanderOptions
.ExpandAll,